This commit was manufactured by cvs2svn to create branch 'vserver'.
[linux-2.6.git] / include / asm-m32r / serial.h
1 #ifndef _ASM_M32R_SERIAL_H
2 #define _ASM_M32R_SERIAL_H
3
4 /* $Id$ */
5
6 /* orig : i386 2.4.18 */
7
8 /*
9  * include/asm-m32r/serial.h
10  */
11
12 #include <linux/config.h>
13 #include <asm/m32r.h>
14
15 /*
16  * This assumes you have a 1.8432 MHz clock for your UART.
17  *
18  * It'd be nice if someone built a serial card with a 24.576 MHz
19  * clock, since the 16550A is capable of handling a top speed of 1.5
20  * megabits/second; but this requires the faster clock.
21  */
22 #define BASE_BAUD ( 1843200 / 16 )
23
24 /* Standard COM flags (except for COM4, because of the 8514 problem) */
25 #ifdef CONFIG_SERIAL_DETECT_IRQ
26 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
27 #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
28 #else
29 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
30 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
31 #endif
32
33 #ifdef CONFIG_SERIAL_MANY_PORTS
34 #define FOURPORT_FLAGS ASYNC_FOURPORT
35 #define ACCENT_FLAGS 0
36 #define BOCA_FLAGS 0
37 #define HUB6_FLAGS 0
38 #define RS_TABLE_SIZE   64
39 #else
40 #define RS_TABLE_SIZE
41 #endif
42
43 #define MCA_COM_FLAGS   (STD_COM_FLAGS|ASYNC_BOOT_ONLYMCA)
44
45 /*
46  * The following define the access methods for the HUB6 card. All
47  * access is through two ports for all 24 possible chips. The card is
48  * selected through the high 2 bits, the port on that card with the
49  * "middle" 3 bits, and the register on that port with the bottom
50  * 3 bits.
51  *
52  * While the access port and interrupt is configurable, the default
53  * port locations are 0x302 for the port control register, and 0x303
54  * for the data read/write register. Normally, the interrupt is at irq3
55  * but can be anything from 3 to 7 inclusive. Note that using 3 will
56  * require disabling com2.
57  */
58
59 #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
60
61 #define STD_SERIAL_PORT_DEFNS                   \
62         /* UART CLK   PORT IRQ     FLAGS        */                      \
63         { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS },      /* ttyS0 */     \
64         { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS },      /* ttyS1 */     \
65         { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS },      /* ttyS2 */     \
66         { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS },     /* ttyS3 */
67
68
69 #ifdef CONFIG_SERIAL_MANY_PORTS
70 #define EXTRA_SERIAL_PORT_DEFNS                 \
71         { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS },     /* ttyS4 */     \
72         { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS },     /* ttyS5 */     \
73         { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS },     /* ttyS6 */     \
74         { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS },     /* ttyS7 */     \
75         { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS },     /* ttyS8 */     \
76         { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS },     /* ttyS9 */     \
77         { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS },     /* ttyS10 */    \
78         { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS },     /* ttyS11 */    \
79         { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS },       /* ttyS12 */    \
80         { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS },       /* ttyS13 */    \
81         { 0, BASE_BAUD, 0x000, 0, 0 },  /* ttyS14 (spare) */            \
82         { 0, BASE_BAUD, 0x000, 0, 0 },  /* ttyS15 (spare) */            \
83         { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS },        /* ttyS16 */    \
84         { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS },        /* ttyS17 */    \
85         { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS },        /* ttyS18 */    \
86         { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS },        /* ttyS19 */    \
87         { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS },        /* ttyS20 */    \
88         { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS },        /* ttyS21 */    \
89         { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS },        /* ttyS22 */    \
90         { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS },        /* ttyS23 */    \
91         { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS },        /* ttyS24 */    \
92         { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS },        /* ttyS25 */    \
93         { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS },        /* ttyS26 */    \
94         { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS },        /* ttyS27 */    \
95         { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS },        /* ttyS28 */    \
96         { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS },        /* ttyS29 */    \
97         { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS },        /* ttyS30 */    \
98         { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS },        /* ttyS31 */
99 #else
100 #define EXTRA_SERIAL_PORT_DEFNS
101 #endif
102
103 /* You can have up to four HUB6's in the system, but I've only
104  * included two cards here for a total of twelve ports.
105  */
106 #if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
107 #define HUB6_SERIAL_PORT_DFNS           \
108         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) },  /* ttyS32 */ \
109         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) },  /* ttyS33 */ \
110         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) },  /* ttyS34 */ \
111         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) },  /* ttyS35 */ \
112         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) },  /* ttyS36 */ \
113         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) },  /* ttyS37 */ \
114         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) },  /* ttyS38 */ \
115         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) },  /* ttyS39 */ \
116         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) },  /* ttyS40 */ \
117         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) },  /* ttyS41 */ \
118         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) },  /* ttyS42 */ \
119         { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) },  /* ttyS43 */
120 #else
121 #define HUB6_SERIAL_PORT_DFNS
122 #endif
123
124 #ifdef CONFIG_MCA
125 #define MCA_SERIAL_PORT_DFNS                    \
126         { 0, BASE_BAUD, 0x3220, 3, MCA_COM_FLAGS },     \
127         { 0, BASE_BAUD, 0x3228, 3, MCA_COM_FLAGS },     \
128         { 0, BASE_BAUD, 0x4220, 3, MCA_COM_FLAGS },     \
129         { 0, BASE_BAUD, 0x4228, 3, MCA_COM_FLAGS },     \
130         { 0, BASE_BAUD, 0x5220, 3, MCA_COM_FLAGS },     \
131         { 0, BASE_BAUD, 0x5228, 3, MCA_COM_FLAGS },
132 #else
133 #define MCA_SERIAL_PORT_DFNS
134 #endif
135
136 #ifndef CONFIG_PLAT_USRV
137 #define SERIAL_PORT_DFNS                \
138         STD_SERIAL_PORT_DEFNS           \
139         EXTRA_SERIAL_PORT_DEFNS         \
140         HUB6_SERIAL_PORT_DFNS           \
141         MCA_SERIAL_PORT_DFNS
142
143 #else   /* CONFIG_PLAT_USRV */
144
145 #define SERIAL_PORT_DFNS                \
146         /* UART CLK   PORT IRQ     FLAGS        */                      \
147         { 0, BASE_BAUD, 0x3F8, PLD_IRQ_UART0, STD_COM_FLAGS },  /* ttyS0 */     \
148         { 0, BASE_BAUD, 0x2F8, PLD_IRQ_UART1, STD_COM_FLAGS },  /* ttyS1 */
149 #endif  /* CONFIG_PLAT_USRV */
150
151 #endif  /* _ASM_M32R_SERIAL_H */