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