[U-Boot] [PATCH] omap3evm: Set environment variable 'ethaddr'

Sanjeev Premi premi at ti.com
Fri Sep 2 14:43:53 CEST 2011


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 at ti.com>
---

 Tested on omap3evm at against latest master at:
 bd061a5 : Merge branch 'master' of git://git.denx.de/u-boot-sh

 board/ti/evm/evm.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/board/ti/evm/evm.c b/board/ti/evm/evm.c
index 30c1c57..07db40c 100644
--- a/board/ti/evm/evm.c
+++ b/board/ti/evm/evm.c
@@ -216,7 +216,17 @@ int board_eth_init(bd_t *bis)
 {
 	int rc = 0;
 #ifdef CONFIG_SMC911X
+	struct eth_device *dev;
+
 	rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
+
+	dev = eth_get_dev_by_index(0);
+	if (dev) {
+		eth_setenv_enetaddr("ethaddr", dev->enetaddr);
+	} else {
+		printf("omap3evm: Couldn't get eth device\n");
+		rc = -1;
+	}
 #endif
 	return rc;
 }
-- 
1.7.0.4



More information about the U-Boot mailing list