diff options
Diffstat (limited to 'include/asm-arm/arch-realview/uncompress.h')
-rw-r--r-- | include/asm-arm/arch-realview/uncompress.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/asm-arm/arch-realview/uncompress.h b/include/asm-arm/arch-realview/uncompress.h index 3d5c2db07a26..9b790a7e782d 100644 --- a/include/asm-arm/arch-realview/uncompress.h +++ b/include/asm-arm/arch-realview/uncompress.h | |||
@@ -18,28 +18,44 @@ | |||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
19 | */ | 19 | */ |
20 | #include <asm/hardware.h> | 20 | #include <asm/hardware.h> |
21 | #include <asm/mach-types.h> | ||
21 | 22 | ||
22 | #include <asm/arch/platform.h> | 23 | #include <asm/arch/board-eb.h> |
23 | 24 | ||
24 | #define AMBA_UART_DR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x00)) | 25 | #define AMBA_UART_DR(base) (*(volatile unsigned char *)((base) + 0x00)) |
25 | #define AMBA_UART_LCRH (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x2c)) | 26 | #define AMBA_UART_LCRH(base) (*(volatile unsigned char *)((base) + 0x2c)) |
26 | #define AMBA_UART_CR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x30)) | 27 | #define AMBA_UART_CR(base) (*(volatile unsigned char *)((base) + 0x30)) |
27 | #define AMBA_UART_FR (*(volatile unsigned char *) (REALVIEW_UART0_BASE + 0x18)) | 28 | #define AMBA_UART_FR(base) (*(volatile unsigned char *)((base) + 0x18)) |
29 | |||
30 | /* | ||
31 | * Return the UART base address | ||
32 | */ | ||
33 | static inline unsigned long get_uart_base(void) | ||
34 | { | ||
35 | if (machine_is_realview_eb()) | ||
36 | return REALVIEW_EB_UART0_BASE; | ||
37 | else | ||
38 | return 0; | ||
39 | } | ||
28 | 40 | ||
29 | /* | 41 | /* |
30 | * This does not append a newline | 42 | * This does not append a newline |
31 | */ | 43 | */ |
32 | static inline void putc(int c) | 44 | static inline void putc(int c) |
33 | { | 45 | { |
34 | while (AMBA_UART_FR & (1 << 5)) | 46 | unsigned long base = get_uart_base(); |
47 | |||
48 | while (AMBA_UART_FR(base) & (1 << 5)) | ||
35 | barrier(); | 49 | barrier(); |
36 | 50 | ||
37 | AMBA_UART_DR = c; | 51 | AMBA_UART_DR(base) = c; |
38 | } | 52 | } |
39 | 53 | ||
40 | static inline void flush(void) | 54 | static inline void flush(void) |
41 | { | 55 | { |
42 | while (AMBA_UART_FR & (1 << 3)) | 56 | unsigned long base = get_uart_base(); |
57 | |||
58 | while (AMBA_UART_FR(base) & (1 << 3)) | ||
43 | barrier(); | 59 | barrier(); |
44 | } | 60 | } |
45 | 61 | ||