diff options
author | Guennadi Liakhovetski <lg@denx.de> | 2008-01-29 09:43:13 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2008-02-04 08:16:39 -0500 |
commit | fa3218d8594869b38b1a170ea36d176ac455b897 (patch) | |
tree | 54e3423313f34fb144aa30c58f1d24018d604fce /include/asm-arm/arch-at91/uncompress.h | |
parent | e83aff58bf1b7e6b355a0cfa206e9d3aebe5623f (diff) |
[ARM] 4660/3: at91: allow selecting UART for early kernel messages
Currently early kernel messages, i.e., those from uncompression, go to the
debugging UART. And if it is enabled in the platform configuration, but
not initialized by the bootloader, the machine hangs, waiting for UART
status change. Besides, having those messages on another UART - typically
the console UART - may be preferrable. This patch allows selecting the
UART in kernel configuration.
Signed-off-by: Guennadi Liakhovetski <lg@denx.de>
Acked-by: Andrew Victor <linux@maxim.org.za>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'include/asm-arm/arch-at91/uncompress.h')
-rw-r--r-- | include/asm-arm/arch-at91/uncompress.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/asm-arm/arch-at91/uncompress.h b/include/asm-arm/arch-at91/uncompress.h index 272a7e0dc6cf..f5636a8f6132 100644 --- a/include/asm-arm/arch-at91/uncompress.h +++ b/include/asm-arm/arch-at91/uncompress.h | |||
@@ -22,7 +22,23 @@ | |||
22 | #define __ASM_ARCH_UNCOMPRESS_H | 22 | #define __ASM_ARCH_UNCOMPRESS_H |
23 | 23 | ||
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/arch/at91_dbgu.h> | 25 | #include <linux/atmel_serial.h> |
26 | |||
27 | #if defined(CONFIG_AT91_EARLY_DBGU) | ||
28 | #define UART_OFFSET (AT91_DBGU + AT91_BASE_SYS) | ||
29 | #elif defined(CONFIG_AT91_EARLY_USART0) | ||
30 | #define UART_OFFSET AT91_USART0 | ||
31 | #elif defined(CONFIG_AT91_EARLY_USART1) | ||
32 | #define UART_OFFSET AT91_USART1 | ||
33 | #elif defined(CONFIG_AT91_EARLY_USART2) | ||
34 | #define UART_OFFSET AT91_USART2 | ||
35 | #elif defined(CONFIG_AT91_EARLY_USART3) | ||
36 | #define UART_OFFSET AT91_USART3 | ||
37 | #elif defined(CONFIG_AT91_EARLY_USART4) | ||
38 | #define UART_OFFSET AT91_USART4 | ||
39 | #elif defined(CONFIG_AT91_EARLY_USART5) | ||
40 | #define UART_OFFSET AT91_USART5 | ||
41 | #endif | ||
26 | 42 | ||
27 | /* | 43 | /* |
28 | * The following code assumes the serial port has already been | 44 | * The following code assumes the serial port has already been |
@@ -33,22 +49,22 @@ | |||
33 | */ | 49 | */ |
34 | static void putc(int c) | 50 | static void putc(int c) |
35 | { | 51 | { |
36 | #ifdef AT91_DBGU | 52 | #ifdef UART_OFFSET |
37 | void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ | 53 | void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */ |
38 | 54 | ||
39 | while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXRDY)) | 55 | while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXRDY)) |
40 | barrier(); | 56 | barrier(); |
41 | __raw_writel(c, sys + AT91_DBGU_THR); | 57 | __raw_writel(c, sys + ATMEL_US_THR); |
42 | #endif | 58 | #endif |
43 | } | 59 | } |
44 | 60 | ||
45 | static inline void flush(void) | 61 | static inline void flush(void) |
46 | { | 62 | { |
47 | #ifdef AT91_DBGU | 63 | #ifdef UART_OFFSET |
48 | void __iomem *sys = (void __iomem *) AT91_BASE_SYS; /* physical address */ | 64 | void __iomem *sys = (void __iomem *) UART_OFFSET; /* physical address */ |
49 | 65 | ||
50 | /* wait for transmission to complete */ | 66 | /* wait for transmission to complete */ |
51 | while (!(__raw_readl(sys + AT91_DBGU_SR) & AT91_DBGU_TXEMPTY)) | 67 | while (!(__raw_readl(sys + ATMEL_US_CSR) & ATMEL_US_TXEMPTY)) |
52 | barrier(); | 68 | barrier(); |
53 | #endif | 69 | #endif |
54 | } | 70 | } |