GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / linux / linux-2.6.36 / arch / arm / plat-brcm / include / mach / uncompress.h
blob50ea5501da6fb6336929d29c23f0ff3d9edc5e5b
1 /*
2 * These are macros and inlines needed for the kernel decompressor
3 * prinarily for debugging messages.
5 * The NorthStar chip has two UART channels in ChipcommonA which are
6 * byte-spaced and must be byte addressed, while the UART in ChipcommonB
7 * is 32-bit word spaced and addressed.
8 */
11 #ifndef __ASM_ARCH_UNCOMPRESS_H
12 #define __ASM_ARCH_UNCOMPRESS_H
14 #ifndef CONFIG_DEBUG_LL /* Enable debug UART offset calculations */
15 #define CONFIG_DEBUG_LL
16 #endif
18 #include <linux/io.h>
19 #include <mach/io_map.h>
21 #define PLAT_LLDEBUG_UART_PA CONFIG_DEBUG_UART_ADDR
23 #ifndef PLAT_LLDEBUG_UART_SH
24 #error Internal header error
25 #endif
27 #define UART_BASE_ADDR PLAT_LLDEBUG_UART_PA
28 #define UART_RBR_THR_DLL_OFFSET 0x00
29 #define UART_LSR_OFFSET (0x14 >> 2 << PLAT_LLDEBUG_UART_SH)
30 #define UART_LSR_THRE_MASK 0x60
31 #define UART_LSR_TEMT_MASK 0x40
33 #if PLAT_LLDEBUG_UART_SH == 2
34 #define UART_READ_REG __raw_readl
35 #define UART_WRITE_REG __raw_writel
36 #elif PLAT_LLDEBUG_UART_SH == 0
37 #define UART_READ_REG __raw_readb
38 #define UART_WRITE_REG __raw_writeb
39 #else
40 #error UART register shift value unsupported
41 #endif
43 static inline void putc(int c)
45 unsigned count = 1 << 20;
48 * data should be written to THR register only
49 * if THRE (LSR bit5) is set)
51 while (0 == (UART_READ_REG( UART_BASE_ADDR + UART_LSR_OFFSET)
52 & UART_LSR_THRE_MASK ))
54 if( --count == 0 ) break;
57 UART_WRITE_REG(c, UART_BASE_ADDR + UART_RBR_THR_DLL_OFFSET);
60 static inline void flush(void)
62 unsigned count = 1 << 20;
63 /* Wait for the tx fifo to be empty and last char to be sent */
64 while (0 == (UART_READ_REG(UART_BASE_ADDR + UART_LSR_OFFSET)
65 & UART_LSR_TEMT_MASK ))
67 if( --count == 0 ) break;
71 static inline void arch_decomp_setup(void)
75 #define arch_decomp_wdog()
77 #endif /* __ASM_ARCH_UNCOMPRESS_H */