Skip to contentSkip to conversation

sh-sci: Extend sh-sci driver with early console

PATCH In review Magnus Damm 1 participant 1 message Nov 5, 2009 SuperH

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 sh-sci: Extend sh-sci driver with early console

From: Magnus Damm <[email protected]>

Add early serial console support to the sh-sci driver using early platform devices and "earlyprintk". To use this feature the early platform devices must be broken out to one device per port and the desired port should be selected on the kernel command line like:
"earlyprintk=sh-sci.N[,baudrate][,keep]"

We may want to ditch all the #ifdefery, but it may save some space as-is.

---

 arch/sh/Kconfig.debug         |    1 
 arch/sh/kernel/early_printk.c |   10 -------
 arch/sh/kernel/setup.c        |    5 +++
 drivers/serial/sh-sci.c       |   56 ++++++++++++++++++++++++++++++++++-------
 4 files changed, 54 insertions(+), 18 deletions(-)
arch/sh/Kconfig.debug +1 -0
@@ -21,6 +21,7 @@ config SH_STANDARD_BIOS
 
 config EARLY_SCIF_CONSOLE
 	bool "Use early SCIF console"
+	select SERIAL_SH_SCI
 	help
 	  This enables an early console using a fixed SCIF port. This can
 	  be used by platforms that are either not running the SH
arch/sh/kernel/early_printk.c +1 -9
@@ -191,15 +191,7 @@ static void scif_sercon_init(char *s)
  * Setup a default console, if more than one is compiled in, rely on the
  * earlyprintk= parsing to give priority.
  */
-static struct console *early_console -#ifdef CONFIG_SH_STANDARD_BIOS
-	&bios_console
-#elif defined(CONFIG_EARLY_SCIF_CONSOLE)
-	&scif_console
-#else
-	NULL
-#endif
-	;
+static struct console *early_console;
 
 static int __init setup_early_printk(char *buf)
 {
--- 0001/arch/sh/kernel/setup.c

+++ work/arch/sh/kernel/setup.c 2009-11-05 22:43:07.000000000 +0900
@@ -423,6 +423,11 @@ void __init setup_arch(char **cmdline_p)

plat_early_device_setup();

+#ifdef CONFIG_EARLY_PRINTK
+ /* Let earlyprintk output early console messages */
+ early_platform_driver_probe("earlyprintk", 1, 1);
+#endif
+
sh_mv_setup();

/*

drivers/serial/sh-sci.c +47 -9

102 lines not on this page · raw message