siopreg.h revision 1.9 1 1.9 is /* $NetBSD: siopreg.h,v 1.9 1999/03/09 20:31:34 is Exp $ */
2 1.5 cgd
3 1.1 mw /*
4 1.1 mw * Copyright (c) 1990 The Regents of the University of California.
5 1.1 mw * All rights reserved.
6 1.1 mw *
7 1.1 mw * This code is derived from software contributed to Berkeley by
8 1.1 mw * Van Jacobson of Lawrence Berkeley Laboratory.
9 1.1 mw *
10 1.1 mw * Redistribution and use in source and binary forms, with or without
11 1.1 mw * modification, are permitted provided that the following conditions
12 1.1 mw * are met:
13 1.1 mw * 1. Redistributions of source code must retain the above copyright
14 1.1 mw * notice, this list of conditions and the following disclaimer.
15 1.1 mw * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 mw * notice, this list of conditions and the following disclaimer in the
17 1.1 mw * documentation and/or other materials provided with the distribution.
18 1.1 mw * 3. All advertising materials mentioning features or use of this software
19 1.1 mw * must display the following acknowledgement:
20 1.1 mw * This product includes software developed by the University of
21 1.1 mw * California, Berkeley and its contributors.
22 1.1 mw * 4. Neither the name of the University nor the names of its contributors
23 1.1 mw * may be used to endorse or promote products derived from this software
24 1.1 mw * without specific prior written permission.
25 1.1 mw *
26 1.1 mw * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 1.1 mw * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 1.1 mw * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 1.1 mw * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 1.1 mw * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 1.1 mw * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 1.1 mw * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 1.1 mw * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 1.1 mw * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 1.1 mw * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 1.1 mw * SUCH DAMAGE.
37 1.1 mw *
38 1.2 chopps * @(#)siopreg.h 7.3 (Berkeley) 2/5/91
39 1.1 mw */
40 1.1 mw
41 1.1 mw /*
42 1.1 mw * NCR 53C710 SCSI interface hardware description.
43 1.1 mw *
44 1.6 chopps * From the Mach scsi driver for the 53C700
45 1.1 mw */
46 1.1 mw
47 1.1 mw typedef struct {
48 1.9 is
49 1.9 is #ifndef ARCH_720
50 1.9 is
51 1.7 chopps /*00*/ volatile unsigned char siop_sien; /* rw: SCSI Interrupt Enable */
52 1.7 chopps /*01*/ volatile unsigned char siop_sdid; /* rw: SCSI Destination ID */
53 1.7 chopps /*02*/ volatile unsigned char siop_scntl1; /* rw: SCSI control reg 1 */
54 1.7 chopps /*03*/ volatile unsigned char siop_scntl0; /* rw: SCSI control reg 0 */
55 1.9 is
56 1.7 chopps /*04*/ volatile unsigned char siop_socl; /* rw: SCSI Output Control Latch */
57 1.7 chopps /*05*/ volatile unsigned char siop_sodl; /* rw: SCSI Output Data Latch */
58 1.7 chopps /*06*/ volatile unsigned char siop_sxfer; /* rw: SCSI Transfer reg */
59 1.7 chopps /*07*/ volatile unsigned char siop_scid; /* rw: SCSI Chip ID reg */
60 1.9 is
61 1.7 chopps /*08*/ volatile unsigned char siop_sbcl; /* ro: SCSI Bus Control Lines */
62 1.7 chopps /*09*/ volatile unsigned char siop_sbdl; /* ro: SCSI Bus Data Lines */
63 1.7 chopps /*0a*/ volatile unsigned char siop_sidl; /* ro: SCSI Input Data Latch */
64 1.7 chopps /*0b*/ volatile unsigned char siop_sfbr; /* ro: SCSI First Byte Received */
65 1.9 is
66 1.7 chopps /*0c*/ volatile unsigned char siop_sstat2; /* ro: SCSI status reg 2 */
67 1.7 chopps /*0d*/ volatile unsigned char siop_sstat1; /* ro: SCSI status reg 1 */
68 1.7 chopps /*0e*/ volatile unsigned char siop_sstat0; /* ro: SCSI status reg 0 */
69 1.7 chopps /*0f*/ volatile unsigned char siop_dstat; /* ro: DMA status */
70 1.9 is
71 1.7 chopps /*10*/ volatile unsigned long siop_dsa; /* rw: Data Structure Address */
72 1.9 is
73 1.7 chopps /*14*/ volatile unsigned char siop_ctest3; /* ro: Chip test register 3 */
74 1.7 chopps /*15*/ volatile unsigned char siop_ctest2; /* ro: Chip test register 2 */
75 1.7 chopps /*16*/ volatile unsigned char siop_ctest1; /* ro: Chip test register 1 */
76 1.7 chopps /*17*/ volatile unsigned char siop_ctest0; /* ro: Chip test register 0 */
77 1.9 is
78 1.7 chopps /*18*/ volatile unsigned char siop_ctest7; /* rw: Chip test register 7 */
79 1.7 chopps /*19*/ volatile unsigned char siop_ctest6; /* rw: Chip test register 6 */
80 1.7 chopps /*1a*/ volatile unsigned char siop_ctest5; /* rw: Chip test register 5 */
81 1.7 chopps /*1b*/ volatile unsigned char siop_ctest4; /* rw: Chip test register 4 */
82 1.9 is
83 1.7 chopps /*1c*/ volatile unsigned long siop_temp; /* rw: Temporary Stack reg */
84 1.9 is
85 1.7 chopps /*20*/ volatile unsigned char siop_lcrc; /* rw: LCRC value */
86 1.7 chopps /*21*/ volatile unsigned char siop_ctest8; /* rw: Chip test register 8 */
87 1.7 chopps /*22*/ volatile unsigned char siop_istat; /* rw: Interrupt Status reg */
88 1.7 chopps /*23*/ volatile unsigned char siop_dfifo; /* rw: DMA FIFO */
89 1.9 is
90 1.7 chopps /*24*/ volatile unsigned char siop_dcmd; /* rw: DMA Command Register */
91 1.7 chopps /*25*/ volatile unsigned char siop_dbc2; /* rw: DMA Byte Counter reg */
92 1.7 chopps /*26*/ volatile unsigned char siop_dbc1;
93 1.7 chopps /*27*/ volatile unsigned char siop_dbc0;
94 1.9 is
95 1.7 chopps /*28*/ volatile unsigned long siop_dnad; /* rw: DMA Next Address */
96 1.9 is
97 1.7 chopps /*2c*/ volatile unsigned long siop_dsp; /* rw: DMA SCRIPTS Pointer reg */
98 1.9 is
99 1.7 chopps /*30*/ volatile unsigned long siop_dsps; /* rw: DMA SCRIPTS Pointer Save reg */
100 1.9 is
101 1.7 chopps /*34*/ volatile unsigned long siop_scratch; /* rw: Scratch Register */
102 1.9 is
103 1.9 is /*38*/ volatile unsigned char siop_dcntl; /* rw: DMA Control reg */
104 1.9 is /*39*/ volatile unsigned char siop_dwt; /* rw: DMA Watchdog Timer */
105 1.9 is /*3a*/ volatile unsigned char siop_dien; /* rw: DMA Interrupt Enable */
106 1.9 is /*3b*/ volatile unsigned char siop_dmode; /* rw: DMA Mode reg */
107 1.9 is
108 1.9 is /*3c*/ volatile unsigned long siop_adder;
109 1.9 is
110 1.9 is #else
111 1.9 is
112 1.9 is /*00*/ volatile unsigned char siop_scntl3; /* rw: SCSI control reg 3 */
113 1.9 is /*01*/ volatile unsigned char siop_scntl2; /* rw: SCSI control reg 2 */
114 1.9 is /*02*/ volatile unsigned char siop_scntl1; /* rw: SCSI control reg 1 */
115 1.9 is /*03*/ volatile unsigned char siop_scntl0; /* rw: SCSI control reg 0 */
116 1.9 is
117 1.9 is /*04*/ volatile unsigned char siop_gpreg; /* rw: SCSI */
118 1.9 is /*05*/ volatile unsigned char siop_sdid; /* rw: SCSI Destination ID */
119 1.9 is /*06*/ volatile unsigned char siop_sxfer; /* rw: SCSI Transfer reg */
120 1.9 is /*07*/ volatile unsigned char siop_scid; /* rw: SCSI Chip ID reg */
121 1.9 is
122 1.9 is /*08*/ volatile unsigned char siop_sbcl; /* ro: SCSI Bus Control Lines */
123 1.9 is /*09*/ volatile unsigned char siop_ssid; /* ro: SCSI */
124 1.9 is /*0a*/ volatile unsigned char siop_socl; /* rw: SCSI Output Control Latch */
125 1.9 is /*0b*/ volatile unsigned char siop_sfbr; /* ro: SCSI First Byte Received */
126 1.9 is
127 1.9 is /*0c*/ volatile unsigned char siop_sstat2; /* ro: SCSI status reg 2 */
128 1.9 is /*0d*/ volatile unsigned char siop_sstat1; /* ro: SCSI status reg 1 */
129 1.9 is /*0e*/ volatile unsigned char siop_sstat0; /* ro: SCSI status reg 0 */
130 1.9 is /*0f*/ volatile unsigned char siop_dstat; /* ro: DMA status */
131 1.9 is
132 1.9 is /*10*/ volatile unsigned long siop_dsa; /* rw: Data Structure Address */
133 1.9 is
134 1.9 is /*14*/ volatile unsigned char siop_14_; /* ??: */
135 1.9 is /*15*/ volatile unsigned char siop_15_; /* ??: */
136 1.9 is /*16*/ volatile unsigned char siop_16_; /* ??: */
137 1.9 is /*17*/ volatile unsigned char siop_istat; /* rw: Interrupt Status reg */
138 1.9 is
139 1.9 is /*18*/ volatile unsigned char siop_ctest3; /* ro: Chip test register 3 */
140 1.9 is /*19*/ volatile unsigned char siop_ctest2; /* ro: Chip test register 2 */
141 1.9 is /*1a*/ volatile unsigned char siop_ctest1; /* ro: Chip test register 1 */
142 1.9 is /*1b*/ volatile unsigned char siop_ctest0; /* ro: Chip test register 0 */
143 1.9 is
144 1.9 is /*1c*/ volatile unsigned long siop_temp; /* rw: Temporary Stack reg */
145 1.9 is
146 1.9 is /*20*/ volatile unsigned char siop_ctest6; /* rw: Chip test register 6 */
147 1.9 is /*21*/ volatile unsigned char siop_ctest5; /* rw: Chip test register 5 */
148 1.9 is /*22*/ volatile unsigned char siop_ctest4; /* rw: Chip test register 4 */
149 1.9 is /*23*/ volatile unsigned char siop_dfifo; /* rw: DMA FIFO */
150 1.9 is
151 1.9 is /*24*/ volatile unsigned char siop_dcmd; /* rw: DMA Command Register */
152 1.9 is /*25*/ volatile unsigned char siop_dbc2; /* rw: DMA Byte Counter reg */
153 1.9 is /*26*/ volatile unsigned char siop_dbc1;
154 1.9 is /*27*/ volatile unsigned char siop_dbc0;
155 1.9 is
156 1.9 is /*28*/ volatile unsigned long siop_dnad; /* rw: DMA Next Address */
157 1.9 is
158 1.9 is /*2c*/ volatile unsigned long siop_dsp; /* rw: DMA SCRIPTS Pointer reg */
159 1.9 is
160 1.9 is /*30*/ volatile unsigned long siop_dsps; /* rw: DMA SCRIPTS Pointer Save reg */
161 1.9 is
162 1.9 is /*34*/ volatile unsigned long siop_scratcha; /* rw: Scratch Register A */
163 1.9 is
164 1.7 chopps /*38*/ volatile unsigned char siop_dcntl; /* rw: DMA Control reg */
165 1.7 chopps /*39*/ volatile unsigned char siop_dwt; /* rw: DMA Watchdog Timer */
166 1.7 chopps /*3a*/ volatile unsigned char siop_dien; /* rw: DMA Interrupt Enable */
167 1.7 chopps /*3b*/ volatile unsigned char siop_dmode; /* rw: DMA Mode reg */
168 1.9 is
169 1.7 chopps /*3c*/ volatile unsigned long siop_adder;
170 1.1 mw
171 1.9 is /*40*/ volatile unsigned short siop_sist; /* rw: SCSI Interrupt Status */
172 1.9 is #define SIOP_SIST_STO 0x0400 /* timeout (select) */
173 1.9 is #define SIOP_SIST_GEN 0x0200 /* timeout (general) */
174 1.9 is #define SIOP_SIST_MA 0x0080 /* phase mispatch */
175 1.9 is #define SIOP_SIST_SGE 0x0008 /* gross error (over/underflow) */
176 1.9 is #define SIOP_SIST_UDC 0x0004 /* unexpected disconnect */
177 1.9 is #define SIOP_SIST_PAR 0x0001 /* scsi parity error */
178 1.9 is /*42*/ volatile unsigned short siop_sien; /* rw: SCSI Interrupt Enable */
179 1.9 is #define SIOP_SIEN_STO 0x0400 /* timeout (select) */
180 1.9 is #define SIOP_SIEN_GEN 0x0200 /* timeout (general) */
181 1.9 is #define SIOP_SIEN_MA 0x0080 /* phase mispatch */
182 1.9 is #define SIOP_SIEN_SGE 0x0008 /* gross error (over/underflow) */
183 1.9 is #define SIOP_SIEN_UDC 0x0004 /* unexpected disconnect */
184 1.9 is #define SIOP_SIEN_RST 0x0002 /* scsi bus reset */
185 1.9 is #define SIOP_SIEN_PAR 0x0001 /* scsi parity error */
186 1.9 is
187 1.9 is /*44*/ volatile unsigned char siop_gpcntl; /* rw: SCSI */
188 1.9 is /*45*/ volatile unsigned char siop_macntl; /* rw: SCSI */
189 1.9 is /*46*/ volatile unsigned char siop_swide; /* rw: SCSI */
190 1.9 is /*47*/ volatile unsigned char siop_slpar; /* rw: SCSI */
191 1.9 is
192 1.9 is /*48*/ volatile unsigned short siop_respid; /* rw: SCSI Reselect-IDS */
193 1.9 is /*4a*/ volatile unsigned char siop_stime1; /* rw: SCSI */
194 1.9 is /*4b*/ volatile unsigned char siop_stime0; /* rw: SCSI */
195 1.9 is
196 1.9 is /*4c*/ volatile unsigned char siop_stest3; /* ro: Chip test register 3 */
197 1.9 is /*4d*/ volatile unsigned char siop_stest2; /* ro: Chip test register 2 */
198 1.9 is /*4e*/ volatile unsigned char siop_stest1; /* ro: Chip test register 1 */
199 1.9 is /*4f*/ volatile unsigned char siop_stest0; /* ro: Chip test register 0 */
200 1.9 is
201 1.9 is /*50*/ volatile unsigned char siop_50_; /* rw: SCSI */
202 1.9 is /*51*/ volatile unsigned char siop_stest4; /* rw: SCSI */
203 1.9 is /*52*/ volatile unsigned short siop_sidl; /* ro: SCSI Input Data Latch */
204 1.9 is
205 1.9 is /*54*/ volatile unsigned short siop_54_; /* rw: SCSI */
206 1.9 is /*56*/ volatile unsigned short siop_sodl; /* rw: SCSI Output Data Latch */
207 1.9 is
208 1.9 is /*58*/ volatile unsigned short siop_58_; /* rw: SCSI */
209 1.9 is /*5a*/ volatile unsigned short siop_sbdl; /* ro: SCSI Bus Data Lines */
210 1.9 is
211 1.9 is /*5c*/ volatile unsigned long siop_scratchb; /* rw: Scratch Register B */
212 1.9 is #endif
213 1.9 is
214 1.1 mw } siop_regmap_t;
215 1.4 chopps typedef volatile siop_regmap_t *siop_regmap_p;
216 1.1 mw
217 1.1 mw /*
218 1.1 mw * Register defines
219 1.1 mw */
220 1.1 mw
221 1.1 mw /* Scsi control register 0 (scntl0) */
222 1.1 mw
223 1.1 mw #define SIOP_SCNTL0_ARB 0xc0 /* Arbitration mode */
224 1.1 mw # define SIOP_ARB_SIMPLE 0x00
225 1.1 mw # define SIOP_ARB_FULL 0xc0
226 1.1 mw #define SIOP_SCNTL0_START 0x20 /* Start Sequence */
227 1.1 mw #define SIOP_SCNTL0_WATN 0x10 /* (Select) With ATN */
228 1.1 mw #define SIOP_SCNTL0_EPC 0x08 /* Enable Parity Checking */
229 1.1 mw #define SIOP_SCNTL0_EPG 0x04 /* Enable Parity Generation */
230 1.1 mw #define SIOP_SCNTL0_AAP 0x02 /* Assert ATN on Parity Error */
231 1.1 mw #define SIOP_SCNTL0_TRG 0x01 /* Target Mode */
232 1.1 mw
233 1.1 mw /* Scsi control register 1 (scntl1) */
234 1.1 mw
235 1.1 mw #define SIOP_SCNTL1_EXC 0x80 /* Extra Clock Cycle of data setup */
236 1.1 mw #define SIOP_SCNTL1_ADB 0x40 /* Assert Data Bus */
237 1.1 mw #define SIOP_SCNTL1_ESR 0x20 /* Enable Selection/Reselection */
238 1.1 mw #define SIOP_SCNTL1_CON 0x10 /* Connected */
239 1.1 mw #define SIOP_SCNTL1_RST 0x08 /* Assert RST */
240 1.6 chopps #define SIOP_SCNTL1_AESP 0x04 /* Assert even SCSI parity */
241 1.6 chopps #define SIOP_SCNTL1_RES0 0x02 /* Reserved */
242 1.6 chopps #define SIOP_SCNTL1_RES1 0x01 /* Reserved */
243 1.1 mw
244 1.1 mw /* Scsi interrupt enable register (sien) */
245 1.1 mw
246 1.9 is #ifndef ARCH_720
247 1.1 mw #define SIOP_SIEN_M_A 0x80 /* Phase Mismatch or ATN active */
248 1.6 chopps #define SIOP_SIEN_FCMP 0x40 /* Function Complete */
249 1.1 mw #define SIOP_SIEN_STO 0x20 /* (Re)Selection timeout */
250 1.1 mw #define SIOP_SIEN_SEL 0x10 /* (Re)Selected */
251 1.1 mw #define SIOP_SIEN_SGE 0x08 /* SCSI Gross Error */
252 1.1 mw #define SIOP_SIEN_UDC 0x04 /* Unexpected Disconnect */
253 1.1 mw #define SIOP_SIEN_RST 0x02 /* RST asserted */
254 1.1 mw #define SIOP_SIEN_PAR 0x01 /* Parity Error */
255 1.9 is #endif
256 1.1 mw
257 1.1 mw /* Scsi chip ID (scid) */
258 1.1 mw
259 1.1 mw #define SIOP_SCID_VALUE(i) (1<<i)
260 1.1 mw
261 1.1 mw /* Scsi transfer register (sxfer) */
262 1.1 mw
263 1.1 mw #define SIOP_SXFER_DHP 0x80 /* Disable Halt on Parity error/ ATN asserted */
264 1.1 mw #define SIOP_SXFER_TP 0x70 /* Synch Transfer Period */
265 1.1 mw /* see specs for formulas:
266 1.1 mw Period = TCP * (4 + XFERP )
267 1.1 mw TCP = 1 + CLK + 1..2;
268 1.1 mw */
269 1.9 is #ifndef ARCH_720
270 1.1 mw #define SIOP_SXFER_MO 0x0f /* Synch Max Offset */
271 1.1 mw # define SIOP_MAX_OFFSET 8
272 1.9 is #else
273 1.9 is #define SIOP_SXFER_MO 0x1f /* Synch Max Offset */
274 1.9 is # define SIOP_MAX_OFFSET 16
275 1.9 is #endif
276 1.1 mw
277 1.1 mw /* Scsi output data latch register (sodl) */
278 1.1 mw
279 1.1 mw /* Scsi output control latch register (socl) */
280 1.1 mw
281 1.1 mw #define SIOP_REQ 0x80 /* SCSI signal <x> asserted */
282 1.1 mw #define SIOP_ACK 0x40
283 1.1 mw #define SIOP_BSY 0x20
284 1.1 mw #define SIOP_SEL 0x10
285 1.1 mw #define SIOP_ATN 0x08
286 1.1 mw #define SIOP_MSG 0x04
287 1.1 mw #define SIOP_CD 0x02
288 1.1 mw #define SIOP_IO 0x01
289 1.1 mw
290 1.1 mw #define SIOP_PHASE(socl) SCSI_PHASE(socl)
291 1.1 mw
292 1.1 mw /* Scsi first byte received register (sfbr) */
293 1.1 mw
294 1.1 mw /* Scsi input data latch register (sidl) */
295 1.1 mw
296 1.1 mw /* Scsi bus data lines register (sbdl) */
297 1.1 mw
298 1.1 mw /* Scsi bus control lines register (sbcl). Same as socl */
299 1.1 mw
300 1.1 mw /* DMA status register (dstat) */
301 1.1 mw
302 1.1 mw #define SIOP_DSTAT_DFE 0x80 /* DMA FIFO empty */
303 1.6 chopps #define SIOP_DSTAT_RES 0x40
304 1.6 chopps #define SIOP_DSTAT_BF 0x20 /* Bus fault */
305 1.1 mw #define SIOP_DSTAT_ABRT 0x10 /* Aborted */
306 1.1 mw #define SIOP_DSTAT_SSI 0x08 /* SCRIPT Single Step */
307 1.1 mw #define SIOP_DSTAT_SIR 0x04 /* SCRIPT Interrupt Instruction */
308 1.1 mw #define SIOP_DSTAT_WTD 0x02 /* Watchdog Timeout Detected */
309 1.6 chopps #define SIOP_DSTAT_IID 0x01 /* Invalid Instruction Detected */
310 1.1 mw
311 1.1 mw /* Scsi status register 0 (sstat0) */
312 1.1 mw
313 1.1 mw #define SIOP_SSTAT0_M_A 0x80 /* Phase Mismatch or ATN active */
314 1.6 chopps #define SIOP_SSTAT0_FCMP 0x40 /* Function Complete */
315 1.1 mw #define SIOP_SSTAT0_STO 0x20 /* (Re)Selection timeout */
316 1.1 mw #define SIOP_SSTAT0_SEL 0x10 /* (Re)Selected */
317 1.1 mw #define SIOP_SSTAT0_SGE 0x08 /* SCSI Gross Error */
318 1.1 mw #define SIOP_SSTAT0_UDC 0x04 /* Unexpected Disconnect */
319 1.1 mw #define SIOP_SSTAT0_RST 0x02 /* RST asserted */
320 1.1 mw #define SIOP_SSTAT0_PAR 0x01 /* Parity Error */
321 1.1 mw
322 1.1 mw /* Scsi status register 1 (sstat1) */
323 1.1 mw
324 1.1 mw #define SIOP_SSTAT1_ILF 0x80 /* Input latch (sidl) full */
325 1.1 mw #define SIOP_SSTAT1_ORF 0x40 /* output reg (sodr) full */
326 1.1 mw #define SIOP_SSTAT1_OLF 0x20 /* output latch (sodl) full */
327 1.1 mw #define SIOP_SSTAT1_AIP 0x10 /* Arbitration in progress */
328 1.1 mw #define SIOP_SSTAT1_LOA 0x08 /* Lost arbitration */
329 1.1 mw #define SIOP_SSTAT1_WOA 0x04 /* Won arbitration */
330 1.1 mw #define SIOP_SSTAT1_RST 0x02 /* SCSI RST current value */
331 1.1 mw #define SIOP_SSTAT1_SDP 0x01 /* SCSI SDP current value */
332 1.1 mw
333 1.1 mw /* Scsi status register 2 (sstat2) */
334 1.1 mw
335 1.1 mw #define SIOP_SSTAT2_FF 0xf0 /* SCSI FIFO flags (bytecount) */
336 1.1 mw # define SIOP_SCSI_FIFO_DEEP 8
337 1.1 mw #define SIOP_SSTAT2_SDP 0x08 /* Latched (on REQ) SCSI SDP */
338 1.1 mw #define SIOP_SSTAT2_MSG 0x04 /* Latched SCSI phase */
339 1.1 mw #define SIOP_SSTAT2_CD 0x02
340 1.1 mw #define SIOP_SSTAT2_IO 0x01
341 1.1 mw
342 1.1 mw /* Chip test register 0 (ctest0) */
343 1.1 mw
344 1.6 chopps #define SIOP_CTEST0_RES0 0x80
345 1.6 chopps #define SIOP_CTEST0_BTD 0x40 /* Byte-to-byte Timer Disable */
346 1.6 chopps #define SIOP_CTEST0_GRP 0x20 /* Generate Receive Parity for Passthrough */
347 1.6 chopps #define SIOP_CTEST0_EAN 0x10 /* Enable Active Negation */
348 1.6 chopps #define SIOP_CTEST0_HSC 0x08 /* Halt SCSI clock */
349 1.6 chopps #define SIOP_CTEST0_ERF 0x04 /* Extend REQ/ACK Filtering */
350 1.6 chopps #define SIOP_CTEST0_RES1 0x02
351 1.1 mw #define SIOP_CTEST0_DDIR 0x01 /* Xfer direction (1-> from SCSI bus) */
352 1.1 mw
353 1.1 mw /* Chip test register 1 (ctest1) */
354 1.1 mw
355 1.1 mw #define SIOP_CTEST1_FMT 0xf0 /* Byte empty in DMA FIFO bottom (high->byte3) */
356 1.1 mw #define SIOP_CTEST1_FFL 0x0f /* Byte full in DMA FIFO top, same */
357 1.1 mw
358 1.1 mw /* Chip test register 2 (ctest2) */
359 1.1 mw
360 1.6 chopps #define SIOP_CTEST2_RES 0x80
361 1.6 chopps #define SIOP_CTEST2_SIGP 0x40 /* Signal process */
362 1.1 mw #define SIOP_CTEST2_SOFF 0x20 /* Synch Offset compare (1-> zero Init, max Tgt */
363 1.1 mw #define SIOP_CTEST2_SFP 0x10 /* SCSI FIFO Parity */
364 1.1 mw #define SIOP_CTEST2_DFP 0x08 /* DMA FIFO Parity */
365 1.1 mw #define SIOP_CTEST2_TEOP 0x04 /* True EOP (a-la 5380) */
366 1.1 mw #define SIOP_CTEST2_DREQ 0x02 /* DREQ status */
367 1.1 mw #define SIOP_CTEST2_DACK 0x01 /* DACK status */
368 1.1 mw
369 1.1 mw /* Chip test register 3 (ctest3) read-only, top of SCSI FIFO */
370 1.1 mw
371 1.1 mw /* Chip test register 4 (ctest4) */
372 1.1 mw
373 1.6 chopps #define SIOP_CTEST4_MUX 0x80 /* Host bus multiplex mode */
374 1.1 mw #define SIOP_CTEST4_ZMOD 0x40 /* High-impedance outputs */
375 1.1 mw #define SIOP_CTEST4_SZM 0x20 /* ditto, SCSI "outputs" */
376 1.1 mw #define SIOP_CTEST4_SLBE 0x10 /* SCSI loobpack enable */
377 1.1 mw #define SIOP_CTEST4_SFWR 0x08 /* SCSI FIFO write enable (from sodl) */
378 1.1 mw #define SIOP_CTEST4_FBL 0x07 /* DMA FIFO Byte Lane select (from ctest6)
379 1.1 mw 4->0, .. 7->3 */
380 1.1 mw
381 1.1 mw /* Chip test register 5 (ctest5) */
382 1.1 mw
383 1.1 mw #define SIOP_CTEST5_ADCK 0x80 /* Clock Address Incrementor */
384 1.1 mw #define SIOP_CTEST5_BBCK 0x40 /* Clock Byte counter */
385 1.1 mw #define SIOP_CTEST5_ROFF 0x20 /* Reset SCSI offset */
386 1.1 mw #define SIOP_CTEST5_MASR 0x10 /* Master set/reset pulses (of bits 3-0) */
387 1.1 mw #define SIOP_CTEST5_DDIR 0x08 /* (re)set internal DMA direction */
388 1.1 mw #define SIOP_CTEST5_EOP 0x04 /* (re)set internal EOP */
389 1.1 mw #define SIOP_CTEST5_DREQ 0x02 /* (re)set internal REQ */
390 1.1 mw #define SIOP_CTEST5_DACK 0x01 /* (re)set internal ACK */
391 1.1 mw
392 1.1 mw /* Chip test register 6 (ctest6) DMA FIFO access */
393 1.1 mw
394 1.1 mw /* Chip test register 7 (ctest7) */
395 1.1 mw
396 1.6 chopps #define SIOP_CTEST7_CDIS 0x80 /* Cache burst disable */
397 1.6 chopps #define SIOP_CTEST7_SC1 0x40 /* Snoop control 1 */
398 1.6 chopps #define SIOP_CTEST7_SC0 0x20 /* Snoop contorl 0 */
399 1.6 chopps #define SIOP_CTEST7_STD 0x10 /* Selection timeout disable */
400 1.1 mw #define SIOP_CTEST7_DFP 0x08 /* DMA FIFO parity bit */
401 1.1 mw #define SIOP_CTEST7_EVP 0x04 /* Even parity (to host bus) */
402 1.6 chopps #define SIOP_CTEST7_TT1 0x02 /* Transfer type bit */
403 1.1 mw #define SIOP_CTEST7_DIFF 0x01 /* Differential mode */
404 1.1 mw
405 1.1 mw /* DMA FIFO register (dfifo) */
406 1.1 mw
407 1.6 chopps #define SIOP_DFIFO_RES 0x80
408 1.6 chopps #define SIOP_DFIFO_BO 0x7f /* FIFO byte offset counter */
409 1.1 mw
410 1.1 mw /* Interrupt status register (istat) */
411 1.1 mw
412 1.1 mw #define SIOP_ISTAT_ABRT 0x80 /* Abort operation */
413 1.6 chopps #define SIOP_ISTAT_RST 0x40 /* Software reset */
414 1.6 chopps #define SIOP_ISTAT_SIGP 0x20 /* Signal process */
415 1.6 chopps #define SIOP_ISTAT_RES 0x10
416 1.1 mw #define SIOP_ISTAT_CON 0x08 /* Connected */
417 1.6 chopps #define SIOP_ISTAT_RES1 0x04
418 1.1 mw #define SIOP_ISTAT_SIP 0x02 /* SCSI Interrupt pending */
419 1.1 mw #define SIOP_ISTAT_DIP 0x01 /* DMA Interrupt pending */
420 1.1 mw
421 1.8 veego /* Chip test register 8 (ctest8) */
422 1.6 chopps
423 1.6 chopps #define SIOP_CTEST8_V 0xf0 /* Chip revision level */
424 1.6 chopps #define SIOP_CTEST8_FLF 0x08 /* Flush DMA FIFO */
425 1.6 chopps #define SIOP_CTEST8_CLF 0x04 /* Clear DMA and SCSI FIFOs */
426 1.6 chopps #define SIOP_CTEST8_FM 0x02 /* Fetch pin mode */
427 1.6 chopps #define SIOP_CTEST8_SM 0x01 /* Snoop pins mode */
428 1.1 mw
429 1.1 mw /* DMA Mode register (dmode) */
430 1.1 mw
431 1.1 mw #define SIOP_DMODE_BL_MASK 0xc0 /* 0->1 1->2 2->4 3->8 */
432 1.6 chopps #define SIOP_DMODE_FC 0x30 /* Function code */
433 1.6 chopps #define SIOP_DMODE_PD 0x08 /* Program/data */
434 1.6 chopps #define SIOP_DMODE_FAM 0x04 /* Fixed address mode */
435 1.6 chopps #define SIOP_DMODE_U0 0x02 /* User programmable transfer type */
436 1.6 chopps #define SIOP_DMODE_MAN 0x01 /* Manual start mode */
437 1.1 mw
438 1.1 mw /* DMA interrupt enable register (dien) */
439 1.1 mw
440 1.6 chopps #define SIOP_DIEN_RES 0xc0
441 1.6 chopps #define SIOP_DIEN_BF 0x20 /* On Bus Fault */
442 1.1 mw #define SIOP_DIEN_ABRT 0x10 /* On Abort */
443 1.1 mw #define SIOP_DIEN_SSI 0x08 /* On SCRIPTS sstep */
444 1.1 mw #define SIOP_DIEN_SIR 0x04 /* On SCRIPTS intr instruction */
445 1.1 mw #define SIOP_DIEN_WTD 0x02 /* On watchdog timeout */
446 1.6 chopps #define SIOP_DIEN_IID 0x01 /* On illegal instruction detected */
447 1.1 mw
448 1.1 mw /* DMA control register (dcntl) */
449 1.1 mw
450 1.1 mw #define SIOP_DCNTL_CF_MASK 0xc0 /* Clock frequency dividers:
451 1.1 mw 0 --> 37.51..50.00 Mhz, div=2
452 1.1 mw 1 --> 25.01..37.50 Mhz, div=1.5
453 1.1 mw 2 --> 16.67..25.00 Mhz, div=1
454 1.6 chopps 3 --> 50.01..66.67 Mhz, div=3
455 1.1 mw */
456 1.6 chopps #define SIOP_DCNTL_EA 0x20 /* Enable ack */
457 1.1 mw #define SIOP_DCNTL_SSM 0x10 /* Single step mode */
458 1.6 chopps #define SIOP_DCNTL_LLM 0x08 /* Enable SCSI Low-level mode */
459 1.6 chopps #define SIOP_DCNTL_STD 0x04 /* Start DMA operation */
460 1.6 chopps #define SIOP_DCNTL_FA 0x02 /* Fast arbitration */
461 1.6 chopps #define SIOP_DCNTL_COM 0x01 /* 53C700 compatibility */
462