diff options
| -rw-r--r-- | arch/arm/mach-pxa/include/mach/uncompress.h | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/include/mach/uncompress.h b/arch/arm/mach-pxa/include/mach/uncompress.h index 237734b5b1be..4888a21947b0 100644 --- a/arch/arm/mach-pxa/include/mach/uncompress.h +++ b/arch/arm/mach-pxa/include/mach/uncompress.h | |||
| @@ -10,20 +10,41 @@ | |||
| 10 | */ | 10 | */ |
| 11 | 11 | ||
| 12 | #include <linux/serial_reg.h> | 12 | #include <linux/serial_reg.h> |
| 13 | #include <mach/regs-uart.h> | ||
| 14 | #include <asm/mach-types.h> | 13 | #include <asm/mach-types.h> |
| 15 | 14 | ||
| 16 | #define __REG(x) ((volatile unsigned long *)x) | 15 | #define FFUART_BASE (0x40100000) |
| 16 | #define BTUART_BASE (0x40200000) | ||
| 17 | #define STUART_BASE (0x40700000) | ||
| 17 | 18 | ||
| 18 | static volatile unsigned long *UART = FFUART; | 19 | static unsigned long uart_base = FFUART_BASE; |
| 20 | static unsigned int uart_shift = 2; | ||
| 21 | static unsigned int uart_is_pxa = 1; | ||
| 22 | |||
| 23 | static inline unsigned char uart_read(int offset) | ||
| 24 | { | ||
| 25 | return *(volatile unsigned char *)(uart_base + (offset << uart_shift)); | ||
| 26 | } | ||
| 27 | |||
| 28 | static inline void uart_write(unsigned char val, int offset) | ||
| 29 | { | ||
| 30 | *(volatile unsigned char *)(uart_base + (offset << uart_shift)) = val; | ||
| 31 | } | ||
| 32 | |||
| 33 | static inline int uart_is_enabled(void) | ||
| 34 | { | ||
| 35 | /* assume enabled by default for non-PXA uarts */ | ||
| 36 | return uart_is_pxa ? uart_read(UART_IER) & UART_IER_UUE : 1; | ||
| 37 | } | ||
| 19 | 38 | ||
| 20 | static inline void putc(char c) | 39 | static inline void putc(char c) |
| 21 | { | 40 | { |
| 22 | if (!(UART[UART_IER] & IER_UUE)) | 41 | if (!uart_is_enabled()) |
| 23 | return; | 42 | return; |
| 24 | while (!(UART[UART_LSR] & LSR_TDRQ)) | 43 | |
| 44 | while (!(uart_read(UART_LSR) & UART_LSR_THRE)) | ||
| 25 | barrier(); | 45 | barrier(); |
| 26 | UART[UART_TX] = c; | 46 | |
| 47 | uart_write(c, UART_TX); | ||
| 27 | } | 48 | } |
| 28 | 49 | ||
| 29 | /* | 50 | /* |
| @@ -38,7 +59,7 @@ static inline void arch_decomp_setup(void) | |||
| 38 | if (machine_is_littleton() || machine_is_intelmote2() | 59 | if (machine_is_littleton() || machine_is_intelmote2() |
| 39 | || machine_is_csb726() || machine_is_stargate2() | 60 | || machine_is_csb726() || machine_is_stargate2() |
| 40 | || machine_is_cm_x300() || machine_is_balloon3()) | 61 | || machine_is_cm_x300() || machine_is_balloon3()) |
| 41 | UART = STUART; | 62 | uart_base = STUART_BASE; |
| 42 | } | 63 | } |
| 43 | 64 | ||
| 44 | /* | 65 | /* |
