This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.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 <linux/config.h>
9 #include <asm/m32r.h>
10 #include <asm/io.h>
11
12 void putc(char c);
13
14 int puts(const char *s)
15 {
16         char c;
17         while ((c = *s++)) putc(c);
18         return 0;
19 }
20
21 #if defined(CONFIG_PLAT_M32700UT_Alpha) || defined(CONFIG_PLAT_M32700UT)
22 #define USE_FPGA_MAP    0
23
24 #if USE_FPGA_MAP
25 /*
26  * fpga configuration program uses MMU, and define map as same as
27  * M32104 uT-Engine board.
28  */
29 #define BOOT_SIO0STS    (volatile unsigned short *)(0x02c00000 + 0x20006)
30 #define BOOT_SIO0TXB    (volatile unsigned short *)(0x02c00000 + 0x2000c)
31 #else
32 #undef PLD_BASE
33 #define PLD_BASE        0xa4c00000
34 #define BOOT_SIO0STS    PLD_ESIO0STS
35 #define BOOT_SIO0TXB    PLD_ESIO0TXB
36 #endif
37
38 void putc(char c)
39 {
40
41         while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
42         if (c == '\n') {
43                 *BOOT_SIO0TXB = '\r';
44                 while ((*BOOT_SIO0STS & 0x3) != 0x3) ;
45         }
46         *BOOT_SIO0TXB = c;
47 }
48 #else
49 void putc(char c)
50 {
51         /* do nothing */
52 }
53 #endif