if ethaddr is not setup in the environment, fill the device enetaddr with the contents of the eeprom, and only the device enetaddr, not the mac address registers!
Tested on the magnesium board. Signed-off-by: Heiko Schocher <h...@denx.de> --- - changes since v1 posted here: http://lists.denx.de/pipermail/u-boot/2010-March/069192.html - splitted in two patches as Wolfgang suggested drivers/net/fec_mxc.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 5af9cdb..98ff64b 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -749,10 +749,11 @@ static int fec_probe(bd_t *bd) eth_register(edev); - if (fec_get_hwaddr(edev, ethaddr) == 0) { - printf("got MAC address from EEPROM: %pM\n", ethaddr); - memcpy(edev->enetaddr, ethaddr, 6); - fec_set_hwaddr(edev); + if (!eth_getenv_enetaddr("ethaddr", ethaddr)) { + if (fec_get_hwaddr(edev, ethaddr) == 0) { + printf("got MAC address from EEPROM: %pM\n", ethaddr); + memcpy(edev->enetaddr, ethaddr, 6); + } } return 0; -- 1.6.2.5 -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany _______________________________________________ U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot