aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2017-04-02 23:09:04 -0400
committerLey Foon Tan <ley.foon.tan@intel.com>2017-05-08 04:59:19 -0400
commit44a4ed42576da5f3387005a1667cb3e7aedfd687 (patch)
treed1963ca7e55fc9a21178bd42e30de1a11f3a5b28
parent57ac76ed6c0daf02c520e09e0af421f02ee2de8b (diff)
nios2: enable earlycon support
Enable generic earlycon support for nios2. This e.g. allows to use a 8250/16650 UART as earlycon. In order to get the earlycon, we just need to call parse_early_param() in early_init_devtree() as soon as the device tree is initially scanned. By adding an stdout-path property to the dts (done in this patch for 10m50_devboard), the earlycon can be used. In order to provide early printk support, we need to provide a dummy implementation of early_console_write(), so that arch/nios2/kernel/early_printk.c can still be compiled if neither SERIAL_ALTERA_JTAGUART_CONSOLE nor SERIAL_ALTERA_UART_CONSOLE is selected. As soon as the altera_uart and altera_jtaguart support earlycon, the entire file can be removed. Tested-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Acked-by: Ley Foon Tan <ley.foon.tan@intel.com>
-rw-r--r--arch/nios2/Kconfig.debug1
-rw-r--r--arch/nios2/boot/dts/10m50_devboard.dts3
-rw-r--r--arch/nios2/kernel/early_printk.c7
-rw-r--r--arch/nios2/kernel/setup.c2
4 files changed, 9 insertions, 4 deletions
diff --git a/arch/nios2/Kconfig.debug b/arch/nios2/Kconfig.debug
index 2fd08cbfdddb..55105220370c 100644
--- a/arch/nios2/Kconfig.debug
+++ b/arch/nios2/Kconfig.debug
@@ -18,7 +18,6 @@ config EARLY_PRINTK
18 bool "Activate early kernel debugging" 18 bool "Activate early kernel debugging"
19 default y 19 default y
20 select SERIAL_CORE_CONSOLE 20 select SERIAL_CORE_CONSOLE
21 depends on SERIAL_ALTERA_JTAGUART_CONSOLE || SERIAL_ALTERA_UART_CONSOLE
22 help 21 help
23 Enable early printk on console 22 Enable early printk on console
24 This is useful for kernel debugging when your machine crashes very 23 This is useful for kernel debugging when your machine crashes very
diff --git a/arch/nios2/boot/dts/10m50_devboard.dts b/arch/nios2/boot/dts/10m50_devboard.dts
index f362b2224ee7..4bb4dc1b52e9 100644
--- a/arch/nios2/boot/dts/10m50_devboard.dts
+++ b/arch/nios2/boot/dts/10m50_devboard.dts
@@ -244,6 +244,7 @@
244 }; 244 };
245 245
246 chosen { 246 chosen {
247 bootargs = "debug console=ttyS0,115200"; 247 bootargs = "debug earlycon console=ttyS0,115200";
248 stdout-path = &a_16550_uart_0;
248 }; 249 };
249}; 250};
diff --git a/arch/nios2/kernel/early_printk.c b/arch/nios2/kernel/early_printk.c
index c08e4c1486fc..4a7bb98f744c 100644
--- a/arch/nios2/kernel/early_printk.c
+++ b/arch/nios2/kernel/early_printk.c
@@ -81,8 +81,11 @@ static void early_console_write(struct console *con, const char *s, unsigned n)
81} 81}
82 82
83#else 83#else
84# error Neither SERIAL_ALTERA_JTAGUART_CONSOLE nor SERIAL_ALTERA_UART_CONSOLE \ 84
85selected 85static void early_console_write(struct console *con, const char *s, unsigned n)
86{
87}
88
86#endif 89#endif
87 90
88static struct console early_console_prom = { 91static struct console early_console_prom = {
diff --git a/arch/nios2/kernel/setup.c b/arch/nios2/kernel/setup.c
index 6044d9be28b4..8b5146082e3e 100644
--- a/arch/nios2/kernel/setup.c
+++ b/arch/nios2/kernel/setup.c
@@ -137,6 +137,8 @@ asmlinkage void __init nios2_boot_init(unsigned r4, unsigned r5, unsigned r6,
137 strncpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE); 137 strncpy(boot_command_line, CONFIG_CMDLINE, COMMAND_LINE_SIZE);
138#endif 138#endif
139#endif 139#endif
140
141 parse_early_param();
140} 142}
141 143
142void __init setup_arch(char **cmdline_p) 144void __init setup_arch(char **cmdline_p)