hd64570reg.h revision 1.4 1 1.4 chopps /* $NetBSD: hd64570reg.h,v 1.4 2000/01/08 20:46:30 chopps Exp $ */
2 1.1 explorer
3 1.1 explorer /*
4 1.1 explorer * Copyright (c) 1998 Vixie Enterprises
5 1.1 explorer * All rights reserved.
6 1.1 explorer *
7 1.1 explorer * Redistribution and use in source and binary forms, with or without
8 1.1 explorer * modification, are permitted provided that the following conditions
9 1.1 explorer * are met:
10 1.1 explorer *
11 1.1 explorer * 1. Redistributions of source code must retain the above copyright
12 1.1 explorer * notice, this list of conditions and the following disclaimer.
13 1.1 explorer * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 explorer * notice, this list of conditions and the following disclaimer in the
15 1.1 explorer * documentation and/or other materials provided with the distribution.
16 1.1 explorer * 3. Neither the name of Vixie Enterprises nor the names
17 1.1 explorer * of its contributors may be used to endorse or promote products derived
18 1.1 explorer * from this software without specific prior written permission.
19 1.1 explorer *
20 1.1 explorer * THIS SOFTWARE IS PROVIDED BY VIXIE ENTERPRISES AND
21 1.1 explorer * CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
22 1.1 explorer * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
23 1.1 explorer * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 1.1 explorer * DISCLAIMED. IN NO EVENT SHALL VIXIE ENTERPRISES OR
25 1.1 explorer * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 1.1 explorer * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 1.1 explorer * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
28 1.1 explorer * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
29 1.1 explorer * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 1.1 explorer * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 1.1 explorer * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.1 explorer * SUCH DAMAGE.
33 1.1 explorer *
34 1.1 explorer * This software has been written for Vixie Enterprises by Michael Graff
35 1.1 explorer * <explorer (at) flame.org>. To learn more about Vixie Enterprises, see
36 1.1 explorer * ``http://www.vix.com''.
37 1.1 explorer */
38 1.1 explorer
39 1.2 kleink #ifndef _DEV_IC_HD64570REG_H_
40 1.2 kleink #define _DEV_IC_HD64570REG_H_
41 1.1 explorer
42 1.1 explorer /* XXX
43 1.1 explorer * This is really HDLC specific stuff, but...
44 1.1 explorer */
45 1.1 explorer #define CISCO_MULTICAST 0x8f /* Cisco multicast address */
46 1.1 explorer #define CISCO_UNICAST 0x0f /* Cisco unicast address */
47 1.1 explorer #define CISCO_KEEPALIVE 0x8035 /* Cisco keepalive protocol */
48 1.1 explorer #define CISCO_ADDR_REQ 0 /* Cisco address request */
49 1.1 explorer #define CISCO_ADDR_REPLY 1 /* Cisco address reply */
50 1.1 explorer #define CISCO_KEEPALIVE_REQ 2 /* Cisco keepalive request */
51 1.1 explorer
52 1.4 chopps struct cisco_pkt {
53 1.1 explorer u_int32_t type;
54 1.1 explorer u_int32_t par1;
55 1.1 explorer u_int32_t par2;
56 1.1 explorer u_int16_t rel;
57 1.1 explorer u_int16_t time0;
58 1.1 explorer u_int16_t time1;
59 1.4 chopps };
60 1.1 explorer #define CISCO_PKT_LEN 18 /* sizeof doesn't work right... */
61 1.1 explorer
62 1.1 explorer #define HDLC_PROTOCOL_IP 0x0800 /* IP */
63 1.4 chopps #define HDLC_PROTOCOL_ISO 0xfefe /* LLC_ISO_LSAP dsap,ssap */
64 1.1 explorer
65 1.4 chopps struct hdlc_header {
66 1.4 chopps u_int8_t h_addr;
67 1.4 chopps u_int8_t h_resv;
68 1.4 chopps u_int16_t h_proto;
69 1.4 chopps };
70 1.1 explorer #define HDLC_HDRLEN 4
71 1.4 chopps
72 1.4 chopps struct hdlc_llc_header {
73 1.4 chopps u_int8_t hl_addr;
74 1.4 chopps u_int8_t hl_resv;
75 1.4 chopps u_int8_t hl_dsap;
76 1.4 chopps u_int8_t hl_ssap;
77 1.4 chopps u_int8_t hl_control;
78 1.4 chopps };
79 1.1 explorer
80 1.1 explorer /*
81 1.1 explorer * Hitachi HD64570 defininitions
82 1.1 explorer */
83 1.1 explorer
84 1.1 explorer /* SCA Control Registers */
85 1.1 explorer #define SCA_PABR0 2
86 1.1 explorer #define SCA_PABR1 3
87 1.1 explorer #define SCA_WCRL 4 /* Wait Control reg */
88 1.1 explorer #define SCA_WCRM 5 /* Wait Control reg */
89 1.1 explorer #define SCA_WCRH 6 /* Wait Control reg */
90 1.1 explorer #define SCA_PCR 8 /* DMA priority control reg */
91 1.1 explorer
92 1.1 explorer /* Interrupt registers */
93 1.1 explorer #define SCA_ISR0 0x10 /* Interrupt status register 0 */
94 1.1 explorer #define SCA_ISR1 0x11 /* Interrupt status register 1 */
95 1.1 explorer #define SCA_ISR2 0x12 /* Interrupt status register 2 */
96 1.1 explorer #define SCA_IER0 0x14 /* Interrupt enable register 0 */
97 1.1 explorer #define SCA_IER1 0x15 /* Interrupt enable register 1 */
98 1.1 explorer #define SCA_IER2 0x16 /* Interrupt enable register 2 */
99 1.1 explorer #define SCA_ITCR 0x18 /* interrupt control register */
100 1.1 explorer #define SCA_IVR 0x1a /* interrupt vector */
101 1.1 explorer #define SCA_IMVR 0x1c /* modified interrupt vector */
102 1.1 explorer
103 1.1 explorer /* MSCI Channel 0 Registers */
104 1.1 explorer #define SCA_TRBL0 0x20 /* TX/RX buffer reg */
105 1.1 explorer #define SCA_TRBH0 0x21 /* TX/RX buffer reg */
106 1.1 explorer #define SCA_ST00 0x22 /* Status reg 0 */
107 1.1 explorer #define SCA_ST10 0x23 /* Status reg 1 */
108 1.1 explorer #define SCA_ST20 0x24 /* Status reg 2 */
109 1.1 explorer #define SCA_ST30 0x25 /* Status reg 3 */
110 1.1 explorer #define SCA_FST0 0x26 /* frame Status reg */
111 1.1 explorer #define SCA_IE00 0x28 /* Interrupt enable reg 0 */
112 1.1 explorer #define SCA_IE10 0x29 /* Interrupt enable reg 1 */
113 1.1 explorer #define SCA_IE20 0x2a /* Interrupt enable reg 2 */
114 1.1 explorer #define SCA_FIE0 0x2b /* Frame Interrupt enable reg */
115 1.1 explorer #define SCA_CMD0 0x2c /* Command reg */
116 1.1 explorer #define SCA_MD00 0x2e /* Mode reg 0 */
117 1.1 explorer #define SCA_MD10 0x2f /* Mode reg 1 */
118 1.1 explorer #define SCA_MD20 0x30 /* Mode reg 2 */
119 1.1 explorer #define SCA_CTL0 0x31 /* Control reg */
120 1.1 explorer #define SCA_SA00 0x32 /* Syn Address reg 0 */
121 1.1 explorer #define SCA_SA10 0x33 /* Syn Address reg 1 */
122 1.1 explorer #define SCA_IDL0 0x34 /* Idle register */
123 1.1 explorer #define SCA_TMC0 0x35 /* Time constant */
124 1.1 explorer #define SCA_RXS0 0x36 /* RX clock source */
125 1.1 explorer #define SCA_TXS0 0x37 /* TX clock source */
126 1.1 explorer #define SCA_TRC00 0x38 /* TX Ready control reg 0 */
127 1.1 explorer #define SCA_TRC10 0x39 /* TX Ready control reg 1 */
128 1.1 explorer #define SCA_RRC0 0x3A /* RX Ready control reg */
129 1.1 explorer
130 1.1 explorer /* MSCI Channel 1 Registers */
131 1.1 explorer #define SCA_TRBL1 0x40 /* TX/RX buffer reg */
132 1.1 explorer #define SCA_TRBH1 0x41 /* TX/RX buffer reg */
133 1.1 explorer #define SCA_ST01 0x42 /* Status reg 0 */
134 1.1 explorer #define SCA_ST11 0x43 /* Status reg 1 */
135 1.1 explorer #define SCA_ST21 0x44 /* Status reg 2 */
136 1.1 explorer #define SCA_ST31 0x45 /* Status reg 3 */
137 1.1 explorer #define SCA_FST1 0x46 /* Frame Status reg */
138 1.1 explorer #define SCA_IE01 0x48 /* Interrupt enable reg 0 */
139 1.1 explorer #define SCA_IE11 0x49 /* Interrupt enable reg 1 */
140 1.1 explorer #define SCA_IE21 0x4a /* Interrupt enable reg 2 */
141 1.1 explorer #define SCA_FIE1 0x4b /* Frame Interrupt enable reg */
142 1.1 explorer #define SCA_CMD1 0x4c /* Command reg */
143 1.1 explorer #define SCA_MD01 0x4e /* Mode reg 0 */
144 1.1 explorer #define SCA_MD11 0x4f /* Mode reg 1 */
145 1.1 explorer #define SCA_MD21 0x50 /* Mode reg 2 */
146 1.1 explorer #define SCA_CTL1 0x51 /* Control reg */
147 1.1 explorer #define SCA_SA01 0x52 /* Syn Address reg 0 */
148 1.1 explorer #define SCA_SA11 0x53 /* Syn Address reg 1 */
149 1.1 explorer #define SCA_IDL1 0x54 /* Idle register */
150 1.1 explorer #define SCA_TMC1 0x55 /* Time constant */
151 1.1 explorer #define SCA_RXS1 0x56 /* RX clock source */
152 1.1 explorer #define SCA_TXS1 0x57 /* TX clock source */
153 1.1 explorer #define SCA_TRC01 0x58 /* TX Ready control reg 0 */
154 1.1 explorer #define SCA_TRC11 0x59 /* TX Ready control reg 1 */
155 1.1 explorer #define SCA_RRC1 0x5A /* RX Ready control reg */
156 1.1 explorer
157 1.1 explorer
158 1.1 explorer /* SCA DMA registers */
159 1.1 explorer
160 1.1 explorer #define SCA_DMER 0x9 /* DMA Master Enable reg */
161 1.1 explorer
162 1.1 explorer /* DMA Channel 0 Registers (MSCI -> memory, or rx) */
163 1.1 explorer #define SCA_BARL0 0x80 /* buffer address reg */
164 1.1 explorer #define SCA_BARH0 0x81 /* buffer address reg */
165 1.1 explorer #define SCA_BARB0 0x82 /* buffer address reg */
166 1.1 explorer #define SCA_DARL0 0x80 /* Dest. address reg */
167 1.1 explorer #define SCA_DARH0 0x81 /* Dest. address reg */
168 1.1 explorer #define SCA_DARB0 0x82 /* Dest. address reg */
169 1.1 explorer #define SCA_CPB0 0x86 /* Chain pointer base */
170 1.1 explorer #define SCA_CDAL0 0x88 /* Current descriptor address */
171 1.1 explorer #define SCA_CDAH0 0x89 /* Current descriptor address */
172 1.1 explorer #define SCA_EDAL0 0x8A /* Error descriptor address */
173 1.1 explorer #define SCA_EDAH0 0x8B /* Error descriptor address */
174 1.1 explorer #define SCA_BFLL0 0x8C /* RX buffer length Low */
175 1.1 explorer #define SCA_BFLH0 0x8D /* RX buffer length High */
176 1.1 explorer #define SCA_BCRL0 0x8E /* Byte Count reg */
177 1.1 explorer #define SCA_BCRH0 0x8F /* Byte Count reg */
178 1.1 explorer #define SCA_DSR0 0x90 /* DMA Status reg */
179 1.1 explorer #define SCA_DMR0 0x91 /* DMA Mode reg */
180 1.1 explorer #define SCA_FCT0 0x93 /* Frame end interrupt Counter */
181 1.1 explorer #define SCA_DIR0 0x94 /* DMA interrupt enable */
182 1.1 explorer #define SCA_DCR0 0x95 /* DMA Command reg */
183 1.1 explorer
184 1.1 explorer /* DMA Channel 1 Registers (memory -> MSCI, or tx) */
185 1.1 explorer #define SCA_BARL1 0xA0 /* buffer address reg */
186 1.1 explorer #define SCA_BARH1 0xA1 /* buffer address reg */
187 1.1 explorer #define SCA_BARB1 0xA2 /* buffer address reg */
188 1.1 explorer #define SCA_SARL1 0xA4 /* Source address reg */
189 1.1 explorer #define SCA_SARH1 0xA5 /* Source address reg */
190 1.1 explorer #define SCA_SARB1 0xA6 /* Source address reg */
191 1.1 explorer #define SCA_CPB1 0xA6 /* Chain pointer base */
192 1.1 explorer #define SCA_CDAL1 0xA8 /* Current descriptor address */
193 1.1 explorer #define SCA_CDAH1 0xA9 /* Current descriptor address */
194 1.1 explorer #define SCA_EDAL1 0xAA /* Error descriptor address */
195 1.1 explorer #define SCA_EDAH1 0xAB /* Error descriptor address */
196 1.1 explorer #define SCA_BCRL1 0xAE /* Byte Count reg */
197 1.1 explorer #define SCA_BCRH1 0xAF /* Byte Count reg */
198 1.1 explorer #define SCA_DSR1 0xB0 /* DMA Status reg */
199 1.1 explorer #define SCA_DMR1 0xB1 /* DMA Mode reg */
200 1.1 explorer #define SCA_FCT1 0xB3 /* Frame end interrupt Counter */
201 1.1 explorer #define SCA_DIR1 0xB4 /* DMA interrupt enable */
202 1.1 explorer #define SCA_DCR1 0xB5 /* DMA Command reg */
203 1.1 explorer
204 1.1 explorer /* DMA Channel 2 Registers (MSCI -> memory) */
205 1.1 explorer #define SCA_BARL2 0xC0 /* buffer address reg */
206 1.1 explorer #define SCA_BARH2 0xC1 /* buffer address reg */
207 1.1 explorer #define SCA_BARB2 0xC2 /* buffer address reg */
208 1.3 chopps #define SCA_CDAL2 0xC8
209 1.1 explorer #define SCA_DSR2 0xD0 /* DMA Status reg */
210 1.1 explorer
211 1.1 explorer /* DMA Channel 3 Registers (memory -> MSCI) */
212 1.1 explorer #define SCA_BARL3 0xE0 /* buffer address reg */
213 1.1 explorer #define SCA_BARH3 0xE1 /* buffer address reg */
214 1.1 explorer #define SCA_BARB3 0xE2 /* buffer address reg */
215 1.3 chopps #define SCA_CDAL3 0xE8
216 1.1 explorer #define SCA_DSR3 0xF0 /* DMA Status reg */
217 1.1 explorer
218 1.1 explorer /*
219 1.3 chopps * Timer Registers
220 1.3 chopps */
221 1.3 chopps
222 1.3 chopps /* Timer up-counter */
223 1.3 chopps #define SCA_TCNTL0 0x60 /* channel 0 */
224 1.3 chopps #define SCA_TCNTH0 0x61 /* channel 0 */
225 1.3 chopps #define SCA_TCNTL1 0x68 /* channel 1 */
226 1.3 chopps #define SCA_TCNTH1 0x69 /* channel 1 */
227 1.3 chopps #define SCA_TCNTL2 0x70 /* channel 2 */
228 1.3 chopps #define SCA_TCNTH2 0x71 /* channel 2 */
229 1.3 chopps #define SCA_TCNTL3 0x78 /* channel 3 */
230 1.3 chopps #define SCA_TCNTH3 0x79 /* channel 3 */
231 1.3 chopps
232 1.3 chopps /* Timer constant register */
233 1.3 chopps #define SCA_TCONRL0 0x62 /* channel 0 */
234 1.3 chopps #define SCA_TCONRH0 0x63 /* channel 0 */
235 1.3 chopps #define SCA_TCONRL1 0x6a /* channel 1 */
236 1.3 chopps #define SCA_TCONRH1 0x6b /* channel 1 */
237 1.3 chopps #define SCA_TCONRL2 0x72 /* channel 2 */
238 1.3 chopps #define SCA_TCONRH2 0x73 /* channel 2 */
239 1.3 chopps #define SCA_TCONRL3 0x7a /* channel 3 */
240 1.3 chopps #define SCA_TCONRH3 0x7b /* channel 3 */
241 1.3 chopps
242 1.3 chopps /* Timer control/status register */
243 1.3 chopps #define SCA_TCSR0 0x64 /* channel 0 */
244 1.3 chopps #define SCA_TCSR1 0x6c /* channel 1 */
245 1.3 chopps #define SCA_TCSR2 0x74 /* channel 2 */
246 1.3 chopps #define SCA_TCSR3 0x7c /* channel 3 */
247 1.3 chopps
248 1.3 chopps /* Timer expand prescale register */
249 1.3 chopps #define SCA_TEPR0 0x65 /* channel 0 */
250 1.3 chopps #define SCA_TEPR1 0x6d /* channel 1 */
251 1.3 chopps #define SCA_TEPR2 0x75 /* channel 2 */
252 1.3 chopps #define SCA_TEPR3 0x7d /* channel 3 */
253 1.3 chopps
254 1.3 chopps /*
255 1.1 explorer * SCA HD64570 Register Definitions
256 1.1 explorer */
257 1.1 explorer
258 1.1 explorer #define ST3_CTS 8 /* modem input /CTS bit */
259 1.1 explorer #define ST3_DCD 4 /* modem input /DCD bit */
260 1.1 explorer
261 1.1 explorer /*
262 1.1 explorer * SCA commands
263 1.1 explorer */
264 1.1 explorer #define SCA_CMD_TXRESET 0x01
265 1.1 explorer #define SCA_CMD_TXENABLE 0x02
266 1.1 explorer #define SCA_CMD_TXDISABLE 0x03
267 1.1 explorer #define SCA_CMD_TXCRCINIT 0x04
268 1.1 explorer #define SCA_CMD_TXCRCEXCL 0x05
269 1.1 explorer #define SCA_CMS_TXEOM 0x06
270 1.1 explorer #define SCA_CMD_TXABORT 0x07
271 1.1 explorer #define SCA_CMD_MPON 0x08
272 1.1 explorer #define SCA_CMD_TXBCLEAR 0x09
273 1.1 explorer
274 1.1 explorer #define SCA_CMD_RXRESET 0x11
275 1.1 explorer #define SCA_CMD_RXENABLE 0x12
276 1.1 explorer #define SCA_CMD_RXDISABLE 0x13
277 1.1 explorer #define SCA_CMD_RXCRCINIT 0x14
278 1.1 explorer #define SCA_CMD_RXMSGREJ 0x15
279 1.1 explorer #define SCA_CMD_MPSEARCH 0x16
280 1.1 explorer #define SCA_CMD_RXCRCEXCL 0x17
281 1.1 explorer #define SCA_CMD_RXCRCCALC 0x18
282 1.1 explorer
283 1.1 explorer #define SCA_CMD_NOP 0x00
284 1.1 explorer #define SCA_CMD_RESET 0x21
285 1.1 explorer #define SCA_CMD_SEARCH 0x31
286 1.1 explorer
287 1.1 explorer #define SCA_MD0_CRC_1 0x01
288 1.1 explorer #define SCA_MD0_CRC_CCITT 0x02
289 1.1 explorer #define SCA_MD0_CRC_ENABLE 0x04
290 1.1 explorer #define SCA_MD0_AUTO_ENABLE 0x10
291 1.1 explorer #define SCA_MD0_MODE_ASYNC 0x00
292 1.1 explorer #define SCA_MD0_MODE_BYTESYNC1 0x20
293 1.1 explorer #define SCA_MD0_MODE_BISYNC 0x40
294 1.1 explorer #define SCA_MD0_MODE_BYTESYNC2 0x60
295 1.1 explorer #define SCA_MD0_MODE_HDLC 0x80
296 1.1 explorer
297 1.1 explorer #define SCA_MD1_NOADDRCHK 0x00
298 1.1 explorer #define SCA_MD1_SNGLADDR1 0x40
299 1.1 explorer #define SCA_MD1_SNGLADDR2 0x80
300 1.1 explorer #define SCA_MD1_DUALADDR 0xC0
301 1.1 explorer
302 1.1 explorer #define SCA_MD2_DUPLEX 0x00
303 1.1 explorer #define SCA_MD2_ECHO 0x01
304 1.1 explorer #define SCA_MD2_LOOPBACK 0x03
305 1.1 explorer #define SCA_MD2_ADPLLx8 0x00
306 1.1 explorer #define SCA_MD2_ADPLLx16 0x08
307 1.1 explorer #define SCA_MD2_ADPLLx32 0x10
308 1.1 explorer #define SCA_MD2_NRZ 0x00
309 1.1 explorer #define SCA_MD2_NRZI 0x20
310 1.1 explorer #define SCA_MD2_MANCHESTER 0x80
311 1.1 explorer #define SCA_MD2_FM0 0xC0
312 1.1 explorer #define SCA_MD2_FM1 0xA0
313 1.1 explorer
314 1.3 chopps #define SCA_CTL_RTS_MASK 0x01 /* control state of RTS */
315 1.3 chopps #define SCA_CTL_RTS_HIGH 0x00 /* raise RTS (low !RTS) */
316 1.3 chopps #define SCA_CTL_RTS_LOW 0x01 /* lower RTS (raise !RTS) */
317 1.3 chopps #define SCA_CTL_IDLC_MASK 0x10 /* control idle state */
318 1.3 chopps #define SCA_CTL_IDLC_MARK 0x00 /* transmit mark in idle state */
319 1.3 chopps #define SCA_CTL_IDLC_PATTERN 0x10 /* tranmist idle pattern */
320 1.3 chopps #define SCA_CTL_UDRNC_MASK 0x20 /* control underun state */
321 1.3 chopps #define SCA_CTL_UDRNC_AFTER_ABORT 0x00 /* idle after aborting trans */
322 1.3 chopps #define SCA_CTL_UDRNC_AFTER_FCS 0x20 /* idle after FCS and flag trans */
323 1.3 chopps
324 1.3 chopps #define SCA_RXS_DIV_MASK 0x0F /* BRG divisor is 2^(value) */
325 1.3 chopps #define SCA_RXS_DIV_1 0x00 /* 1 */
326 1.3 chopps #define SCA_RXS_DIV_2 0x01 /* 2 */
327 1.3 chopps #define SCA_RXS_DIV_4 0x02 /* 4 */
328 1.3 chopps #define SCA_RXS_DIV_8 0x03 /* 8 */
329 1.3 chopps #define SCA_RXS_DIV_16 0x04 /* 16 */
330 1.3 chopps #define SCA_RXS_DIV_32 0x05 /* 32 */
331 1.3 chopps #define SCA_RXS_DIV_64 0x06 /* 64 */
332 1.3 chopps #define SCA_RXS_DIV_128 0x07 /* 128 */
333 1.3 chopps #define SCA_RXS_DIV_256 0x08 /* 256 */
334 1.3 chopps #define SCA_RXS_DIV_512 0x09 /* 512 */
335 1.3 chopps #define SCA_RXS_CLK_MASK 0x70 /* which clock source */
336 1.3 chopps #define SCA_RXS_CLK_LINE 0x00 /* RXC line input */
337 1.3 chopps #define SCA_RXS_CLK_LINE_SN 0x20 /* RXC line with noise suppression */
338 1.3 chopps #define SCA_RXS_CLK_INTERNAL 0x40 /* Baud Rate Gen. output */
339 1.3 chopps #define SCA_RXS_CLK_ADPLL_OUT 0x60 /* BRG out for ADPLL clock */
340 1.3 chopps #define SCA_RXS_CLK_ADPLL_IN 0x70 /* line input for ADPLL clock */
341 1.3 chopps
342 1.3 chopps #define SCA_TXS_DIV_MASK 0x0F /* BRG divisor is 2^(valud) */
343 1.3 chopps #define SCA_TXS_DIV_1 0x00 /* 1 */
344 1.3 chopps #define SCA_TXS_DIV_2 0x01 /* 2 */
345 1.3 chopps #define SCA_TXS_DIV_4 0x02 /* 4 */
346 1.3 chopps #define SCA_TXS_DIV_8 0x03 /* 8 */
347 1.3 chopps #define SCA_TXS_DIV_16 0x04 /* 16 */
348 1.3 chopps #define SCA_TXS_DIV_32 0x05 /* 32 */
349 1.3 chopps #define SCA_TXS_DIV_64 0x06 /* 64 */
350 1.3 chopps #define SCA_TXS_DIV_128 0x07 /* 128 */
351 1.3 chopps #define SCA_TXS_DIV_256 0x08 /* 256 */
352 1.3 chopps #define SCA_TXS_DIV_512 0x09 /* 512 */
353 1.3 chopps #define SCA_TXS_CLK_MASK 0x70 /* which clock source */
354 1.3 chopps #define SCA_TXS_CLK_LINE 0x00 /* TXC line input */
355 1.3 chopps #define SCA_TXS_CLK_INTERNAL 0x40 /* Baud Rate Gen. output */
356 1.3 chopps #define SCA_TXS_CLK_RXCLK 0x60 /* Recieve clock */
357 1.1 explorer
358 1.1 explorer #define SCA_ST0_RXRDY 0x01
359 1.1 explorer #define SCA_ST0_TXRDY 0x02
360 1.1 explorer #define SCA_ST0_RXINT 0x40
361 1.1 explorer #define SCA_ST0_TXINT 0x80
362 1.1 explorer
363 1.1 explorer #define SCA_ST1_IDLST 0x01
364 1.1 explorer #define SCA_ST1_ABTST 0x02
365 1.1 explorer #define SCA_ST1_DCDCHG 0x04
366 1.1 explorer #define SCA_ST1_CTSCHG 0x08
367 1.1 explorer #define SCA_ST1_FLAG 0x10
368 1.1 explorer #define SCA_ST1_TXIDL 0x40
369 1.1 explorer #define SCA_ST1_UDRN 0x80
370 1.1 explorer
371 1.1 explorer /* ST2 and FST look the same */
372 1.1 explorer #define SCA_FST_CRCERR 0x04
373 1.1 explorer #define SCA_FST_OVRN 0x08
374 1.1 explorer #define SCA_FST_RESFRM 0x10
375 1.1 explorer #define SCA_FST_ABRT 0x20
376 1.1 explorer #define SCA_FST_SHRT 0x40
377 1.1 explorer #define SCA_FST_EOM 0x80
378 1.1 explorer
379 1.1 explorer #define SCA_ST3_RXENA 0x01
380 1.1 explorer #define SCA_ST3_TXENA 0x02
381 1.1 explorer #define SCA_ST3_DCD 0x04
382 1.1 explorer #define SCA_ST3_CTS 0x08
383 1.1 explorer #define SCA_ST3_ADPLLSRCH 0x10
384 1.1 explorer #define SCA_ST3_TXDATA 0x20
385 1.1 explorer
386 1.1 explorer #define SCA_FIE_EOMFE 0x80
387 1.1 explorer
388 1.1 explorer #define SCA_IE0_RXRDY 0x01
389 1.1 explorer #define SCA_IE0_TXRDY 0x02
390 1.1 explorer #define SCA_IE0_RXINT 0x40
391 1.1 explorer #define SCA_IE0_TXINT 0x80
392 1.1 explorer
393 1.1 explorer #define SCA_IE1_IDLDE 0x01
394 1.1 explorer #define SCA_IE1_ABTDE 0x02
395 1.1 explorer #define SCA_IE1_DCD 0x04
396 1.1 explorer #define SCA_IE1_CTS 0x08
397 1.1 explorer #define SCA_IE1_FLAG 0x10
398 1.1 explorer #define SCA_IE1_IDL 0x40
399 1.1 explorer #define SCA_IE1_UDRN 0x80
400 1.1 explorer
401 1.1 explorer #define SCA_IE2_CRCERR 0x04
402 1.1 explorer #define SCA_IE2_OVRN 0x08
403 1.1 explorer #define SCA_IE2_RESFRM 0x10
404 1.1 explorer #define SCA_IE2_ABRT 0x20
405 1.1 explorer #define SCA_IE2_SHRT 0x40
406 1.1 explorer #define SCA_IE2_EOM 0x80
407 1.1 explorer
408 1.3 chopps
409 1.3 chopps /*
410 1.3 chopps * Interrupt status register bits
411 1.3 chopps */
412 1.3 chopps #define SCA_ISR0_MSCI_RXRDY0 0x01 /* rx ready port 0 int */
413 1.3 chopps #define SCA_ISR0_MSCI_TXRDY0 0x02 /* tx ready port 0 int */
414 1.3 chopps #define SCA_ISR0_MSCI_RXINT0 0x04 /* rx error port 0 int */
415 1.3 chopps #define SCA_ISR0_MSCI_TXINT0 0x08 /* tx error port 0 int */
416 1.3 chopps #define SCA_ISR0_MSCI_RXRDY1 0x10 /* rx ready port 1 int */
417 1.3 chopps #define SCA_ISR0_MSCI_TXRDY1 0x20 /* tx ready port 1 int */
418 1.3 chopps #define SCA_ISR0_MSCI_RXINT1 0x40 /* rx error port 1 int */
419 1.3 chopps #define SCA_ISR0_MSCI_TXINT1 0x80 /* tx error port 1 int */
420 1.3 chopps
421 1.3 chopps #define SCA_ISR1_DMAC_RX0A 0x01 /* dmac channel 0 int a */
422 1.3 chopps #define SCA_ISR1_DMAC_RX0B 0x02 /* dmac channel 0 int b */
423 1.3 chopps #define SCA_ISR1_DMAC_TX0A 0x04 /* dmac channel 1 int a */
424 1.3 chopps #define SCA_ISR1_DMAC_TX0B 0x08 /* dmac channel 1 int b */
425 1.3 chopps #define SCA_ISR1_DMAC_RX1A 0x10 /* dmac channel 2 int a */
426 1.3 chopps #define SCA_ISR1_DMAC_RX1B 0x20 /* dmac channel 2 int b */
427 1.3 chopps #define SCA_ISR1_DMAC_TX1A 0x40 /* dmac channel 3 int a */
428 1.3 chopps #define SCA_ISR1_DMAC_TX1B 0x80 /* dmac channel 3 int b */
429 1.3 chopps
430 1.3 chopps #define SCA_ISR2_TIMER_IRQ0 0x10 /* timer channel 0 int */
431 1.3 chopps #define SCA_ISR2_TIMER_IRQ1 0x20 /* timer channel 1 int */
432 1.3 chopps #define SCA_ISR2_TIMER_IRQ2 0x40 /* timer channel 2 int */
433 1.3 chopps #define SCA_ISR2_TIMER_IRQ3 0x80 /* timer channel 3 int */
434 1.3 chopps
435 1.3 chopps /* masks/values for the Interrupt Control Register (ITCR) */
436 1.3 chopps #define SCA_ITCR_INTR_PRI_MASK 0x80 /* priority of intrerrupts */
437 1.3 chopps #define SCA_ITCR_INTR_PRI_MSCI 0x00 /* msci over dmac */
438 1.3 chopps #define SCA_ITCR_INTR_PRI_DMAC 0x80 /* dmac over msci */
439 1.3 chopps #define SCA_ITCR_ACK_MASK 0x60 /* mask for intr ack cycle setting */
440 1.3 chopps #define SCA_ITCR_ACK_NONE 0x00 /* no intr ack cycle */
441 1.3 chopps #define SCA_ITCR_ACK_SINGLE 0x20 /* single intr ack cycle */
442 1.3 chopps #define SCA_ITCR_ACK_DOUBLE 0x40 /* double intr ack cycle */
443 1.3 chopps #define SCA_ITCR_ACK_RESV 0x60 /* reserverd */
444 1.3 chopps #define SCA_ITCR_VOUT_MASK 0x10 /* vector output */
445 1.3 chopps #define SCA_ITCR_VOUT_IVR 0x00 /* use IVR */
446 1.3 chopps #define SCA_ITCR_VOUT_IMVR 0x10 /* use IMVR */
447 1.3 chopps
448 1.3 chopps /*
449 1.3 chopps * Interrupt enable register bits
450 1.3 chopps */
451 1.3 chopps #define SCA_IER0_MSCI_RXRDY0 0x01 /* enable rx ready port 0 int */
452 1.3 chopps #define SCA_IER0_MSCI_TXRDY0 0x02 /* enable tx ready port 0 int */
453 1.3 chopps #define SCA_IER0_MSCI_RXINT0 0x04 /* enable rx error port 0 int */
454 1.3 chopps #define SCA_IER0_MSCI_TXINT0 0x08 /* enable tx error port 0 int */
455 1.3 chopps #define SCA_IER0_MSCI_RXRDY1 0x10 /* enable rx ready port 1 int */
456 1.3 chopps #define SCA_IER0_MSCI_TXRDY1 0x20 /* enable tx ready port 1 int */
457 1.3 chopps #define SCA_IER0_MSCI_RXINT1 0x40 /* enable rx error port 1 int */
458 1.3 chopps #define SCA_IER0_MSCI_TXINT1 0x80 /* enable tx error port 1 int */
459 1.3 chopps
460 1.3 chopps #define SCA_IER1_DMAC_RX0A 0x01 /* enable dmac channel 0 int a */
461 1.3 chopps #define SCA_IER1_DMAC_RX0B 0x02 /* enable dmac channel 0 int b */
462 1.3 chopps #define SCA_IER1_DMAC_TX0A 0x04 /* enable dmac channel 1 int a */
463 1.3 chopps #define SCA_IER1_DMAC_TX0B 0x08 /* enable dmac channel 1 int b */
464 1.3 chopps #define SCA_IER1_DMAC_RX1A 0x10 /* enable dmac channel 2 int a */
465 1.3 chopps #define SCA_IER1_DMAC_RX1B 0x20 /* enable dmac channel 2 int b */
466 1.3 chopps #define SCA_IER1_DMAC_TX1A 0x40 /* enable dmac channel 3 int a */
467 1.3 chopps #define SCA_IER1_DMAC_TX1B 0x80 /* enable dmac channel 3 int b */
468 1.3 chopps
469 1.3 chopps #define SCA_IER2_TIMER_IRQ0 0x10 /* enable timer channel 0 int */
470 1.3 chopps #define SCA_IER2_TIMER_IRQ1 0x20 /* enable timer channel 1 int */
471 1.3 chopps #define SCA_IER2_TIMER_IRQ2 0x40 /* enable timer channel 2 int */
472 1.3 chopps #define SCA_IER2_TIMER_IRQ3 0x80 /* enable timer channel 3 int */
473 1.3 chopps
474 1.1 explorer /* This is for RRC, TRC0 and TRC1. */
475 1.1 explorer #define SCA_RCR_MASK 0x1F
476 1.1 explorer
477 1.1 explorer #define SCA_IE1_
478 1.1 explorer
479 1.1 explorer #define SCA_IV_CHAN0 0x00
480 1.1 explorer #define SCA_IV_CHAN1 0x20
481 1.1 explorer
482 1.1 explorer #define SCA_IV_RXRDY 0x04
483 1.1 explorer #define SCA_IV_TXRDY 0x06
484 1.1 explorer #define SCA_IV_RXINT 0x08
485 1.1 explorer #define SCA_IV_TXINT 0x0A
486 1.1 explorer
487 1.1 explorer #define SCA_IV_DMACH0 0x00
488 1.1 explorer #define SCA_IV_DMACH1 0x08
489 1.1 explorer #define SCA_IV_DMACH2 0x20
490 1.1 explorer #define SCA_IV_DMACH3 0x28
491 1.1 explorer
492 1.1 explorer #define SCA_IV_DMIA 0x14
493 1.1 explorer #define SCA_IV_DMIB 0x16
494 1.1 explorer
495 1.1 explorer #define SCA_IV_TIMER0 0x1C
496 1.1 explorer #define SCA_IV_TIMER1 0x1E
497 1.1 explorer #define SCA_IV_TIMER2 0x3C
498 1.1 explorer #define SCA_IV_TIMER3 0x3E
499 1.1 explorer
500 1.1 explorer /*
501 1.1 explorer * DMA registers
502 1.1 explorer */
503 1.1 explorer #define SCA_DSR_EOT 0x80
504 1.1 explorer #define SCA_DSR_EOM 0x40
505 1.1 explorer #define SCA_DSR_BOF 0x20
506 1.1 explorer #define SCA_DSR_COF 0x10
507 1.1 explorer #define SCA_DSR_DE 0x02
508 1.1 explorer #define SCA_DSR_DEWD 0x01 /* write DISABLE DE bit */
509 1.1 explorer
510 1.1 explorer #define SCA_DMR_TMOD 0x10
511 1.1 explorer #define SCA_DMR_NF 0x04
512 1.1 explorer #define SCA_DMR_CNTE 0x02
513 1.1 explorer
514 1.1 explorer #define SCA_DMER_EN 0x80
515 1.1 explorer
516 1.1 explorer #define SCA_DCR_ABRT 0x01
517 1.1 explorer #define SCA_DCR_FCCLR 0x02 /* Clear frame end intr counter */
518 1.1 explorer
519 1.1 explorer #define SCA_DIR_EOT 0x80
520 1.1 explorer #define SCA_DIR_EOM 0x40
521 1.1 explorer #define SCA_DIR_BOF 0x20
522 1.1 explorer #define SCA_DIR_COF 0x10
523 1.1 explorer
524 1.1 explorer #define SCA_PCR_BRC 0x10
525 1.1 explorer #define SCA_PCR_CCC 0x08
526 1.1 explorer #define SCA_PCR_PR2 0x04
527 1.1 explorer #define SCA_PCR_PR1 0x02
528 1.1 explorer #define SCA_PCR_PR0 0x01
529 1.1 explorer
530 1.1 explorer /*
531 1.1 explorer * Descriptor Status byte bit definitions:
532 1.1 explorer *
533 1.1 explorer * Bit Receive Status Transmit Status
534 1.1 explorer * -------------------------------------------------
535 1.1 explorer * 7 EOM EOM
536 1.1 explorer * 6 Short Frame ...
537 1.1 explorer * 5 Abort ...
538 1.1 explorer * 4 Residual bit ...
539 1.1 explorer * 3 Overrun ...
540 1.1 explorer * 2 CRC ...
541 1.1 explorer * 1 ... ...
542 1.1 explorer * 0 ... EOT
543 1.1 explorer * -------------------------------------------------
544 1.1 explorer */
545 1.1 explorer
546 1.1 explorer #define ST_EOM 0x80 /* End of frame */
547 1.1 explorer #define ST_SHRT 0x40 /* Short frame */
548 1.1 explorer #define ST_ABT 0x20 /* Abort detected */
549 1.1 explorer #define ST_RBIT 0x10 /* Residual bit detected */
550 1.1 explorer #define ST_OVRN 0x8 /* Overrun error */
551 1.1 explorer #define ST_CRCE 0x4 /* CRC Error */
552 1.1 explorer #define ST_OVFL 0x1 /* Buffer OverFlow error (software defined) */
553 1.1 explorer
554 1.1 explorer #define ST_EOT 1 /* End of transmit command */
555 1.1 explorer
556 1.1 explorer
557 1.1 explorer /* DMA Status register (DSR) bit definitions */
558 1.1 explorer #define DSR_EOT 0x80 /* end of transfer EOT bit */
559 1.1 explorer #define DSR_EOM 0x40 /* end of frame EOM bit */
560 1.1 explorer #define DSR_BOF 0x20 /* buffer overflow BOF bit */
561 1.1 explorer #define DSR_COF 0x10 /* counter overflow COF bit */
562 1.1 explorer #define DSR_DWE 1 /* write disable DWE bit */
563 1.1 explorer
564 1.1 explorer /* MSCI Status register 0 bits */
565 1.1 explorer
566 1.1 explorer #define RXRDY_BIT 1 /* RX ready */
567 1.1 explorer #define TXRDY_BIT 2 /* TX ready */
568 1.1 explorer
569 1.1 explorer #define ST3_CTS 8 /* modem input /CTS bit */
570 1.1 explorer #define ST3_DCD 4 /* modem input /DCD bit */
571 1.3 chopps
572 1.3 chopps /*
573 1.3 chopps * timer register values
574 1.3 chopps */
575 1.3 chopps #define SCA_TCSR_TME 0x10 /* timer enable */
576 1.3 chopps #define SCA_TCSR_ECMI 0x40 /* interrupt enable */
577 1.3 chopps #define SCA_TCSR_CMF 0x80 /* timer complete */
578 1.3 chopps
579 1.3 chopps #define SCA_TEPR_DIV_1 0x00 /* 2^(n) prescale divisor */
580 1.3 chopps #define SCA_TEPR_DIV_2 0x01
581 1.3 chopps #define SCA_TEPR_DIV_4 0x02
582 1.3 chopps #define SCA_TEPR_DIV_8 0x03
583 1.3 chopps #define SCA_TEPR_DIV_16 0x04
584 1.3 chopps #define SCA_TEPR_DIV_32 0x05
585 1.3 chopps #define SCA_TEPR_DIV_64 0x06
586 1.3 chopps #define SCA_TEPR_DIV_128 0x06
587 1.1 explorer
588 1.1 explorer
589 1.1 explorer /* TX and RX Clock Source */
590 1.1 explorer #define CLK_LINE 0x00 /* TX/RX line input */
591 1.1 explorer #define CLK_BRG 0x40 /* internal baud rate generator */
592 1.1 explorer #define CLK_RXC 0x60 /* receive clock */
593 1.1 explorer
594 1.1 explorer /* Clocking options */
595 1.1 explorer #define CLK_INT 0 /* Internal - Baud Rate generator output */
596 1.1 explorer #define CLK_EXT 1 /* External - both clocks */
597 1.1 explorer #define CLK_RXCI 2 /* External - Receive Clock only */
598 1.1 explorer #define CLK_EETC 3 /* EETC clock: TX = int. / RX = ext.*/
599 1.1 explorer
600 1.1 explorer #define SCA_DMAC_OFF_0 0x00 /* offset of DMAC for port 0 */
601 1.1 explorer #define SCA_DMAC_OFF_1 0x40 /* offset of DMAC for port 1 */
602 1.1 explorer #define SCA_MSCI_OFF_0 0x00 /* offset of MSCI for port 0 */
603 1.1 explorer #define SCA_MSCI_OFF_1 0x20 /* offset of MSCI for port 1 */
604 1.1 explorer
605 1.1 explorer /*
606 1.1 explorer * DMA constraints
607 1.1 explorer */
608 1.1 explorer #define SCA_DMA_ALIGNMENT (64 * 1024) /* 64 KB alignment */
609 1.1 explorer #define SCA_DMA_BOUNDRY (16 * 1024 * 1024) /* 16 MB region */
610 1.1 explorer
611 1.2 kleink #endif /* _DEV_IC_HD64570REG_H_ */
612