From: Sanjeev Premi Date: Fri, 2 Sep 2011 05:57:16 +0000 (+0000) Subject: omap3evm: Set environment variable 'ethaddr' X-Git-Tag: v2011.12-rc1~228^2~53 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5e463a243aab3609892143302af4b9694df6acee;p=u-boot omap3evm: Set environment variable 'ethaddr' It is now responsibility of the board specific init code to set the environment variable corresponding to the MAC address. Signed-off-by: Sanjeev Premi Signed-off-by: Sandeep Paulraj --- diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index b17c0fbadf..8c434633dd 100644 --- a/board/ti/evm/evm.c +++ b/board/ti/evm/evm.c @@ -217,7 +217,22 @@ int board_eth_init(bd_t *bis) { int rc = 0; #ifdef CONFIG_SMC911X +#define STR_ENV_ETHADDR "ethaddr" + + struct eth_device *dev; + uchar eth_addr[6]; + rc = smc911x_initialize(0, CONFIG_SMC911X_BASE); + + if (!eth_getenv_enetaddr(STR_ENV_ETHADDR, eth_addr)) { + dev = eth_get_dev_by_index(0); + if (dev) { + eth_setenv_enetaddr(STR_ENV_ETHADDR, dev->enetaddr); + } else { + printf("omap3evm: Couldn't get eth device\n"); + rc = -1; + } + } #endif return rc; }