
Since this patch touches net/eth.c it is being sent separately.
When CONFIG_IO_MUX, CONFIG_NETCONSOLE and CFG_CONSOLE_IS_IN_ENV are all defined together it is possible that nc (netconsole) is defined as an output device. In this case it is necessary to set GD_FLG_DEVINIT after the network devices have been initialized, otherwise u-boot might try to send output to a device before it is ready, which leads to various errors.
Signed-off-by: Gary Jennejohn garyj@denx.de --- net/eth.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/net/eth.c b/net/eth.c index 432dd60..94b6e3a 100644 --- a/net/eth.c +++ b/net/eth.c @@ -26,6 +26,11 @@ #include <net.h> #include <miiphy.h>
+#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \ + defined(CFG_CONSOLE_IS_IN_ENV) +DECLARE_GLOBAL_DATA_PTR; +#endif + #if defined(CONFIG_CMD_NET) && defined(CONFIG_NET_MULTI)
/* @@ -256,6 +261,15 @@ int eth_initialize(bd_t *bis) putc ('\n'); }
+#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \ + defined(CFG_CONSOLE_IS_IN_ENV) + /* + * Must do this very late because a network device may be set as a + * console at boot time. + */ + gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */ +#endif + return eth_number; }
@@ -532,6 +546,16 @@ int eth_initialize(bd_t *bis) #if defined(CONFIG_DRIVER_TI_EMAC) davinci_eth_miiphy_initialize(bis); #endif + +#if defined(CONFIG_IO_MUX) && defined(CONFIG_NETCONSOLE) && \ + defined(CFG_CONSOLE_IS_IN_ENV) + /* + * Must do this very late because a network device may be set as a + * console at boot time. + */ + gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */ +#endif + return 0; } #endif