vserver 1.9.3
[linux-2.6.git] / include / asm-arm / arch-iop3xx / uncompress.h
1 /*
2  *  linux/include/asm-arm/arch-iop3xx/uncompress.h
3  */
4 #include <linux/config.h>
5 #include <asm/types.h>
6 #include <asm/mach-types.h>
7 #include <linux/serial_reg.h>
8 #include <asm/hardware.h>
9
10 #ifdef CONFIG_ARCH_IOP321
11 #define UTYPE unsigned char *
12 #else
13 #define UTYPE u32 *
14 #endif
15
16 static volatile UTYPE uart_base;
17
18 #define TX_DONE (UART_LSR_TEMT|UART_LSR_THRE)
19
20 static __inline__ void putc(char c)
21 {
22         while ((uart_base[UART_LSR] & TX_DONE) != TX_DONE);
23         *uart_base = c;
24 }
25
26 /*
27  * This does not append a newline
28  */
29 static void putstr(const char *s)
30 {
31         while (*s) {
32                 putc(*s);
33                 if (*s == '\n')
34                         putc('\r');
35                 s++;
36         }
37 }
38
39 static __inline__ void __arch_decomp_setup(unsigned long arch_id)
40 {
41         if(machine_is_iq80321())
42                         uart_base = (volatile UTYPE)IQ80321_UART;
43                 else if(machine_is_iq31244())
44                         uart_base = (volatile UTYPE)IQ31244_UART;
45                 else if(machine_is_iq80331())
46                         uart_base = (volatile UTYPE)IQ80331_UART0_PHYS;
47                 else
48                         uart_base = (volatile UTYPE)0xfe800000;
49 }
50
51 /*
52  * nothing to do
53  */
54 #define arch_decomp_setup()     __arch_decomp_setup(arch_id)
55 #define arch_decomp_wdog()