diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2007-07-16 02:37:59 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-16 12:05:35 -0400 |
commit | 18a8bd949d6adb311ea816125ff65050df1f3f6e (patch) | |
tree | 4365db908430747a5c08cacdb4354577b7bfead7 /kernel/printk.c | |
parent | b1c931e39327ef121797927d4b3198d370e75b9b (diff) |
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: <yinghai.lu@sun.com>
Cc: Andi Kleen <ak@suse.de>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Gerd Hoffmann <kraxel@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/printk.c')
-rw-r--r-- | kernel/printk.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/kernel/printk.c b/kernel/printk.c index 7ce9a8c13312..f46cc6dff46e 100644 --- a/kernel/printk.c +++ b/kernel/printk.c | |||
@@ -726,6 +726,25 @@ int __init add_preferred_console(char *name, int idx, char *options) | |||
726 | return 0; | 726 | return 0; |
727 | } | 727 | } |
728 | 728 | ||
729 | int __init update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options) | ||
730 | { | ||
731 | struct console_cmdline *c; | ||
732 | int i; | ||
733 | |||
734 | for (i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) | ||
735 | if (strcmp(console_cmdline[i].name, name) == 0 && | ||
736 | console_cmdline[i].index == idx) { | ||
737 | c = &console_cmdline[i]; | ||
738 | memcpy(c->name, name_new, sizeof(c->name)); | ||
739 | c->name[sizeof(c->name) - 1] = 0; | ||
740 | c->options = options; | ||
741 | c->index = idx_new; | ||
742 | return i; | ||
743 | } | ||
744 | /* not found */ | ||
745 | return -1; | ||
746 | } | ||
747 | |||
729 | #ifndef CONFIG_DISABLE_CONSOLE_SUSPEND | 748 | #ifndef CONFIG_DISABLE_CONSOLE_SUSPEND |
730 | /** | 749 | /** |
731 | * suspend_console - suspend the console subsystem | 750 | * suspend_console - suspend the console subsystem |
@@ -942,6 +961,9 @@ void register_console(struct console *console) | |||
942 | if (preferred_console < 0 || bootconsole || !console_drivers) | 961 | if (preferred_console < 0 || bootconsole || !console_drivers) |
943 | preferred_console = selected_console; | 962 | preferred_console = selected_console; |
944 | 963 | ||
964 | if (console->early_setup) | ||
965 | console->early_setup(); | ||
966 | |||
945 | /* | 967 | /* |
946 | * See if we want to use this console driver. If we | 968 | * See if we want to use this console driver. If we |
947 | * didn't select a console we take the first one | 969 | * didn't select a console we take the first one |