linprocfs - Introduce /proc/mounts
[dragonfly.git] / sys / platform / pc32 / isa / ic / scd1400.h
blobdf1f44cddd7ab7c881b8f0239163df0656cc6aac
1 /*****************************************************************************/
3 /*
4 * cd1400.h -- cd1400 UART hardware info.
6 * Copyright (c) 1995 Greg Ungerer (gerg@stallion.oz.au).
7 * All rights reserved.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. All advertising materials mentioning features or use of this software
18 * must display the following acknowledgement:
19 * This product includes software developed by Greg Ungerer.
20 * 4. Neither the name of the author nor the names of any co-contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE.
36 * $FreeBSD: src/sys/i386/isa/ic/scd1400.h,v 1.5 1999/08/28 00:45:15 peter Exp $
37 * $DragonFly: src/sys/platform/pc32/isa/ic/scd1400.h,v 1.2 2003/06/17 04:28:37 dillon Exp $
40 /*****************************************************************************/
41 #ifndef _CD1400_H
42 #define _CD1400_H
43 /*****************************************************************************/
46 * Define the number of async ports per cd1400 uart chip.
48 #define CD1400_PORTS 4
51 * Define the cd1400 uarts internal FIFO sizes.
53 #define CD1400_TXFIFOSIZE 12
54 #define CD1400_RXFIFOSIZE 12
57 * Local RX FIFO thresh hold level. Also define the RTS thresh hold
58 * based on the RX thresh hold.
60 #define FIFO_RXTHRESHOLD 6
61 #define FIFO_RTSTHRESHOLD 7
63 /*****************************************************************************/
66 * Define the cd1400 register addresses. These are all the valid
67 * registers with the cd1400. Some are global, some virtual, some
68 * per port.
70 #define GFRCR 0x40
71 #define CAR 0x68
72 #define GCR 0x4b
73 #define SVRR 0x67
74 #define RICR 0x44
75 #define TICR 0x45
76 #define MICR 0x46
77 #define RIR 0x6b
78 #define TIR 0x6a
79 #define MIR 0x69
80 #define PPR 0x7e
82 #define RIVR 0x43
83 #define TIVR 0x42
84 #define MIVR 0x41
85 #define TDR 0x63
86 #define RDSR 0x62
87 #define MISR 0x4c
88 #define EOSRR 0x60
90 #define LIVR 0x18
91 #define CCR 0x05
92 #define SRER 0x06
93 #define COR1 0x08
94 #define COR2 0x09
95 #define COR3 0x0a
96 #define COR4 0x1e
97 #define COR5 0x1f
98 #define CCSR 0x0b
99 #define RDCR 0x0e
100 #define SCHR1 0x1a
101 #define SCHR2 0x1b
102 #define SCHR3 0x1c
103 #define SCHR4 0x1d
104 #define SCRL 0x22
105 #define SCRH 0x23
106 #define LNC 0x24
107 #define MCOR1 0x15
108 #define MCOR2 0x16
109 #define RTPR 0x21
110 #define MSVR1 0x6c
111 #define MSVR2 0x6d
112 #define PSVR 0x6f
113 #define RBPR 0x78
114 #define RCOR 0x7c
115 #define TBPR 0x72
116 #define TCOR 0x76
118 /*****************************************************************************/
121 * Define the set of baud rate clock divisors.
123 #define CD1400_CLK0 8
124 #define CD1400_CLK1 32
125 #define CD1400_CLK2 128
126 #define CD1400_CLK3 512
127 #define CD1400_CLK4 2048
129 #define CD1400_NUMCLKS 5
131 /*****************************************************************************/
134 * Define the clock pre-scalar value to be a 5 ms clock. This should be
135 * OK for now. It would probably be better to make it 10 ms, but we
136 * can't fit that divisor into 8 bits!
138 #define PPR_SCALAR 244
140 /*****************************************************************************/
143 * Define values used to set character size options.
145 #define COR1_CHL5 0x00
146 #define COR1_CHL6 0x01
147 #define COR1_CHL7 0x02
148 #define COR1_CHL8 0x03
151 * Define values used to set the number of stop bits.
153 #define COR1_STOP1 0x00
154 #define COR1_STOP15 0x04
155 #define COR1_STOP2 0x08
158 * Define values used to set the parity scheme in use.
160 #define COR1_PARNONE 0x00
161 #define COR1_PARFORCE 0x20
162 #define COR1_PARENB 0x40
163 #define COR1_PARIGNORE 0x10
165 #define COR1_PARODD 0x80
166 #define COR1_PAREVEN 0x00
168 #define COR2_IXM 0x80
169 #define COR2_TXIBE 0x40
170 #define COR2_ETC 0x20
171 #define COR2_LLM 0x10
172 #define COR2_RLM 0x08
173 #define COR2_RTSAO 0x04
174 #define COR2_CTSAE 0x02
176 #define COR3_SCDRNG 0x80
177 #define COR3_SCD34 0x40
178 #define COR3_FCT 0x20
179 #define COR3_SCD12 0x10
182 * Define the bit values of COR4.
184 #define COR4_BRKINT 0x08
185 #define COR4_IGNBRK 0x18
188 * Define the bit values of COR5.
190 #define COR5_ISTRIP 0x80
192 /*****************************************************************************/
195 * Define the modem control register values.
196 * Note that the actual hardware is a little different to the conventional
197 * pin names on the cd1400.
199 #define MSVR1_DTR 0x01
200 #define MSVR1_DSR 0x10
201 #define MSVR1_RI 0x20
202 #define MSVR1_CTS 0x40
203 #define MSVR1_DCD 0x80
205 #define MSVR2_RTS 0x02
206 #define MSVR2_DSR 0x10
207 #define MSVR2_RI 0x20
208 #define MSVR2_CTS 0x40
209 #define MSVR2_DCD 0x80
211 #define MCOR1_DCD 0x80
212 #define MCOR1_CTS 0x40
213 #define MCOR1_RI 0x20
214 #define MCOR1_DSR 0x10
216 #define MCOR2_DCD 0x80
217 #define MCOR2_CTS 0x40
218 #define MCOR2_RI 0x20
219 #define MCOR2_DSR 0x10
221 /*****************************************************************************/
224 * Define the bits used with the service (interrupt) enable register.
226 #define SRER_NNDT 0x01
227 #define SRER_TXEMPTY 0x02
228 #define SRER_TXDATA 0x04
229 #define SRER_RXDATA 0x10
230 #define SRER_MODEM 0x80
232 /*****************************************************************************/
235 * Define operational commands for the command register.
237 #define CCR_RESET 0x80
238 #define CCR_CORCHANGE 0x4e
239 #define CCR_SENDCH 0x20
240 #define CCR_CHANCTRL 0x10
242 #define CCR_TXENABLE (CCR_CHANCTRL | 0x08)
243 #define CCR_TXDISABLE (CCR_CHANCTRL | 0x04)
244 #define CCR_RXENABLE (CCR_CHANCTRL | 0x02)
245 #define CCR_RXDISABLE (CCR_CHANCTRL | 0x01)
247 #define CCR_SENDSCHR1 (CCR_SENDCH | 0x01)
248 #define CCR_SENDSCHR2 (CCR_SENDCH | 0x02)
249 #define CCR_SENDSCHR3 (CCR_SENDCH | 0x03)
250 #define CCR_SENDSCHR4 (CCR_SENDCH | 0x04)
252 #define CCR_RESETCHAN (CCR_RESET | 0x00)
253 #define CCR_RESETFULL (CCR_RESET | 0x01)
254 #define CCR_TXFLUSHFIFO (CCR_RESET | 0x02)
256 #define CCR_MAXWAIT 10000
258 /*****************************************************************************/
261 * Define the valid acknowledgement types (for hw ack cycle).
263 #define ACK_TYPMASK 0x07
264 #define ACK_TYPTX 0x02
265 #define ACK_TYPMDM 0x01
266 #define ACK_TYPRXGOOD 0x03
267 #define ACK_TYPRXBAD 0x07
269 #define SVRR_RX 0x01
270 #define SVRR_TX 0x02
271 #define SVRR_MDM 0x04
273 #define ST_OVERRUN 0x01
274 #define ST_FRAMING 0x02
275 #define ST_PARITY 0x04
276 #define ST_BREAK 0x08
277 #define ST_SCHAR1 0x10
278 #define ST_SCHAR2 0x20
279 #define ST_SCHAR3 0x30
280 #define ST_SCHAR4 0x40
281 #define ST_RANGE 0x70
282 #define ST_SCHARMASK 0x70
283 #define ST_TIMEOUT 0x80
285 #define MISR_DCD 0x80
286 #define MISR_CTS 0x40
287 #define MISR_RI 0x20
288 #define MISR_DSR 0x10
290 /*****************************************************************************/
293 * Defines for the CCSR status register.
295 #define CCSR_RXENABLED 0x80
296 #define CCSR_RXFLOWON 0x40
297 #define CCSR_RXFLOWOFF 0x20
298 #define CCSR_TXENABLED 0x08
299 #define CCSR_TXFLOWON 0x04
300 #define CCSR_TXFLOWOFF 0x02
302 /*****************************************************************************/
305 * Define the embedded commands.
307 #define ETC_CMD 0x00
308 #define ETC_STARTBREAK 0x81
309 #define ETC_DELAY 0x82
310 #define ETC_STOPBREAK 0x83
312 /*****************************************************************************/
313 #endif