X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=arch%2Fpowerpc%2Fkernel%2Fudbg_16550.c;h=e738f93b42fe34e7e7ce745ba3365bb92424520e;hb=d9bc125caf592b7d081021f32ce5b717efdf70c8;hp=5d29dcca523c113e62e9a6332552c145fbe01270;hpb=0b1fc9b86f49e1e73e473e06a16556ca0dce53ae;p=powerpc.git diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index 5d29dcca52..e738f93b42 100644 --- a/arch/powerpc/kernel/udbg_16550.c +++ b/arch/powerpc/kernel/udbg_16550.c @@ -8,13 +8,14 @@ * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version. */ -#include #include #include #include extern u8 real_readb(volatile u8 __iomem *addr); extern void real_writeb(u8 data, volatile u8 __iomem *addr); +extern u8 real_205_readb(volatile u8 __iomem *addr); +extern void real_205_writeb(u8 data, volatile u8 __iomem *addr); struct NS16550 { /* this struct must be packed */ @@ -82,10 +83,14 @@ static int udbg_550_getc(void) void udbg_init_uart(void __iomem *comport, unsigned int speed, unsigned int clock) { - unsigned int dll, base_bauds = clock / 16; + unsigned int dll, base_bauds; + if (clock == 0) + clock = 1843200; if (speed == 0) speed = 9600; + + base_bauds = clock / 16; dll = base_bauds / speed; if (comport) { @@ -164,3 +169,25 @@ void __init udbg_init_maple_realmode(void) udbg_getc_poll = NULL; } #endif /* CONFIG_PPC_MAPLE */ + +#ifdef CONFIG_PPC_PASEMI +void udbg_pas_real_putc(char c) +{ + if (udbg_comport) { + while ((real_205_readb(&udbg_comport->lsr) & LSR_THRE) == 0) + /* wait for idle */; + real_205_writeb(c, &udbg_comport->thr); eieio(); + if (c == '\n') + udbg_pas_real_putc('\r'); + } +} + +void udbg_init_pas_realmode(void) +{ + udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8; + + udbg_putc = udbg_pas_real_putc; + udbg_getc = NULL; + udbg_getc_poll = NULL; +} +#endif /* CONFIG_PPC_MAPLE */