From b6b4625d175019e387e5b0f65a17322a78f6bb90 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Wed, 11 Feb 2009 18:38:38 -0500 Subject: 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 CC: Ben Warren CC: Sangmoon Kim CC: Heiko Schocher CC: David Mueller CC: Niklaus Giger CC: Wolfgang Grandegger CC: Dave Ellis CC: Ricardo Ribalda --- board/etin/debris/debris.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'board/etin') diff --git a/board/etin/debris/debris.c b/board/etin/debris/debris.c index 227c49a..a971af3 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; } -- cgit v1.1