From 18a8bd949d6adb311ea816125ff65050df1f3f6e Mon Sep 17 00:00:00 2001 From: Yinghai Lu Date: Sun, 15 Jul 2007 23:37:59 -0700 Subject: serial: convert early_uart to earlycon for 8250 Beacuse SERIAL_PORT_DFNS is removed from include/asm-i386/serial.h and include/asm-x86_64/serial.h. the serial8250_ports need to be probed late in serial initializing stage. the console_init=>serial8250_console_init=> register_console=>serial8250_console_setup will return -ENDEV, and console ttyS0 can not be enabled at that time. need to wait till uart_add_one_port in drivers/serial/serial_core.c to call register_console to get console ttyS0. that is too late. Make early_uart to use early_param, so uart console can be used earlier. Make it to be bootconsole with CON_BOOT flag, so can use console handover feature. and it will switch to corresponding normal serial console automatically. new command line will be: console=uart8250,io,0x3f8,9600n8 console=uart8250,mmio,0xff5e0000,115200n8 or earlycon=uart8250,io,0x3f8,9600n8 earlycon=uart8250,mmio,0xff5e0000,115200n8 it will print in very early stage: Early serial console at I/O port 0x3f8 (options '9600n8') console [uart0] enabled later for console it will print: console handover: boot [uart0] -> real [ttyS0] Signed-off-by: Cc: Andi Kleen Cc: Bjorn Helgaas Cc: Russell King Cc: Gerd Hoffmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/firmware/pcdp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers/firmware') diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c index 2b4b76e8bd72..58e9f8e457f8 100644 --- a/drivers/firmware/pcdp.c +++ b/drivers/firmware/pcdp.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "pcdp.h" @@ -27,7 +28,7 @@ setup_serial_console(struct pcdp_uart *uart) char parity; mmio = (uart->addr.space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY); - p += sprintf(p, "console=uart,%s,0x%lx", + p += sprintf(p, "uart8250,%s,0x%lx", mmio ? "mmio" : "io", uart->addr.address); if (uart->baud) { p += sprintf(p, ",%lu", uart->baud); @@ -41,7 +42,8 @@ setup_serial_console(struct pcdp_uart *uart) } } - return early_serial_console_init(options); + add_preferred_console("uart", 8250, &options[9]); + return setup_early_serial8250_console(options); #else return -ENODEV; #endif -- cgit v1.2.3-59-g8ed1b