[U-Boot] [PATCH] Enable serial console only before booting
Frédéric Leroy
fredo at starox.org
Sun Jul 7 12:25:36 CEST 2013
When netconsole is active, some boards fail to boot.
This patch enables only the serial console before
control is handed by another operating system.
Signed-off-by: Frédéric Leroy <fredo at starox.org>
---
Hello,
I am facing the same problem with LaCie kirkwood boards.
I took a simple approach for fixing this issue.
This works for me ...
Any comments are welcome :)
Frédéric
common/cmd_bootm.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/common/cmd_bootm.c b/common/cmd_bootm.c
index 15f4599..81e8322 100644
--- a/common/cmd_bootm.c
+++ b/common/cmd_bootm.c
@@ -62,6 +62,17 @@
#include <linux/lzo.h>
#endif /* CONFIG_LZO */
+
+#if defined(CONFIG_NETCONSOLE)
+#include <iomux.h>
+void console_set_serial_unconditionally(void)
+{
+ iomux_doenv(stdin, "serial");
+ iomux_doenv(stdout, "serial");
+ iomux_doenv(stderr, "serial");
+}
+#endif
+
DECLARE_GLOBAL_DATA_PTR;
#ifndef CONFIG_SYS_BOOTM_LEN
@@ -577,6 +588,7 @@ static int do_bootm_subcommand(cmd_tbl_t *cmdtp, int flag, int argc,
* Stop the ethernet stack if NetConsole could have
* left it up
*/
+ console_set_serial_unconditionally("nc");
eth_halt();
#endif
arch_preboot_os();
@@ -645,6 +657,7 @@ int do_bootm(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_NETCONSOLE
/* Stop the ethernet stack if NetConsole could have left it up */
+ console_set_serial_unconditionally("nc");
eth_halt();
#endif
@@ -1849,6 +1862,7 @@ static int do_bootz(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
#ifdef CONFIG_NETCONSOLE
/* Stop the ethernet stack if NetConsole could have left it up */
+ console_set_serial_unconditionally("nc");
eth_halt();
#endif
--
1.8.1.2
More information about the U-Boot
mailing list