Merge to Fedora kernel-2.6.18-1.2224_FC5 patched with stable patch-2.6.18.1-vs2.0...
[linux-2.6.git] / include / asm-arm / arch-iop3xx / uncompress.h
1 /*
2  *  linux/include/asm-arm/arch-iop3xx/uncompress.h
3  */
4 #include <asm/types.h>
5 #include <asm/mach-types.h>
6 #include <linux/serial_reg.h>
7 #include <asm/hardware.h>
8
9 #ifdef CONFIG_ARCH_IOP321
10 #define UTYPE unsigned char *
11 #elif defined(CONFIG_ARCH_IOP331)
12 #define UTYPE u32 *
13 #else
14 #error "Missing IOP3xx arch type def"
15 #endif
16
17 static volatile UTYPE uart_base;
18
19 #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
20
21 static inline void putc(char c)
22 {
23         while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE)
24                 barrier();
25         *uart_base = c;
26 }
27
28 static inline void flush(void)
29 {
30 }
31
32 static __inline__ void __arch_decomp_setup(unsigned long arch_id)
33 {
34         if(machine_is_iq80321())
35                         uart_base = (volatile UTYPE)IQ80321_UART;
36                 else if(machine_is_iq31244())
37                         uart_base = (volatile UTYPE)IQ31244_UART;
38                 else if(machine_is_iq80331() || machine_is_iq80332())
39                         uart_base = (volatile UTYPE)IOP331_UART0_PHYS;
40                 else
41                         uart_base = (volatile UTYPE)0xfe800000;
42 }
43
44 /*
45  * nothing to do
46  */
47 #define arch_decomp_setup()     __arch_decomp_setup(arch_id)
48 #define arch_decomp_wdog()