cd1400reg.h revision 1.2 1 /* $NetBSD: cd1400reg.h,v 1.2 1994/10/27 04:18:37 cgd Exp $ */
2
3 /*
4 * cyclades cyclom-y serial driver
5 * Andrew Herbert <andrew (at) werple.apana.org.au>, 17 August 1993
6 *
7 * Copyright (c) 1993 Andrew Herbert.
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. The name Andrew Herbert may not be used to endorse or promote products
19 * derived from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY EXPRESS OR IMPLIED
22 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
24 * NO EVENT SHALL I BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33 #define CD1400_NO_OF_CHANNELS 4 /* four serial channels per chip */
34 #define CD1400_FIFOSIZE 12 /* 12 chars */
35
36 /* register definitions */
37
38 #define CD1400_CCR 2*0x05 /* channel control */
39 #define CD1400_CMD_RESET 0x81 /* full reset */
40
41 #define CD1400_SRER 2*0x06 /* service request enable */
42
43 #define CD1400_GFRCR 2*0x40 /* global firmware revision code */
44
45 #define CD1400_LIVR 2*0x18 /* local intr vector */
46 #define CD1400_MIVR 2*0x41 /* modem intr vector */
47 #define CD1400_TIVR 2*0x42 /* transmit intr vector */
48 #define CD1400_RIVR 2*0x43 /* receive intr vector */
49 #define CD1400_RIVR_EXCEPTION (1<<2) /* receive exception bit */
50
51 #define CD1400_RICR 2*0x44 /* receive intr channel */
52 #define CD1400_TICR 2*0x45 /* transmit intr channel */
53 #define CD1400_MICR 2*0x46 /* modem intr channel */
54
55 #define CD1400_RDCR 2*0x0e /* rx data count */
56
57 #define CD1400_EOSRR 2*0x60 /* end of service request */
58 #define CD1400_RDSR 2*0x62 /* rx data/status */
59 #define CD1400_RDSR_OVERRUN (1<<0) /* rx overrun error */
60 #define CD1400_RDSR_FRAMING (1<<1) /* rx framing error */
61 #define CD1400_RDSR_PARITY (1<<2) /* rx parity error */
62 #define CD1400_RDSR_BREAK (1<<3) /* rx break */
63 #define CD1400_RDSR_SPECIAL (7<<4) /* rx special char */
64 #define CD1400_RDSR_SPECIAL_SHIFT 4 /* rx special char shift */
65 #define CD1400_RDSR_TIMEOUT (1<<7) /* rx timeout */
66
67 #define CD1400_TDR 2*0x63 /* tx data */
68
69 #define CD1400_MISR 2*0x4c /* modem intr status */
70 #define CD1400_MISR_DSRd (1<<7) /* DSR delta */
71 #define CD1400_MISR_CTSd (1<<6) /* CTS delta */
72 #define CD1400_MISR_RId (1<<5) /* RI delta */
73 #define CD1400_MISR_CDd (1<<4) /* CD delta */
74
75 #define CD1400_MSVR 2*0x6d /* modem signals */
76 #define CD1400_MSVR_DSR (1<<7) /* !DSR line */
77 #define CD1400_MSVR_CTS (1<<6) /* !CTS line */
78 #define CD1400_MSVR_RI (1<<5) /* !RI line */
79 #define CD1400_MSVR_CD (1<<4) /* !CD line */
80 #define CD1400_MSVR_DTR (1<<1) /* DTR line */
81
82 #define CD1400_DTR 2*0x6d /* dtr control */
83 #define CD1400_DTR_CLEAR 0
84 #define CD1400_DTR_SET (1<<1)
85
86 #define CD1400_PPR 2*0x7e
87 #define CD1400_CLOCK_25_1MS 0x31
88
89 #define CD1400_CAR 2*0x68 /* channel access */
90
91 #define CD1400_RIR 2*0x6B /* receive interrupt status */
92 #define CD1400_TIR 2*0x6A /* transmit interrupt status */
93 #define CD1400_MIR 2*0x69 /* modem interrupt status */
94
95 #define CD1400_RBPR 2*0x78 /* receive baud rate period */
96 #define CD1400_RCOR 2*0x7C /* receive clock option */
97 #define CD1400_TBPR 2*0x72 /* transmit baud rate period */
98 #define CD1400_TCOR 2*0x76 /* transmit clock option */
99
100 #define CD1400_COR1 2*0x08 /* channel option 1 */
101 #define CD1400_COR2 2*0x09 /* channel option 2 */
102 #define CD1400_COR3 2*0x0A /* channel option 3 */
103 #define CD1400_COR4 2*0x1E /* channel option 4 */
104 #define CD1400_COR5 2*0x1F /* channel option 5 */
105
106 #define CD1400_SCHR1 2*0x1A /* special character 1 */
107 #define CD1400_SCHR2 2*0x1B /* special character 2 */
108 #define CD1400_SCHR3 2*0x1C /* special character 3 */
109 #define CD1400_SCHR4 2*0x1D /* special character 4 */
110
111 #define CD1400_MCOR1 2*0x15 /* modem change 1 */
112 #define CD1400_MCOR2 2*0x16 /* modem change 2 */
113 #define CD1400_RTPR 2*0x21 /* receive timeout period */
114
115 #define CD1400_SVRR 2*0x67 /* service request */
116 #define CD1400_SVRR_RX (1<<0)
117 #define CD1400_SVRR_TX (1<<1)
118 #define CD1400_SVRR_MDM (1<<2)
119
120 /* hardware SVCACK addresses, for use in interrupt handlers */
121 #define CD1400_SVCACKR 0x100
122 #define CD1400_SVCACKT 0x200
123 #define CD1400_SVCACKM 0x300
124