diff options
author | David Gibson <david@gibson.dropbear.id.au> | 2007-05-07 22:59:31 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2007-05-08 00:47:33 -0400 |
commit | d9b55a03611ff2e2e54fb4e1ad2648d5eb870fa3 (patch) | |
tree | 5704be539afcd6f29b1f5751476c8b4f53673bff /arch/powerpc/kernel/udbg_16550.c | |
parent | f6dfc80554b27da11dbb36ebae166b23ec3aa9ca (diff) |
[POWERPC] Early serial debug support for PPC44x
This adds support for early serial debugging via the built in
port on IBM/AMCC PowerPC 44x CPUs. It uses a bolted TLB entry in
address space 1 for the UART's mapping, allowing robust debugging both
before and after the initialization of the MMU.
Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/udbg_16550.c')
-rw-r--r-- | arch/powerpc/kernel/udbg_16550.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index a963f657222b..7afab5bcd61a 100644 --- a/arch/powerpc/kernel/udbg_16550.c +++ b/arch/powerpc/kernel/udbg_16550.c | |||
@@ -191,3 +191,26 @@ void udbg_init_pas_realmode(void) | |||
191 | udbg_getc_poll = NULL; | 191 | udbg_getc_poll = NULL; |
192 | } | 192 | } |
193 | #endif /* CONFIG_PPC_MAPLE */ | 193 | #endif /* CONFIG_PPC_MAPLE */ |
194 | |||
195 | #ifdef CONFIG_PPC_EARLY_DEBUG_44x | ||
196 | #include <platforms/44x/44x.h> | ||
197 | |||
198 | static void udbg_44x_as1_putc(char c) | ||
199 | { | ||
200 | if (udbg_comport) { | ||
201 | while ((as1_readb(&udbg_comport->lsr) & LSR_THRE) == 0) | ||
202 | /* wait for idle */; | ||
203 | as1_writeb(c, &udbg_comport->thr); eieio(); | ||
204 | if (c == '\n') | ||
205 | udbg_44x_as1_putc('\r'); | ||
206 | } | ||
207 | } | ||
208 | |||
209 | void __init udbg_init_44x_as1(void) | ||
210 | { | ||
211 | udbg_comport = | ||
212 | (volatile struct NS16550 __iomem *)PPC44x_EARLY_DEBUG_VIRTADDR; | ||
213 | |||
214 | udbg_putc = udbg_44x_as1_putc; | ||
215 | } | ||
216 | #endif /* CONFIG_PPC_EARLY_DEBUG_44x */ | ||