Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 1 | /* |
| 2 | * arch/arm/mach-mmp/include/mach/uncompress.h |
| 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 as |
| 6 | * published by the Free Software Foundation. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/serial_reg.h> |
| 10 | #include <mach/addr-map.h> |
Haojian Zhuang | 9896de7 | 2010-01-12 08:54:50 +0800 | [diff] [blame] | 11 | #include <asm/mach-types.h> |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 12 | |
| 13 | #define UART1_BASE (APB_PHYS_BASE + 0x36000) |
| 14 | #define UART2_BASE (APB_PHYS_BASE + 0x17000) |
| 15 | #define UART3_BASE (APB_PHYS_BASE + 0x18000) |
| 16 | |
Nicolas Pitre | 8ea0de4 | 2011-04-28 17:00:17 -0400 | [diff] [blame] | 17 | volatile unsigned long *UART; |
Haojian Zhuang | 9896de7 | 2010-01-12 08:54:50 +0800 | [diff] [blame] | 18 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 19 | static inline void putc(char c) |
| 20 | { |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 21 | /* UART enabled? */ |
| 22 | if (!(UART[UART_IER] & UART_IER_UUE)) |
| 23 | return; |
| 24 | |
| 25 | while (!(UART[UART_LSR] & UART_LSR_THRE)) |
| 26 | barrier(); |
| 27 | |
| 28 | UART[UART_TX] = c; |
| 29 | } |
| 30 | |
| 31 | /* |
| 32 | * This does not append a newline |
| 33 | */ |
| 34 | static inline void flush(void) |
| 35 | { |
| 36 | } |
| 37 | |
Haojian Zhuang | 9896de7 | 2010-01-12 08:54:50 +0800 | [diff] [blame] | 38 | static inline void arch_decomp_setup(void) |
| 39 | { |
Eric Miao | 7471f46 | 2010-03-22 09:39:58 +0800 | [diff] [blame] | 40 | /* default to UART2 */ |
| 41 | UART = (unsigned long *)UART2_BASE; |
| 42 | |
Haojian Zhuang | 9896de7 | 2010-01-12 08:54:50 +0800 | [diff] [blame] | 43 | if (machine_is_avengers_lite()) |
| 44 | UART = (unsigned long *)UART3_BASE; |
| 45 | } |
| 46 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 47 | /* |
| 48 | * nothing to do |
| 49 | */ |
Haojian Zhuang | 9896de7 | 2010-01-12 08:54:50 +0800 | [diff] [blame] | 50 | |
Eric Miao | 49cbe78 | 2009-01-20 14:15:18 +0800 | [diff] [blame] | 51 | #define arch_decomp_wdog() |