summaryrefslogtreecommitdiff
path: root/board/xilinx/xilinx_enet/emac_adapter.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-02-11 18:38:38 -0500
committerWolfgang Denk <wd@denx.de>2009-03-20 22:39:10 +0100
commitb6b4625d175019e387e5b0f65a17322a78f6bb90 (patch)
treeb2ce2171c2fc2138f4a7d2f93a03e17559fd5b0a /board/xilinx/xilinx_enet/emac_adapter.c
parent06a0c4381a65ed500c816a05b9ae7b207c3b1d4b (diff)
downloadu-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.zip
u-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.tar.gz
u-boot-imx-b6b4625d175019e387e5b0f65a17322a78f6bb90.tar.bz2
boards: get mac address from environment
The boards that get converted here to use the environment for the mac address rather than global data: debris mgcoge mgsuvd muas3001 netstal pn62 sixnet vcma9 xilinx (the ones that use xilinx_enet) Signed-off-by: Mike Frysinger <vapier@gentoo.org> CC: Ben Warren <biggerbadderben@gmail.com> CC: Sangmoon Kim <dogoil@etinsys.com> CC: Heiko Schocher <hs@denx.de> CC: David Mueller <d.mueller@elsoft.ch> CC: Niklaus Giger <niklaus.giger@netstal.com> CC: Wolfgang Grandegger <wg@denx.de> CC: Dave Ellis <DGE@sixnetio.com> CC: Ricardo Ribalda <ricardo.ribalda@uam.es>
Diffstat (limited to 'board/xilinx/xilinx_enet/emac_adapter.c')
-rw-r--r--board/xilinx/xilinx_enet/emac_adapter.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/board/xilinx/xilinx_enet/emac_adapter.c b/board/xilinx/xilinx_enet/emac_adapter.c
index 0b100d2..35bcc4d 100644
--- a/board/xilinx/xilinx_enet/emac_adapter.c
+++ b/board/xilinx/xilinx_enet/emac_adapter.c
@@ -74,6 +74,7 @@ eth_init(bd_t * bis)
{
u32 Options;
XStatus Result;
+ uchar enetaddr[6];
#ifdef DEBUG
printf("EMAC Initialization Started\n\r");
@@ -87,11 +88,14 @@ eth_init(bd_t * bis)
/* make sure the Emac is stopped before it is started */
(void) XEmac_Stop(&Emac);
+ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
#ifdef CONFIG_ENV_IS_NOWHERE
- memcpy(bis->bi_enetaddr, EMACAddr, 6);
+ memcpy(enetaddr, EMACAddr, 6);
+ eth_setenv_enetaddr("ethaddr", enetaddr);
#endif
+ }
- Result = XEmac_SetMacAddress(&Emac, bis->bi_enetaddr);
+ Result = XEmac_SetMacAddress(&Emac, enetaddr);
if (Result != XST_SUCCESS) {
return 0;
}