diff options
author | Manuel Lauss <manuel.lauss@googlemail.com> | 2009-10-15 12:49:27 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2010-02-27 06:52:55 -0500 |
commit | 8402a1588a4f63465079e98481dd83d1d9cc9a98 (patch) | |
tree | 1ace3c45421fe4b8d29762fcc67bd09064197f18 /arch/mips/include | |
parent | 963accbc82a0912b39de39d59e2fd6741db3aa4b (diff) |
MIPS: Alchemy: prom_putchar is board dependent
This patch replaces the general alchemy prom_putchar() implementation
in favor of board-specific versions: The UART where the output of
prom_putchar is directed to really depends on the board, the current
implementation hardcodes this on a per-SoC basis which is just wrong.
So a generic uart tx function is provided in the alchemy headers,
and the boards can provide their own prom_putchar with custom
destination uart, and all in-kernel alchemy boards support
early printk.
Signed-off-by: Manuel Lauss <manuel.lauss@gmail.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/include')
-rw-r--r-- | arch/mips/include/asm/mach-au1x00/au1000.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/mips/include/asm/mach-au1x00/au1000.h b/arch/mips/include/asm/mach-au1x00/au1000.h index c2e233997b6c..e11756d9aaa2 100644 --- a/arch/mips/include/asm/mach-au1x00/au1000.h +++ b/arch/mips/include/asm/mach-au1x00/au1000.h | |||
@@ -161,6 +161,25 @@ static inline int alchemy_get_cputype(void) | |||
161 | return ALCHEMY_CPU_UNKNOWN; | 161 | return ALCHEMY_CPU_UNKNOWN; |
162 | } | 162 | } |
163 | 163 | ||
164 | static inline void alchemy_uart_putchar(u32 uart_phys, u8 c) | ||
165 | { | ||
166 | void __iomem *base = (void __iomem *)KSEG1ADDR(uart_phys); | ||
167 | int timeout, i; | ||
168 | |||
169 | /* check LSR TX_EMPTY bit */ | ||
170 | timeout = 0xffffff; | ||
171 | do { | ||
172 | if (__raw_readl(base + 0x1c) & 0x20) | ||
173 | break; | ||
174 | /* slow down */ | ||
175 | for (i = 10000; i; i--) | ||
176 | asm volatile ("nop"); | ||
177 | } while (--timeout); | ||
178 | |||
179 | __raw_writel(c, base + 0x04); /* tx */ | ||
180 | wmb(); | ||
181 | } | ||
182 | |||
164 | /* arch/mips/au1000/common/clocks.c */ | 183 | /* arch/mips/au1000/common/clocks.c */ |
165 | extern void set_au1x00_speed(unsigned int new_freq); | 184 | extern void set_au1x00_speed(unsigned int new_freq); |
166 | extern unsigned int get_au1x00_speed(void); | 185 | extern unsigned int get_au1x00_speed(void); |