summaryrefslogtreecommitdiff
path: root/board/etin/debris/debris.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/etin/debris/debris.c
parent06a0c4381a65ed500c816a05b9ae7b207c3b1d4b (diff)
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/etin/debris/debris.c')
-rw-r--r--board/etin/debris/debris.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/etin/debris/debris.c b/board/etin/debris/debris.c
index 227c49a14d..a971af3aa9 100644
--- a/board/etin/debris/debris.c
+++ b/board/etin/debris/debris.c
@@ -173,9 +173,13 @@ void nvram_write(long dest, const void *src, size_t count)
int misc_init_r(void)
{
- /* Write ethernet addr in NVRAM for VxWorks */
- nvram_write(CONFIG_ENV_ADDR + CONFIG_SYS_NVRAM_VXWORKS_OFFS,
- (char*)&gd->bd->bi_enetaddr[0], 6);
+ uchar ethaddr[6];
+
+ if (eth_getenv_enetaddr("ethaddr", ethaddr))
+ /* Write ethernet addr in NVRAM for VxWorks */
+ nvram_write(CONFIG_ENV_ADDR + CONFIG_SYS_NVRAM_VXWORKS_OFFS,
+ ethaddr, 6);
+
return 0;
}