diff options
author | Tim Harvey <tharvey@gateworks.com> | 2015-04-08 12:54:33 -0700 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2015-04-22 14:39:06 +0200 |
commit | e806b2298450827eb064415c11f0fc5ae1b95764 (patch) | |
tree | 08644557e6db8626dad1dca0f08172e8893918cb /board | |
parent | 0a6ee033d7a7304eef78338a349684942a8b654e (diff) | |
download | u-boot-imx-e806b2298450827eb064415c11f0fc5ae1b95764.zip u-boot-imx-e806b2298450827eb064415c11f0fc5ae1b95764.tar.gz u-boot-imx-e806b2298450827eb064415c11f0fc5ae1b95764.tar.bz2 |
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>
Diffstat (limited to 'board')
-rw-r--r-- | board/gateworks/gw_ventana/gw_ventana.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/board/gateworks/gw_ventana/gw_ventana.c b/board/gateworks/gw_ventana/gw_ventana.c index 303b13a..84d7124 100644 --- a/board/gateworks/gw_ventana/gw_ventana.c +++ b/board/gateworks/gw_ventana/gw_ventana.c @@ -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; } |