|
@@ -217,7 +217,22 @@ int board_eth_init(bd_t *bis)
|
|
{
|
|
{
|
|
int rc = 0;
|
|
int rc = 0;
|
|
#ifdef CONFIG_SMC911X
|
|
#ifdef CONFIG_SMC911X
|
|
|
|
+#define STR_ENV_ETHADDR "ethaddr"
|
|
|
|
+
|
|
|
|
+ struct eth_device *dev;
|
|
|
|
+ uchar eth_addr[6];
|
|
|
|
+
|
|
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
|
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
|
|
#endif
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|