mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
ARM: omap3: evm: Refactor 'board_eth_init'
This commit clears 'ethaddr' before calling 'smc911x_initialize' to allow the SROM MAC address to be assigned properly. Signed-off-by: Derald D. Woods <woods.technical@gmail.com>
This commit is contained in:
parent
c2900f595e
commit
836e67ee66
|
@ -299,26 +299,12 @@ static void reset_net_chip(void)
|
||||||
|
|
||||||
int board_eth_init(bd_t *bis)
|
int board_eth_init(bd_t *bis)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
|
||||||
#if defined(CONFIG_SMC911X)
|
#if defined(CONFIG_SMC911X)
|
||||||
#define STR_ENV_ETHADDR "ethaddr"
|
env_set("ethaddr", NULL);
|
||||||
|
return smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
||||||
struct eth_device *dev;
|
#else
|
||||||
uchar eth_addr[6];
|
return 0;
|
||||||
|
#endif
|
||||||
rc = smc911x_initialize(0, CONFIG_SMC911X_BASE);
|
|
||||||
|
|
||||||
if (!eth_env_get_enetaddr(STR_ENV_ETHADDR, eth_addr)) {
|
|
||||||
dev = eth_get_dev_by_index(0);
|
|
||||||
if (dev) {
|
|
||||||
eth_env_set_enetaddr(STR_ENV_ETHADDR, dev->enetaddr);
|
|
||||||
} else {
|
|
||||||
printf("omap3evm: Couldn't get eth device\n");
|
|
||||||
rc = -1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_SMC911X */
|
|
||||||
return rc;
|
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_CMD_NET */
|
#endif /* CONFIG_CMD_NET */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user