diff options
author | Simon Shields <simon@lineageos.org> | 2018-09-12 00:31:50 +1000 |
---|---|---|
committer | Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org> | 2020-03-28 01:15:39 +0100 |
commit | 53cdc8b1123599ea1c618f0e915f9f7a555a358a (patch) | |
tree | daf39309d84beb3069f8e367860da67b99c51f6d /board | |
parent | 25bf530e12c3ebe072532d8e405db2e6f1ed8d15 (diff) | |
download | u-boot-midas-53cdc8b1123599ea1c618f0e915f9f7a555a358a.tar.gz u-boot-midas-53cdc8b1123599ea1c618f0e915f9f7a555a358a.tar.bz2 u-boot-midas-53cdc8b1123599ea1c618f0e915f9f7a555a358a.zip |
midas: add USB network console support
Diffstat (limited to 'board')
-rw-r--r-- | board/samsung/midas/midas.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/board/samsung/midas/midas.c b/board/samsung/midas/midas.c index b690880de1..e38357d474 100644 --- a/board/samsung/midas/midas.c +++ b/board/samsung/midas/midas.c @@ -458,6 +458,31 @@ static void midas_power_off(void) } } +static bool needs_network = false; + +int board_eth_init(bd_t *bis) +{ + if (!needs_network) { + printf("Not using network\n"); + return 0; + } + + printf("Using USB network! (ncip=%s ipaddr=%s ethaddr=%s)\n", env_get("ncip"), env_get("ipaddr"), env_get("ethaddr")); + int ret = usb_eth_initialize(bis); + if (ret < 0) { + printf("Error %d registering USB_ETHER\n", ret); + return ret; + } + + printf("Enabling usb interface\n"); + board_usb_init(0, 0); + + env_set("stdin", "serial@13820000,nc"); + env_set("stdout", "serial@13820000,nc"); + + printf("Registered USB_ETHER\n"); + return ret; +} int exynos_init(void) { @@ -499,7 +524,8 @@ int exynos_late_init(void) env_set("bootmode", "recovery"); break; case MODE_CONSOLE: - printf("Dropping into u-boot console\n"); + printf("Dropping into u-boot console (networked)\n"); + needs_network = true; midas_led_action(LED_GREEN, LEDST_ON); env_set("bootcmd", NULL); break; |