imx: ventana: assign default ethprime dynamically

Gateworks Ventana boards don't all use IMX6 FEC, so lets define default
ethprime based off the first detected device.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
This commit is contained in:
Tim Harvey 2015-04-08 12:54:33 -07:00 committed by Stefano Babic
parent 0a6ee033d7
commit e806b22984
2 changed files with 9 additions and 1 deletions

View File

@ -413,6 +413,15 @@ int board_eth_init(bd_t *bis)
usb_eth_initialize(bis);
#endif
/* default to the first detected enet dev */
if (!getenv("ethprime")) {
struct eth_device *dev = eth_get_dev_by_index(0);
if (dev) {
setenv("ethprime", dev->name);
printf("set ethprime to %s\n", getenv("ethprime"));
}
}
return 0;
}

View File

@ -178,7 +178,6 @@
#define CONFIG_MII
#define IMX_FEC_BASE ENET_BASE_ADDR
#define CONFIG_FEC_XCV_TYPE RGMII
#define CONFIG_ETHPRIME "FEC"
#define CONFIG_FEC_MXC_PHYADDR 0
#define CONFIG_PHYLIB
#define CONFIG_ARP_TIMEOUT 200UL