Pull kmalloc into release branch
[pandora-kernel.git] / arch / m32r / boot / compressed / m32r_sio.c
1 /*
2  * arch/m32r/boot/compressed/m32r_sio.c
3  *
4  * 2003-02-12:  Takeo Takahashi
5  *
6  */
7
8 #include <asm/processor.h>
9
10 static void putc(char c);
11
12 static int puts(const char *s)
13 {
14         char c;
15         while ((c = *s++)) putc(c);
16         return 0;
17 }
18
19 #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT)
20 #include <asm/m32r.h>
21 #include <asm/io.h>
22
23 #define USE_FPGA_MAP    0
24
25 #if USE_FPGA_MAP
26 /*
27  * fpga configuration program uses MMU, and define map as same as
28  * M32104 uT-Engine board.
29  */
30 #define BOOT_SIO0STS    (volatile unsigned short *)(0x02c00000 + 0x20006)
31 #define BOOT_SIO0TXB    (volatile unsigned short *)(0x02c00000 + 0x2000c)
32 #else
33 #undef PLD_BASE
34 #define PLD_BASE        0xa4c00000
35 #define BOOT_SIO0STS    PLD_ESIO0STS
36 #define BOOT_SIO0TXB    PLD_ESIO0TXB
37 #endif
38
39 static void putc(char c)
40 {
41         while ((*BOOT_SIO0STS & 0x3) != 0x3)
42                 cpu_relax();
43         if (c == '\n') {
44                 *BOOT_SIO0TXB = '\r';
45                 while ((*BOOT_SIO0STS & 0x3) != 0x3)
46                         cpu_relax();
47         }
48         *BOOT_SIO0TXB = c;
49 }
50 #else /* !(CONFIG_PLAT_M32700UT_Alpha) && !(CONFIG_PLAT_M32700UT) */
51 #if defined(CONFIG_PLAT_MAPPI2)
52 #define SIO0STS (volatile unsigned short *)(0xa0efd000 + 14)
53 #define SIO0TXB (volatile unsigned short *)(0xa0efd000 + 30)
54 #else
55 #define SIO0STS (volatile unsigned short *)(0x00efd000 + 14)
56 #define SIO0TXB (volatile unsigned short *)(0x00efd000 + 30)
57 #endif
58
59 static void putc(char c)
60 {
61         while ((*SIO0STS & 0x1) == 0)
62                 cpu_relax();
63         if (c == '\n') {
64                 *SIO0TXB = '\r';
65                 while ((*SIO0STS & 0x1) == 0)
66                         cpu_relax();
67         }
68         *SIO0TXB = c;
69 }
70 #endif