diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-03-28 04:24:33 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-03-28 04:24:33 -0500 |
commit | a081568d7016061ed848696984e3acf1ba0b3054 (patch) | |
tree | 5a6cd28d51e3c0b694499f4d0795b22a3d020eba /include/asm-arm/arch-ebsa110/uncompress.h | |
parent | 3747b36eeab93d8969e86987bbc1d44971229b26 (diff) |
[ARM] Fix decompressor serial IO to give CRLF not LFCR
As per the corresponding change to the serial drivers, arrange
for ARM decompressors to give CRLF. Move the common putstr code
into misc.c such that machines only need to supply "putc" and
"flush" functions.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-ebsa110/uncompress.h')
-rw-r--r-- | include/asm-arm/arch-ebsa110/uncompress.h | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/include/asm-arm/arch-ebsa110/uncompress.h b/include/asm-arm/arch-ebsa110/uncompress.h index eee95581a923..66b19c7fd908 100644 --- a/include/asm-arm/arch-ebsa110/uncompress.h +++ b/include/asm-arm/arch-ebsa110/uncompress.h | |||
@@ -8,33 +8,34 @@ | |||
8 | * published by the Free Software Foundation. | 8 | * published by the Free Software Foundation. |
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <linux/serial_reg.h> | ||
12 | |||
13 | #define SERIAL_BASE ((unsigned char *)0xfe000be0) | ||
14 | |||
11 | /* | 15 | /* |
12 | * This does not append a newline | 16 | * This does not append a newline |
13 | */ | 17 | */ |
14 | static void putstr(const char *s) | 18 | static inline void putc(int c) |
19 | { | ||
20 | unsigned char v, *base = SERIAL_BASE; | ||
21 | |||
22 | do { | ||
23 | v = base[UART_LSR << 2]; | ||
24 | barrier(); | ||
25 | } while (!(v & UART_LSR_THRE)); | ||
26 | |||
27 | base[UART_TX << 2] = c; | ||
28 | } | ||
29 | |||
30 | static inline void flush(void) | ||
15 | { | 31 | { |
16 | unsigned long tmp1, tmp2; | 32 | unsigned char v, *base = SERIAL_BASE; |
17 | __asm__ __volatile__( | 33 | |
18 | "ldrb %0, [%2], #1\n" | 34 | do { |
19 | " teq %0, #0\n" | 35 | v = base[UART_LSR << 2]; |
20 | " beq 3f\n" | 36 | barrier(); |
21 | "1: strb %0, [%3]\n" | 37 | } while ((v & (UART_LSR_TEMT|UART_LSR_THRE)) != |
22 | "2: ldrb %1, [%3, #0x14]\n" | 38 | (UART_LSR_TEMT|UART_LSR_THRE)); |
23 | " and %1, %1, #0x60\n" | ||
24 | " teq %1, #0x60\n" | ||
25 | " bne 2b\n" | ||
26 | " teq %0, #'\n'\n" | ||
27 | " moveq %0, #'\r'\n" | ||
28 | " beq 1b\n" | ||
29 | " ldrb %0, [%2], #1\n" | ||
30 | " teq %0, #0\n" | ||
31 | " bne 1b\n" | ||
32 | "3: ldrb %1, [%3, #0x14]\n" | ||
33 | " and %1, %1, #0x60\n" | ||
34 | " teq %1, #0x60\n" | ||
35 | " bne 3b" | ||
36 | : "=&r" (tmp1), "=&r" (tmp2) | ||
37 | : "r" (s), "r" (0xf0000be0) : "cc"); | ||
38 | } | 39 | } |
39 | 40 | ||
40 | /* | 41 | /* |