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 /include | |
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 'include')
-rw-r--r-- | include/asm-i386/fixmap.h | 2 | ||||
-rw-r--r-- | include/asm-i386/io.h | 1 | ||||
-rw-r--r-- | include/asm-x86_64/fixmap.h | 4 | ||||
-rw-r--r-- | include/asm-x86_64/io.h | 1 | ||||
-rw-r--r-- | include/linux/console.h | 2 | ||||
-rw-r--r-- | include/linux/serial.h | 6 | ||||
-rw-r--r-- | include/linux/serial_8250.h | 4 |
7 files changed, 13 insertions, 7 deletions
diff --git a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h index 80ea052ee3a4..249e753ac805 100644 --- a/include/asm-i386/fixmap.h +++ b/include/asm-i386/fixmap.h | |||
@@ -54,6 +54,8 @@ extern unsigned long __FIXADDR_TOP; | |||
54 | enum fixed_addresses { | 54 | enum fixed_addresses { |
55 | FIX_HOLE, | 55 | FIX_HOLE, |
56 | FIX_VDSO, | 56 | FIX_VDSO, |
57 | FIX_DBGP_BASE, | ||
58 | FIX_EARLYCON_MEM_BASE, | ||
57 | #ifdef CONFIG_X86_LOCAL_APIC | 59 | #ifdef CONFIG_X86_LOCAL_APIC |
58 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 60 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
59 | #endif | 61 | #endif |
diff --git a/include/asm-i386/io.h b/include/asm-i386/io.h index e797586a5bfc..7b65b5b00034 100644 --- a/include/asm-i386/io.h +++ b/include/asm-i386/io.h | |||
@@ -129,6 +129,7 @@ extern void iounmap(volatile void __iomem *addr); | |||
129 | */ | 129 | */ |
130 | extern void *bt_ioremap(unsigned long offset, unsigned long size); | 130 | extern void *bt_ioremap(unsigned long offset, unsigned long size); |
131 | extern void bt_iounmap(void *addr, unsigned long size); | 131 | extern void bt_iounmap(void *addr, unsigned long size); |
132 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
132 | 133 | ||
133 | /* Use early IO mappings for DMI because it's initialized early */ | 134 | /* Use early IO mappings for DMI because it's initialized early */ |
134 | #define dmi_ioremap bt_ioremap | 135 | #define dmi_ioremap bt_ioremap |
diff --git a/include/asm-x86_64/fixmap.h b/include/asm-x86_64/fixmap.h index e90e1677531b..2acb9b7f6418 100644 --- a/include/asm-x86_64/fixmap.h +++ b/include/asm-x86_64/fixmap.h | |||
@@ -35,6 +35,8 @@ enum fixed_addresses { | |||
35 | VSYSCALL_LAST_PAGE, | 35 | VSYSCALL_LAST_PAGE, |
36 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, | 36 | VSYSCALL_FIRST_PAGE = VSYSCALL_LAST_PAGE + ((VSYSCALL_END-VSYSCALL_START) >> PAGE_SHIFT) - 1, |
37 | VSYSCALL_HPET, | 37 | VSYSCALL_HPET, |
38 | FIX_DBGP_BASE, | ||
39 | FIX_EARLYCON_MEM_BASE, | ||
38 | FIX_HPET_BASE, | 40 | FIX_HPET_BASE, |
39 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ | 41 | FIX_APIC_BASE, /* local (CPU) APIC) -- required for SMP or not */ |
40 | FIX_IO_APIC_BASE_0, | 42 | FIX_IO_APIC_BASE_0, |
@@ -84,7 +86,7 @@ static __always_inline unsigned long fix_to_virt(const unsigned int idx) | |||
84 | if (idx >= __end_of_fixed_addresses) | 86 | if (idx >= __end_of_fixed_addresses) |
85 | __this_fixmap_does_not_exist(); | 87 | __this_fixmap_does_not_exist(); |
86 | 88 | ||
87 | return __fix_to_virt(idx); | 89 | return __fix_to_virt(idx); |
88 | } | 90 | } |
89 | 91 | ||
90 | #endif | 92 | #endif |
diff --git a/include/asm-x86_64/io.h b/include/asm-x86_64/io.h index de2cd9a2303a..7475095c5061 100644 --- a/include/asm-x86_64/io.h +++ b/include/asm-x86_64/io.h | |||
@@ -144,6 +144,7 @@ extern void early_iounmap(void *addr, unsigned long size); | |||
144 | */ | 144 | */ |
145 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 145 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
146 | extern void iounmap(volatile void __iomem *addr); | 146 | extern void iounmap(volatile void __iomem *addr); |
147 | extern void __iomem *fix_ioremap(unsigned idx, unsigned long phys); | ||
147 | 148 | ||
148 | /* | 149 | /* |
149 | * ISA I/O bus memory addresses are 1:1 with the physical address. | 150 | * ISA I/O bus memory addresses are 1:1 with the physical address. |
diff --git a/include/linux/console.h b/include/linux/console.h index 62ef6e11d0d2..c44d3dfde7a5 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -99,6 +99,7 @@ struct console { | |||
99 | struct tty_driver *(*device)(struct console *, int *); | 99 | struct tty_driver *(*device)(struct console *, int *); |
100 | void (*unblank)(void); | 100 | void (*unblank)(void); |
101 | int (*setup)(struct console *, char *); | 101 | int (*setup)(struct console *, char *); |
102 | int (*early_setup)(void); | ||
102 | short flags; | 103 | short flags; |
103 | short index; | 104 | short index; |
104 | int cflag; | 105 | int cflag; |
@@ -107,6 +108,7 @@ struct console { | |||
107 | }; | 108 | }; |
108 | 109 | ||
109 | extern int add_preferred_console(char *name, int idx, char *options); | 110 | extern int add_preferred_console(char *name, int idx, char *options); |
111 | extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options); | ||
110 | extern void register_console(struct console *); | 112 | extern void register_console(struct console *); |
111 | extern int unregister_console(struct console *); | 113 | extern int unregister_console(struct console *); |
112 | extern struct console *console_drivers; | 114 | extern struct console *console_drivers; |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 33fc8cb8ddfb..deb714314fb1 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -177,11 +177,5 @@ struct serial_icounter_struct { | |||
177 | #ifdef __KERNEL__ | 177 | #ifdef __KERNEL__ |
178 | #include <linux/compiler.h> | 178 | #include <linux/compiler.h> |
179 | 179 | ||
180 | /* Allow architectures to override entries in serial8250_ports[] at run time: */ | ||
181 | struct uart_port; /* forward declaration */ | ||
182 | extern int early_serial_setup(struct uart_port *port); | ||
183 | extern int early_serial_console_init(char *options); | ||
184 | extern int serial8250_start_console(struct uart_port *port, char *options); | ||
185 | |||
186 | #endif /* __KERNEL__ */ | 180 | #endif /* __KERNEL__ */ |
187 | #endif /* _LINUX_SERIAL_H */ | 181 | #endif /* _LINUX_SERIAL_H */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 71310d80c09a..706ee9a4c80c 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -60,4 +60,8 @@ void serial8250_unregister_port(int line); | |||
60 | void serial8250_suspend_port(int line); | 60 | void serial8250_suspend_port(int line); |
61 | void serial8250_resume_port(int line); | 61 | void serial8250_resume_port(int line); |
62 | 62 | ||
63 | extern int serial8250_find_port(struct uart_port *p); | ||
64 | extern int serial8250_find_port_for_earlycon(void); | ||
65 | extern int setup_early_serial8250_console(char *cmdline); | ||
66 | |||
63 | #endif | 67 | #endif |