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