aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/arch/microblaze/kernel/early_printk.c
diff options
context:
space:
mode:
authorMichal Simek <monstr@monstr.eu>2011-04-14 11:48:43 +0200
committerMichal Simek <monstr@monstr.eu>2011-07-25 09:25:13 +0200
commit2aa8e37596933a43fc3e46e1e385045635674429 (patch)
tree79cbf1212d42d583a5a5951e28d90e27e94df4e4 /arch/microblaze/kernel/early_printk.c
parentmicroblaze: Get early printk console earlier (diff)
downloadwireguard-linux-2aa8e37596933a43fc3e46e1e385045635674429.tar.xz
wireguard-linux-2aa8e37596933a43fc3e46e1e385045635674429.zip
microblaze: Simplify early console binding from DT
Recognize early Linux console from chosen - linux,stdout-path instead of detecting the first console with appropriate compatible strings. This patch solved the problem on system with multiple consoles. Signed-off-by: Michal Simek <monstr@monstr.eu>
Diffstat (limited to 'arch/microblaze/kernel/early_printk.c')
-rw-r--r--arch/microblaze/kernel/early_printk.c48
1 files changed, 22 insertions, 26 deletions
diff --git a/arch/microblaze/kernel/early_printk.c b/arch/microblaze/kernel/early_printk.c
index 8f8384e98bf7..e21390da0a4d 100644
--- a/arch/microblaze/kernel/early_printk.c
+++ b/arch/microblaze/kernel/early_printk.c
@@ -127,45 +127,41 @@ void early_printk(const char *fmt, ...)
int __init setup_early_printk(char *opt)
{
+ int version = 0;
+
if (early_console_initialized)
return 1;
-#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
- base_addr = early_uartlite_console();
+ base_addr = of_early_console(&version);
if (base_addr) {
- early_console_initialized = 1;
#ifdef CONFIG_MMU
early_console_reg_tlb_alloc(base_addr);
#endif
- early_console = &early_serial_uartlite_console;
- early_printk("early_printk_console is enabled at 0x%08x\n",
- base_addr);
-
- register_console(early_console);
-
- return 0;
- }
-#endif /* CONFIG_SERIAL_UARTLITE_CONSOLE */
-
+ switch (version) {
+#ifdef CONFIG_SERIAL_UARTLITE_CONSOLE
+ case UARTLITE:
+ printk(KERN_INFO "Early console on uartlite "
+ "at 0x%08x\n", base_addr);
+ early_console = &early_serial_uartlite_console;
+ break;
+#endif
#ifdef CONFIG_SERIAL_8250_CONSOLE
- base_addr = early_uart16550_console();
- base_addr &= ~3; /* clear register offset */
- if (base_addr) {
- early_console_initialized = 1;
-#ifdef CONFIG_MMU
- early_console_reg_tlb_alloc(base_addr);
+ case UART16550:
+ printk(KERN_INFO "Early console on uart16650 "
+ "at 0x%08x\n", base_addr);
+ early_console = &early_serial_uart16550_console;
+ break;
#endif
- early_console = &early_serial_uart16550_console;
-
- early_printk("early_printk_console is enabled at 0x%08x\n",
- base_addr);
+ default:
+ printk(KERN_INFO "Unsupported early console %d\n",
+ version);
+ return 1;
+ }
register_console(early_console);
-
+ early_console_initialized = 1;
return 0;
}
-#endif /* CONFIG_SERIAL_8250_CONSOLE */
-
return 1;
}