1 /* $Id: serial.h,v 1.9 2000/02/16 01:45:55 ralf Exp $
2 *
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
5 * for more details.
6 *
7 * Copyright (C) 1999 by Ralf Baechle
8 * Copyright (C) 1999, 2000 Silicon Graphics, Inc.
9 */
10 #include <linux/config.h>
11 #include <asm/bootinfo.h>
12 #include <asm/jazz.h>
13
14 /*
15 * This assumes you have a 1.8432 MHz clock for your UART.
16 *
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.
20 */
21 #define BASE_BAUD ( 1843200 / 16 )
22
23 #ifndef CONFIG_OLIVETTI_M700
24 /* Some Jazz machines seem to have an 8MHz crystal clock but I don't know
25 exactly which ones ... XXX */
26 #define JAZZ_BASE_BAUD ( 8000000 / 16 ) /* ( 3072000 / 16) */
27 #else
28 /* but the M700 isn't such a strange beast */
29 #define JAZZ_BASE_BAUD BASE_BAUD
30 #endif
31
32 /* Standard COM flags (except for COM4, because of the 8514 problem) */
33 #ifdef CONFIG_SERIAL_DETECT_IRQ
34 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST | ASYNC_AUTO_IRQ)
35 #define STD_COM4_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_AUTO_IRQ)
36 #else
37 #define STD_COM_FLAGS (ASYNC_BOOT_AUTOCONF | ASYNC_SKIP_TEST)
38 #define STD_COM4_FLAGS ASYNC_BOOT_AUTOCONF
39 #endif
40
41 #ifdef CONFIG_SERIAL_MANY_PORTS
42 #define FOURPORT_FLAGS ASYNC_FOURPORT
43 #define ACCENT_FLAGS 0
44 #define BOCA_FLAGS 0
45 #define HUB6_FLAGS 0
46 #define RS_TABLE_SIZE 64
47 #else
48 #define RS_TABLE_SIZE
49 #endif
50
51 /*
52 * The following define the access methods for the HUB6 card. All
53 * access is through two ports for all 24 possible chips. The card is
54 * selected through the high 2 bits, the port on that card with the
55 * "middle" 3 bits, and the register on that port with the bottom
56 * 3 bits.
57 *
58 * While the access port and interrupt is configurable, the default
59 * port locations are 0x302 for the port control register, and 0x303
60 * for the data read/write register. Normally, the interrupt is at irq3
61 * but can be anything from 3 to 7 inclusive. Note that using 3 will
62 * require disabling com2.
63 */
64
65 #define C_P(card,port) (((card)<<6|(port)<<3) + 1)
66
67 #ifdef CONFIG_MIPS_JAZZ
68 #define _JAZZ_SERIAL_INIT(int, base) \
69 { baud_base: JAZZ_BASE_BAUD, irq: int, flags: STD_COM_FLAGS, \
70 iomem_base: (u8 *) base, iomem_reg_shift: 0, \
71 io_type: SERIAL_IO_MEM }
72 #define JAZZ_SERIAL_PORT_DEFNS \
73 _JAZZ_SERIAL_INIT(JAZZ_SERIAL1_IRQ, JAZZ_SERIAL1_BASE), \
74 _JAZZ_SERIAL_INIT(JAZZ_SERIAL2_IRQ, JAZZ_SERIAL2_BASE),
75 #else
76 #define JAZZ_SERIAL_PORT_DEFNS
77 #endif
78
79 #define STD_SERIAL_PORT_DEFNS \
80 /* UART CLK PORT IRQ FLAGS */ \
81 { 0, BASE_BAUD, 0x3F8, 4, STD_COM_FLAGS }, /* ttyS0 */ \
82 { 0, BASE_BAUD, 0x2F8, 3, STD_COM_FLAGS }, /* ttyS1 */ \
83 { 0, BASE_BAUD, 0x3E8, 4, STD_COM_FLAGS }, /* ttyS2 */ \
84 { 0, BASE_BAUD, 0x2E8, 3, STD_COM4_FLAGS }, /* ttyS3 */
85
86
87 #ifdef CONFIG_SERIAL_MANY_PORTS
88 #define EXTRA_SERIAL_PORT_DEFNS \
89 { 0, BASE_BAUD, 0x1A0, 9, FOURPORT_FLAGS }, /* ttyS4 */ \
90 { 0, BASE_BAUD, 0x1A8, 9, FOURPORT_FLAGS }, /* ttyS5 */ \
91 { 0, BASE_BAUD, 0x1B0, 9, FOURPORT_FLAGS }, /* ttyS6 */ \
92 { 0, BASE_BAUD, 0x1B8, 9, FOURPORT_FLAGS }, /* ttyS7 */ \
93 { 0, BASE_BAUD, 0x2A0, 5, FOURPORT_FLAGS }, /* ttyS8 */ \
94 { 0, BASE_BAUD, 0x2A8, 5, FOURPORT_FLAGS }, /* ttyS9 */ \
95 { 0, BASE_BAUD, 0x2B0, 5, FOURPORT_FLAGS }, /* ttyS10 */ \
96 { 0, BASE_BAUD, 0x2B8, 5, FOURPORT_FLAGS }, /* ttyS11 */ \
97 { 0, BASE_BAUD, 0x330, 4, ACCENT_FLAGS }, /* ttyS12 */ \
98 { 0, BASE_BAUD, 0x338, 4, ACCENT_FLAGS }, /* ttyS13 */ \
99 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS14 (spare) */ \
100 { 0, BASE_BAUD, 0x000, 0, 0 }, /* ttyS15 (spare) */ \
101 { 0, BASE_BAUD, 0x100, 12, BOCA_FLAGS }, /* ttyS16 */ \
102 { 0, BASE_BAUD, 0x108, 12, BOCA_FLAGS }, /* ttyS17 */ \
103 { 0, BASE_BAUD, 0x110, 12, BOCA_FLAGS }, /* ttyS18 */ \
104 { 0, BASE_BAUD, 0x118, 12, BOCA_FLAGS }, /* ttyS19 */ \
105 { 0, BASE_BAUD, 0x120, 12, BOCA_FLAGS }, /* ttyS20 */ \
106 { 0, BASE_BAUD, 0x128, 12, BOCA_FLAGS }, /* ttyS21 */ \
107 { 0, BASE_BAUD, 0x130, 12, BOCA_FLAGS }, /* ttyS22 */ \
108 { 0, BASE_BAUD, 0x138, 12, BOCA_FLAGS }, /* ttyS23 */ \
109 { 0, BASE_BAUD, 0x140, 12, BOCA_FLAGS }, /* ttyS24 */ \
110 { 0, BASE_BAUD, 0x148, 12, BOCA_FLAGS }, /* ttyS25 */ \
111 { 0, BASE_BAUD, 0x150, 12, BOCA_FLAGS }, /* ttyS26 */ \
112 { 0, BASE_BAUD, 0x158, 12, BOCA_FLAGS }, /* ttyS27 */ \
113 { 0, BASE_BAUD, 0x160, 12, BOCA_FLAGS }, /* ttyS28 */ \
114 { 0, BASE_BAUD, 0x168, 12, BOCA_FLAGS }, /* ttyS29 */ \
115 { 0, BASE_BAUD, 0x170, 12, BOCA_FLAGS }, /* ttyS30 */ \
116 { 0, BASE_BAUD, 0x178, 12, BOCA_FLAGS }, /* ttyS31 */
117 #else
118 #define EXTRA_SERIAL_PORT_DEFNS
119 #endif
120
121 /* You can have up to four HUB6's in the system, but I've only
122 * included two cards here for a total of twelve ports.
123 */
124 #if (defined(CONFIG_HUB6) && defined(CONFIG_SERIAL_MANY_PORTS))
125 #define HUB6_SERIAL_PORT_DFNS \
126 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,0) }, /* ttyS32 */ \
127 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,1) }, /* ttyS33 */ \
128 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,2) }, /* ttyS34 */ \
129 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,3) }, /* ttyS35 */ \
130 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,4) }, /* ttyS36 */ \
131 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(0,5) }, /* ttyS37 */ \
132 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,0) }, /* ttyS38 */ \
133 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,1) }, /* ttyS39 */ \
134 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,2) }, /* ttyS40 */ \
135 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,3) }, /* ttyS41 */ \
136 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,4) }, /* ttyS42 */ \
137 { 0, BASE_BAUD, 0x302, 3, HUB6_FLAGS, C_P(1,5) }, /* ttyS43 */
138 #else
139 #define HUB6_SERIAL_PORT_DFNS
140 #endif
141
142 #ifdef CONFIG_MCA
143 #define MCA_SERIAL_PORT_DFNS \
144 { 0, BASE_BAUD, 0x3220, 3, STD_COM_FLAGS }, \
145 { 0, BASE_BAUD, 0x3228, 3, STD_COM_FLAGS }, \
146 { 0, BASE_BAUD, 0x4220, 3, STD_COM_FLAGS }, \
147 { 0, BASE_BAUD, 0x4228, 3, STD_COM_FLAGS }, \
148 { 0, BASE_BAUD, 0x5220, 3, STD_COM_FLAGS }, \
149 { 0, BASE_BAUD, 0x5228, 3, STD_COM_FLAGS },
150 #else
151 #define MCA_SERIAL_PORT_DFNS
152 #endif
153
154 #define SERIAL_PORT_DFNS \
155 JAZZ_SERIAL_PORT_DEFNS \
156 STD_SERIAL_PORT_DEFNS \
157 EXTRA_SERIAL_PORT_DEFNS \
158 HUB6_SERIAL_PORT_DFNS
159
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.