diff options
author | Sanjeev Premi <premi@ti.com> | 2011-09-02 05:57:16 +0000 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2011-11-03 22:56:23 +0100 |
commit | 5e463a243aab3609892143302af4b9694df6acee (patch) | |
tree | de3b37351931d297050a498b4106b9f88caec1ba /board | |
parent | 6a6e1677ad93cebcf2bd9106911865d89c98cef5 (diff) | |
download | u-boot-imx-5e463a243aab3609892143302af4b9694df6acee.zip u-boot-imx-5e463a243aab3609892143302af4b9694df6acee.tar.gz u-boot-imx-5e463a243aab3609892143302af4b9694df6acee.tar.bz2 |
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 <premi@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
Diffstat (limited to 'board')
-rw-r--r-- | board/ti/evm/evm.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c index b17c0fb..8c43463 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; } |