aic7xxx.reg revision 1.1.6.2 1 1.1.6.2 bouyer /* $NetBSD: aic7xxx.reg,v 1.1.6.2 2000/11/20 11:41:33 bouyer Exp $ */
2 1.1.6.2 bouyer
3 1.1.6.2 bouyer /*
4 1.1.6.2 bouyer * Aic7xxx register and scratch ram definitions.
5 1.1.6.2 bouyer *
6 1.1.6.2 bouyer * Copyright (c) 1994-2000 Justin Gibbs.
7 1.1.6.2 bouyer * All rights reserved.
8 1.1.6.2 bouyer *
9 1.1.6.2 bouyer * Redistribution and use in source and binary forms, with or without
10 1.1.6.2 bouyer * modification, are permitted provided that the following conditions
11 1.1.6.2 bouyer * are met:
12 1.1.6.2 bouyer * 1. Redistributions of source code must retain the above copyright
13 1.1.6.2 bouyer * notice, this list of conditions, and the following disclaimer,
14 1.1.6.2 bouyer * without modification.
15 1.1.6.2 bouyer * 2. The name of the author may not be used to endorse or promote products
16 1.1.6.2 bouyer * derived from this software without specific prior written permission.
17 1.1.6.2 bouyer *
18 1.1.6.2 bouyer * Alternatively, this software may be distributed under the terms of the
19 1.1.6.2 bouyer * the GNU Public License ("GPL").
20 1.1.6.2 bouyer *
21 1.1.6.2 bouyer * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
22 1.1.6.2 bouyer * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 1.1.6.2 bouyer * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 1.1.6.2 bouyer * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
25 1.1.6.2 bouyer * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 1.1.6.2 bouyer * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 1.1.6.2 bouyer * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 1.1.6.2 bouyer * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 1.1.6.2 bouyer * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 1.1.6.2 bouyer * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 1.1.6.2 bouyer * SUCH DAMAGE.
32 1.1.6.2 bouyer *
33 1.1.6.2 bouyer * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx.reg,v 1.20 2000/02/09 21:24:59 gibbs Exp $
34 1.1.6.2 bouyer */
35 1.1.6.2 bouyer
36 1.1.6.2 bouyer /*
37 1.1.6.2 bouyer * This file is processed by the aic7xxx_asm utility for use in assembling
38 1.1.6.2 bouyer * firmware for the aic7xxx family of SCSI host adapters as well as to generate
39 1.1.6.2 bouyer * a C header file for use in the kernel portion of the Aic7xxx driver.
40 1.1.6.2 bouyer *
41 1.1.6.2 bouyer * All page numbers refer to the Adaptec AIC-7770 Data Book available from
42 1.1.6.2 bouyer * Adaptec's Technical Documents Department 1-800-934-2766
43 1.1.6.2 bouyer */
44 1.1.6.2 bouyer
45 1.1.6.2 bouyer /*
46 1.1.6.2 bouyer * SCSI Sequence Control (p. 3-11).
47 1.1.6.2 bouyer * Each bit, when set starts a specific SCSI sequence on the bus
48 1.1.6.2 bouyer */
49 1.1.6.2 bouyer register SCSISEQ {
50 1.1.6.2 bouyer address 0x000
51 1.1.6.2 bouyer access_mode RW
52 1.1.6.2 bouyer bit TEMODE 0x80
53 1.1.6.2 bouyer bit ENSELO 0x40
54 1.1.6.2 bouyer bit ENSELI 0x20
55 1.1.6.2 bouyer bit ENRSELI 0x10
56 1.1.6.2 bouyer bit ENAUTOATNO 0x08
57 1.1.6.2 bouyer bit ENAUTOATNI 0x04
58 1.1.6.2 bouyer bit ENAUTOATNP 0x02
59 1.1.6.2 bouyer bit SCSIRSTO 0x01
60 1.1.6.2 bouyer }
61 1.1.6.2 bouyer
62 1.1.6.2 bouyer /*
63 1.1.6.2 bouyer * SCSI Transfer Control 0 Register (pp. 3-13).
64 1.1.6.2 bouyer * Controls the SCSI module data path.
65 1.1.6.2 bouyer */
66 1.1.6.2 bouyer register SXFRCTL0 {
67 1.1.6.2 bouyer address 0x001
68 1.1.6.2 bouyer access_mode RW
69 1.1.6.2 bouyer bit DFON 0x80
70 1.1.6.2 bouyer bit DFPEXP 0x40
71 1.1.6.2 bouyer bit FAST20 0x20
72 1.1.6.2 bouyer bit CLRSTCNT 0x10
73 1.1.6.2 bouyer bit SPIOEN 0x08
74 1.1.6.2 bouyer bit SCAMEN 0x04
75 1.1.6.2 bouyer bit CLRCHN 0x02
76 1.1.6.2 bouyer }
77 1.1.6.2 bouyer
78 1.1.6.2 bouyer /*
79 1.1.6.2 bouyer * SCSI Transfer Control 1 Register (pp. 3-14,15).
80 1.1.6.2 bouyer * Controls the SCSI module data path.
81 1.1.6.2 bouyer */
82 1.1.6.2 bouyer register SXFRCTL1 {
83 1.1.6.2 bouyer address 0x002
84 1.1.6.2 bouyer access_mode RW
85 1.1.6.2 bouyer bit BITBUCKET 0x80
86 1.1.6.2 bouyer bit SWRAPEN 0x40
87 1.1.6.2 bouyer bit ENSPCHK 0x20
88 1.1.6.2 bouyer mask STIMESEL 0x18
89 1.1.6.2 bouyer bit ENSTIMER 0x04
90 1.1.6.2 bouyer bit ACTNEGEN 0x02
91 1.1.6.2 bouyer bit STPWEN 0x01 /* Powered Termination */
92 1.1.6.2 bouyer }
93 1.1.6.2 bouyer
94 1.1.6.2 bouyer /*
95 1.1.6.2 bouyer * SCSI Control Signal Read Register (p. 3-15).
96 1.1.6.2 bouyer * Reads the actual state of the SCSI bus pins
97 1.1.6.2 bouyer */
98 1.1.6.2 bouyer register SCSISIGI {
99 1.1.6.2 bouyer address 0x003
100 1.1.6.2 bouyer access_mode RO
101 1.1.6.2 bouyer bit CDI 0x80
102 1.1.6.2 bouyer bit IOI 0x40
103 1.1.6.2 bouyer bit MSGI 0x20
104 1.1.6.2 bouyer bit ATNI 0x10
105 1.1.6.2 bouyer bit SELI 0x08
106 1.1.6.2 bouyer bit BSYI 0x04
107 1.1.6.2 bouyer bit REQI 0x02
108 1.1.6.2 bouyer bit ACKI 0x01
109 1.1.6.2 bouyer /*
110 1.1.6.2 bouyer * Possible phases in SCSISIGI
111 1.1.6.2 bouyer */
112 1.1.6.2 bouyer mask PHASE_MASK CDI|IOI|MSGI
113 1.1.6.2 bouyer mask P_DATAOUT 0x00
114 1.1.6.2 bouyer mask P_DATAIN IOI
115 1.1.6.2 bouyer mask P_COMMAND CDI
116 1.1.6.2 bouyer mask P_MESGOUT CDI|MSGI
117 1.1.6.2 bouyer mask P_STATUS CDI|IOI
118 1.1.6.2 bouyer mask P_MESGIN CDI|IOI|MSGI
119 1.1.6.2 bouyer }
120 1.1.6.2 bouyer
121 1.1.6.2 bouyer /*
122 1.1.6.2 bouyer * SCSI Control Signal Write Register (p. 3-16).
123 1.1.6.2 bouyer * Writing to this register modifies the control signals on the bus. Only
124 1.1.6.2 bouyer * those signals that are allowed in the current mode (Initiator/Target) are
125 1.1.6.2 bouyer * asserted.
126 1.1.6.2 bouyer */
127 1.1.6.2 bouyer register SCSISIGO {
128 1.1.6.2 bouyer address 0x003
129 1.1.6.2 bouyer access_mode WO
130 1.1.6.2 bouyer bit CDO 0x80
131 1.1.6.2 bouyer bit IOO 0x40
132 1.1.6.2 bouyer bit MSGO 0x20
133 1.1.6.2 bouyer bit ATNO 0x10
134 1.1.6.2 bouyer bit SELO 0x08
135 1.1.6.2 bouyer bit BSYO 0x04
136 1.1.6.2 bouyer bit REQO 0x02
137 1.1.6.2 bouyer bit ACKO 0x01
138 1.1.6.2 bouyer /*
139 1.1.6.2 bouyer * Possible phases to write into SCSISIG0
140 1.1.6.2 bouyer */
141 1.1.6.2 bouyer mask PHASE_MASK CDI|IOI|MSGI
142 1.1.6.2 bouyer mask P_DATAOUT 0x00
143 1.1.6.2 bouyer mask P_DATAIN IOI
144 1.1.6.2 bouyer mask P_COMMAND CDI
145 1.1.6.2 bouyer mask P_MESGOUT CDI|MSGI
146 1.1.6.2 bouyer mask P_STATUS CDI|IOI
147 1.1.6.2 bouyer mask P_MESGIN CDI|IOI|MSGI
148 1.1.6.2 bouyer }
149 1.1.6.2 bouyer
150 1.1.6.2 bouyer /*
151 1.1.6.2 bouyer * SCSI Rate Control (p. 3-17).
152 1.1.6.2 bouyer * Contents of this register determine the Synchronous SCSI data transfer
153 1.1.6.2 bouyer * rate and the maximum synchronous Req/Ack offset. An offset of 0 in the
154 1.1.6.2 bouyer * SOFS (3:0) bits disables synchronous data transfers. Any offset value
155 1.1.6.2 bouyer * greater than 0 enables synchronous transfers.
156 1.1.6.2 bouyer */
157 1.1.6.2 bouyer register SCSIRATE {
158 1.1.6.2 bouyer address 0x004
159 1.1.6.2 bouyer access_mode RW
160 1.1.6.2 bouyer bit WIDEXFER 0x80 /* Wide transfer control */
161 1.1.6.2 bouyer bit ENABLE_CRC 0x40 /* CRC for D-Phases */
162 1.1.6.2 bouyer bit SINGLE_EDGE 0x10 /* Disable DT Transfers */
163 1.1.6.2 bouyer mask SXFR 0x70 /* Sync transfer rate */
164 1.1.6.2 bouyer mask SXFR_ULTRA2 0x0f /* Sync transfer rate */
165 1.1.6.2 bouyer mask SOFS 0x0f /* Sync offset */
166 1.1.6.2 bouyer }
167 1.1.6.2 bouyer
168 1.1.6.2 bouyer /*
169 1.1.6.2 bouyer * SCSI ID (p. 3-18).
170 1.1.6.2 bouyer * Contains the ID of the board and the current target on the
171 1.1.6.2 bouyer * selected channel.
172 1.1.6.2 bouyer */
173 1.1.6.2 bouyer register SCSIID {
174 1.1.6.2 bouyer address 0x005
175 1.1.6.2 bouyer access_mode RW
176 1.1.6.2 bouyer mask TID 0xf0 /* Target ID mask */
177 1.1.6.2 bouyer mask OID 0x0f /* Our ID mask */
178 1.1.6.2 bouyer /*
179 1.1.6.2 bouyer * SCSI Maximum Offset (p. 4-61 aic7890/91 Data Book)
180 1.1.6.2 bouyer * The aic7890/91 allow an offset of up to 127 transfers in both wide
181 1.1.6.2 bouyer * and narrow mode.
182 1.1.6.2 bouyer */
183 1.1.6.2 bouyer alias SCSIOFFSET
184 1.1.6.2 bouyer mask SOFS_ULTRA2 0x7f /* Sync offset U2 chips */
185 1.1.6.2 bouyer }
186 1.1.6.2 bouyer
187 1.1.6.2 bouyer /*
188 1.1.6.2 bouyer * SCSI Latched Data (p. 3-19).
189 1.1.6.2 bouyer * Read/Write latches used to transfer data on the SCSI bus during
190 1.1.6.2 bouyer * Automatic or Manual PIO mode. SCSIDATH can be used for the
191 1.1.6.2 bouyer * upper byte of a 16bit wide asynchronouse data phase transfer.
192 1.1.6.2 bouyer */
193 1.1.6.2 bouyer register SCSIDATL {
194 1.1.6.2 bouyer address 0x006
195 1.1.6.2 bouyer access_mode RW
196 1.1.6.2 bouyer }
197 1.1.6.2 bouyer
198 1.1.6.2 bouyer register SCSIDATH {
199 1.1.6.2 bouyer address 0x007
200 1.1.6.2 bouyer access_mode RW
201 1.1.6.2 bouyer }
202 1.1.6.2 bouyer
203 1.1.6.2 bouyer /*
204 1.1.6.2 bouyer * SCSI Transfer Count (pp. 3-19,20)
205 1.1.6.2 bouyer * These registers count down the number of bytes transferred
206 1.1.6.2 bouyer * across the SCSI bus. The counter is decremented only once
207 1.1.6.2 bouyer * the data has been safely transferred. SDONE in SSTAT0 is
208 1.1.6.2 bouyer * set when STCNT goes to 0
209 1.1.6.2 bouyer */
210 1.1.6.2 bouyer register STCNT {
211 1.1.6.2 bouyer address 0x008
212 1.1.6.2 bouyer size 3
213 1.1.6.2 bouyer access_mode RW
214 1.1.6.2 bouyer }
215 1.1.6.2 bouyer
216 1.1.6.2 bouyer /* ALT_MODE register on Ultra160 chips */
217 1.1.6.2 bouyer register OPTIONMODE {
218 1.1.6.2 bouyer address 0x008
219 1.1.6.2 bouyer access_mode RW
220 1.1.6.2 bouyer bit AUTORATEEN 0x80
221 1.1.6.2 bouyer bit AUTOACKEN 0x40
222 1.1.6.2 bouyer bit ATNMGMNTEN 0x20
223 1.1.6.2 bouyer bit BUSFREEREV 0x10
224 1.1.6.2 bouyer bit EXPPHASEDIS 0x08
225 1.1.6.2 bouyer bit SCSIDATL_IMGEN 0x04
226 1.1.6.2 bouyer bit AUTO_MSGOUT_DE 0x02
227 1.1.6.2 bouyer bit DIS_MSGIN_DUALEDGE 0x01
228 1.1.6.2 bouyer mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE|DIS_MSGIN_DUALEDGE
229 1.1.6.2 bouyer }
230 1.1.6.2 bouyer
231 1.1.6.2 bouyer /* ALT_MODE register on Ultra160 chips */
232 1.1.6.2 bouyer register TARGCRCCNT {
233 1.1.6.2 bouyer address 0x00a
234 1.1.6.2 bouyer size 2
235 1.1.6.2 bouyer access_mode RW
236 1.1.6.2 bouyer }
237 1.1.6.2 bouyer
238 1.1.6.2 bouyer /*
239 1.1.6.2 bouyer * Clear SCSI Interrupt 0 (p. 3-20)
240 1.1.6.2 bouyer * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
241 1.1.6.2 bouyer */
242 1.1.6.2 bouyer register CLRSINT0 {
243 1.1.6.2 bouyer address 0x00b
244 1.1.6.2 bouyer access_mode WO
245 1.1.6.2 bouyer bit CLRSELDO 0x40
246 1.1.6.2 bouyer bit CLRSELDI 0x20
247 1.1.6.2 bouyer bit CLRSELINGO 0x10
248 1.1.6.2 bouyer bit CLRSWRAP 0x08
249 1.1.6.2 bouyer bit CLRSPIORDY 0x02
250 1.1.6.2 bouyer }
251 1.1.6.2 bouyer
252 1.1.6.2 bouyer /*
253 1.1.6.2 bouyer * SCSI Status 0 (p. 3-21)
254 1.1.6.2 bouyer * Contains one set of SCSI Interrupt codes
255 1.1.6.2 bouyer * These are most likely of interest to the sequencer
256 1.1.6.2 bouyer */
257 1.1.6.2 bouyer register SSTAT0 {
258 1.1.6.2 bouyer address 0x00b
259 1.1.6.2 bouyer access_mode RO
260 1.1.6.2 bouyer bit TARGET 0x80 /* Board acting as target */
261 1.1.6.2 bouyer bit SELDO 0x40 /* Selection Done */
262 1.1.6.2 bouyer bit SELDI 0x20 /* Board has been selected */
263 1.1.6.2 bouyer bit SELINGO 0x10 /* Selection In Progress */
264 1.1.6.2 bouyer bit SWRAP 0x08 /* 24bit counter wrap */
265 1.1.6.2 bouyer bit IOERR 0x08 /* LVD Tranceiver mode changed */
266 1.1.6.2 bouyer bit SDONE 0x04 /* STCNT = 0x000000 */
267 1.1.6.2 bouyer bit SPIORDY 0x02 /* SCSI PIO Ready */
268 1.1.6.2 bouyer bit DMADONE 0x01 /* DMA transfer completed */
269 1.1.6.2 bouyer }
270 1.1.6.2 bouyer
271 1.1.6.2 bouyer /*
272 1.1.6.2 bouyer * Clear SCSI Interrupt 1 (p. 3-23)
273 1.1.6.2 bouyer * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
274 1.1.6.2 bouyer */
275 1.1.6.2 bouyer register CLRSINT1 {
276 1.1.6.2 bouyer address 0x00c
277 1.1.6.2 bouyer access_mode WO
278 1.1.6.2 bouyer bit CLRSELTIMEO 0x80
279 1.1.6.2 bouyer bit CLRATNO 0x40
280 1.1.6.2 bouyer bit CLRSCSIRSTI 0x20
281 1.1.6.2 bouyer bit CLRBUSFREE 0x08
282 1.1.6.2 bouyer bit CLRSCSIPERR 0x04
283 1.1.6.2 bouyer bit CLRPHASECHG 0x02
284 1.1.6.2 bouyer bit CLRREQINIT 0x01
285 1.1.6.2 bouyer }
286 1.1.6.2 bouyer
287 1.1.6.2 bouyer /*
288 1.1.6.2 bouyer * SCSI Status 1 (p. 3-24)
289 1.1.6.2 bouyer */
290 1.1.6.2 bouyer register SSTAT1 {
291 1.1.6.2 bouyer address 0x00c
292 1.1.6.2 bouyer access_mode RO
293 1.1.6.2 bouyer bit SELTO 0x80
294 1.1.6.2 bouyer bit ATNTARG 0x40
295 1.1.6.2 bouyer bit SCSIRSTI 0x20
296 1.1.6.2 bouyer bit PHASEMIS 0x10
297 1.1.6.2 bouyer bit BUSFREE 0x08
298 1.1.6.2 bouyer bit SCSIPERR 0x04
299 1.1.6.2 bouyer bit PHASECHG 0x02
300 1.1.6.2 bouyer bit REQINIT 0x01
301 1.1.6.2 bouyer }
302 1.1.6.2 bouyer
303 1.1.6.2 bouyer /*
304 1.1.6.2 bouyer * SCSI Status 2 (pp. 3-25,26)
305 1.1.6.2 bouyer */
306 1.1.6.2 bouyer register SSTAT2 {
307 1.1.6.2 bouyer address 0x00d
308 1.1.6.2 bouyer access_mode RO
309 1.1.6.2 bouyer bit OVERRUN 0x80
310 1.1.6.2 bouyer bit EXP_ACTIVE 0x10 /* SCSI Expander Active */
311 1.1.6.2 bouyer mask SFCNT 0x1f
312 1.1.6.2 bouyer }
313 1.1.6.2 bouyer
314 1.1.6.2 bouyer /*
315 1.1.6.2 bouyer * SCSI Status 3 (p. 3-26)
316 1.1.6.2 bouyer */
317 1.1.6.2 bouyer register SSTAT3 {
318 1.1.6.2 bouyer address 0x00e
319 1.1.6.2 bouyer access_mode RO
320 1.1.6.2 bouyer mask SCSICNT 0xf0
321 1.1.6.2 bouyer mask OFFCNT 0x0f
322 1.1.6.2 bouyer }
323 1.1.6.2 bouyer
324 1.1.6.2 bouyer /*
325 1.1.6.2 bouyer * SCSI ID for the aic7890/91 chips
326 1.1.6.2 bouyer */
327 1.1.6.2 bouyer register SCSIID_ULTRA2 {
328 1.1.6.2 bouyer address 0x00f
329 1.1.6.2 bouyer access_mode RW
330 1.1.6.2 bouyer mask TID 0xf0 /* Target ID mask */
331 1.1.6.2 bouyer mask OID 0x0f /* Our ID mask */
332 1.1.6.2 bouyer }
333 1.1.6.2 bouyer
334 1.1.6.2 bouyer /*
335 1.1.6.2 bouyer * SCSI Interrupt Mode 1 (p. 3-28)
336 1.1.6.2 bouyer * Setting any bit will enable the corresponding function
337 1.1.6.2 bouyer * in SIMODE0 to interrupt via the IRQ pin.
338 1.1.6.2 bouyer */
339 1.1.6.2 bouyer register SIMODE0 {
340 1.1.6.2 bouyer address 0x010
341 1.1.6.2 bouyer access_mode RW
342 1.1.6.2 bouyer bit ENSELDO 0x40
343 1.1.6.2 bouyer bit ENSELDI 0x20
344 1.1.6.2 bouyer bit ENSELINGO 0x10
345 1.1.6.2 bouyer bit ENSWRAP 0x08
346 1.1.6.2 bouyer bit ENIOERR 0x08 /* LVD Tranceiver mode changes */
347 1.1.6.2 bouyer bit ENSDONE 0x04
348 1.1.6.2 bouyer bit ENSPIORDY 0x02
349 1.1.6.2 bouyer bit ENDMADONE 0x01
350 1.1.6.2 bouyer }
351 1.1.6.2 bouyer
352 1.1.6.2 bouyer /*
353 1.1.6.2 bouyer * SCSI Interrupt Mode 1 (pp. 3-28,29)
354 1.1.6.2 bouyer * Setting any bit will enable the corresponding function
355 1.1.6.2 bouyer * in SIMODE1 to interrupt via the IRQ pin.
356 1.1.6.2 bouyer */
357 1.1.6.2 bouyer register SIMODE1 {
358 1.1.6.2 bouyer address 0x011
359 1.1.6.2 bouyer access_mode RW
360 1.1.6.2 bouyer bit ENSELTIMO 0x80
361 1.1.6.2 bouyer bit ENATNTARG 0x40
362 1.1.6.2 bouyer bit ENSCSIRST 0x20
363 1.1.6.2 bouyer bit ENPHASEMIS 0x10
364 1.1.6.2 bouyer bit ENBUSFREE 0x08
365 1.1.6.2 bouyer bit ENSCSIPERR 0x04
366 1.1.6.2 bouyer bit ENPHASECHG 0x02
367 1.1.6.2 bouyer bit ENREQINIT 0x01
368 1.1.6.2 bouyer }
369 1.1.6.2 bouyer
370 1.1.6.2 bouyer /*
371 1.1.6.2 bouyer * SCSI Data Bus (High) (p. 3-29)
372 1.1.6.2 bouyer * This register reads data on the SCSI Data bus directly.
373 1.1.6.2 bouyer */
374 1.1.6.2 bouyer register SCSIBUSL {
375 1.1.6.2 bouyer address 0x012
376 1.1.6.2 bouyer access_mode RO
377 1.1.6.2 bouyer }
378 1.1.6.2 bouyer
379 1.1.6.2 bouyer register SCSIBUSH {
380 1.1.6.2 bouyer address 0x013
381 1.1.6.2 bouyer access_mode RO
382 1.1.6.2 bouyer }
383 1.1.6.2 bouyer
384 1.1.6.2 bouyer /*
385 1.1.6.2 bouyer * SCSI/Host Address (p. 3-30)
386 1.1.6.2 bouyer * These registers hold the host address for the byte about to be
387 1.1.6.2 bouyer * transferred on the SCSI bus. They are counted up in the same
388 1.1.6.2 bouyer * manner as STCNT is counted down. SHADDR should always be used
389 1.1.6.2 bouyer * to determine the address of the last byte transferred since HADDR
390 1.1.6.2 bouyer * can be skewed by write ahead.
391 1.1.6.2 bouyer */
392 1.1.6.2 bouyer register SHADDR {
393 1.1.6.2 bouyer address 0x014
394 1.1.6.2 bouyer size 4
395 1.1.6.2 bouyer access_mode RO
396 1.1.6.2 bouyer }
397 1.1.6.2 bouyer
398 1.1.6.2 bouyer /*
399 1.1.6.2 bouyer * Selection Timeout Timer (p. 3-30)
400 1.1.6.2 bouyer */
401 1.1.6.2 bouyer register SELTIMER {
402 1.1.6.2 bouyer address 0x018
403 1.1.6.2 bouyer access_mode RW
404 1.1.6.2 bouyer bit STAGE6 0x20
405 1.1.6.2 bouyer bit STAGE5 0x10
406 1.1.6.2 bouyer bit STAGE4 0x08
407 1.1.6.2 bouyer bit STAGE3 0x04
408 1.1.6.2 bouyer bit STAGE2 0x02
409 1.1.6.2 bouyer bit STAGE1 0x01
410 1.1.6.2 bouyer alias TARGIDIN
411 1.1.6.2 bouyer }
412 1.1.6.2 bouyer
413 1.1.6.2 bouyer /*
414 1.1.6.2 bouyer * Selection/Reselection ID (p. 3-31)
415 1.1.6.2 bouyer * Upper four bits are the device id. The ONEBIT is set when the re/selecting
416 1.1.6.2 bouyer * device did not set its own ID.
417 1.1.6.2 bouyer */
418 1.1.6.2 bouyer register SELID {
419 1.1.6.2 bouyer address 0x019
420 1.1.6.2 bouyer access_mode RW
421 1.1.6.2 bouyer mask SELID_MASK 0xf0
422 1.1.6.2 bouyer bit ONEBIT 0x08
423 1.1.6.2 bouyer }
424 1.1.6.2 bouyer
425 1.1.6.2 bouyer register SCAMCTL {
426 1.1.6.2 bouyer address 0x01a
427 1.1.6.2 bouyer access_mode RW
428 1.1.6.2 bouyer bit ENSCAMSELO 0x80
429 1.1.6.2 bouyer bit CLRSCAMSELID 0x40
430 1.1.6.2 bouyer bit ALTSTIM 0x20
431 1.1.6.2 bouyer bit DFLTTID 0x10
432 1.1.6.2 bouyer mask SCAMLVL 0x03
433 1.1.6.2 bouyer }
434 1.1.6.2 bouyer
435 1.1.6.2 bouyer /*
436 1.1.6.2 bouyer * Target Mode Selecting in ID bitmask (aic7890/91/96/97)
437 1.1.6.2 bouyer */
438 1.1.6.2 bouyer register TARGID {
439 1.1.6.2 bouyer address 0x01b
440 1.1.6.2 bouyer size 2
441 1.1.6.2 bouyer access_mode RW
442 1.1.6.2 bouyer }
443 1.1.6.2 bouyer
444 1.1.6.2 bouyer /*
445 1.1.6.2 bouyer * Serial Port I/O Cabability register (p. 4-95 aic7860 Data Book)
446 1.1.6.2 bouyer * Indicates if external logic has been attached to the chip to
447 1.1.6.2 bouyer * perform the tasks of accessing a serial eeprom, testing termination
448 1.1.6.2 bouyer * strength, and performing cable detection. On the aic7860, most of
449 1.1.6.2 bouyer * these features are handled on chip, but on the aic7855 an attached
450 1.1.6.2 bouyer * aic3800 does the grunt work.
451 1.1.6.2 bouyer */
452 1.1.6.2 bouyer register SPIOCAP {
453 1.1.6.2 bouyer address 0x01b
454 1.1.6.2 bouyer access_mode RW
455 1.1.6.2 bouyer bit SOFT1 0x80
456 1.1.6.2 bouyer bit SOFT0 0x40
457 1.1.6.2 bouyer bit SOFTCMDEN 0x20
458 1.1.6.2 bouyer bit HAS_BRDCTL 0x10 /* External Board control */
459 1.1.6.2 bouyer bit SEEPROM 0x08 /* External serial eeprom logic */
460 1.1.6.2 bouyer bit EEPROM 0x04 /* Writable external BIOS ROM */
461 1.1.6.2 bouyer bit ROM 0x02 /* Logic for accessing external ROM */
462 1.1.6.2 bouyer bit SSPIOCPS 0x01 /* Termination and cable detection */
463 1.1.6.2 bouyer }
464 1.1.6.2 bouyer
465 1.1.6.2 bouyer register BRDCTL {
466 1.1.6.2 bouyer address 0x01d
467 1.1.6.2 bouyer bit BRDDAT7 0x80
468 1.1.6.2 bouyer bit BRDDAT6 0x40
469 1.1.6.2 bouyer bit BRDDAT5 0x20
470 1.1.6.2 bouyer bit BRDSTB 0x10
471 1.1.6.2 bouyer bit BRDCS 0x08
472 1.1.6.2 bouyer bit BRDRW 0x04
473 1.1.6.2 bouyer bit BRDCTL1 0x02
474 1.1.6.2 bouyer bit BRDCTL0 0x01
475 1.1.6.2 bouyer /* 7890 Definitions */
476 1.1.6.2 bouyer bit BRDDAT4 0x10
477 1.1.6.2 bouyer bit BRDDAT3 0x08
478 1.1.6.2 bouyer bit BRDDAT2 0x04
479 1.1.6.2 bouyer bit BRDRW_ULTRA2 0x02
480 1.1.6.2 bouyer bit BRDSTB_ULTRA2 0x01
481 1.1.6.2 bouyer }
482 1.1.6.2 bouyer
483 1.1.6.2 bouyer /*
484 1.1.6.2 bouyer * Serial EEPROM Control (p. 4-92 in 7870 Databook)
485 1.1.6.2 bouyer * Controls the reading and writing of an external serial 1-bit
486 1.1.6.2 bouyer * EEPROM Device. In order to access the serial EEPROM, you must
487 1.1.6.2 bouyer * first set the SEEMS bit that generates a request to the memory
488 1.1.6.2 bouyer * port for access to the serial EEPROM device. When the memory
489 1.1.6.2 bouyer * port is not busy servicing another request, it reconfigures
490 1.1.6.2 bouyer * to allow access to the serial EEPROM. When this happens, SEERDY
491 1.1.6.2 bouyer * gets set high to verify that the memory port access has been
492 1.1.6.2 bouyer * granted.
493 1.1.6.2 bouyer *
494 1.1.6.2 bouyer * After successful arbitration for the memory port, the SEECS bit of
495 1.1.6.2 bouyer * the SEECTL register is connected to the chip select. The SEECK,
496 1.1.6.2 bouyer * SEEDO, and SEEDI are connected to the clock, data out, and data in
497 1.1.6.2 bouyer * lines respectively. The SEERDY bit of SEECTL is useful in that it
498 1.1.6.2 bouyer * gives us an 800 nsec timer. After a write to the SEECTL register,
499 1.1.6.2 bouyer * the SEERDY goes high 800 nsec later. The one exception to this is
500 1.1.6.2 bouyer * when we first request access to the memory port. The SEERDY goes
501 1.1.6.2 bouyer * high to signify that access has been granted and, for this case, has
502 1.1.6.2 bouyer * no implied timing.
503 1.1.6.2 bouyer *
504 1.1.6.2 bouyer * See 93cx6.c for detailed information on the protocol necessary to
505 1.1.6.2 bouyer * read the serial EEPROM.
506 1.1.6.2 bouyer */
507 1.1.6.2 bouyer register SEECTL {
508 1.1.6.2 bouyer address 0x01e
509 1.1.6.2 bouyer bit EXTARBACK 0x80
510 1.1.6.2 bouyer bit EXTARBREQ 0x40
511 1.1.6.2 bouyer bit SEEMS 0x20
512 1.1.6.2 bouyer bit SEERDY 0x10
513 1.1.6.2 bouyer bit SEECS 0x08
514 1.1.6.2 bouyer bit SEECK 0x04
515 1.1.6.2 bouyer bit SEEDO 0x02
516 1.1.6.2 bouyer bit SEEDI 0x01
517 1.1.6.2 bouyer }
518 1.1.6.2 bouyer /*
519 1.1.6.2 bouyer * SCSI Block Control (p. 3-32)
520 1.1.6.2 bouyer * Controls Bus type and channel selection. In a twin channel configuration
521 1.1.6.2 bouyer * addresses 0x00-0x1e are gated to the appropriate channel based on this
522 1.1.6.2 bouyer * register. SELWIDE allows for the coexistence of 8bit and 16bit devices
523 1.1.6.2 bouyer * on a wide bus.
524 1.1.6.2 bouyer */
525 1.1.6.2 bouyer register SBLKCTL {
526 1.1.6.2 bouyer address 0x01f
527 1.1.6.2 bouyer access_mode RW
528 1.1.6.2 bouyer bit DIAGLEDEN 0x80 /* Aic78X0 only */
529 1.1.6.2 bouyer bit DIAGLEDON 0x40 /* Aic78X0 only */
530 1.1.6.2 bouyer bit AUTOFLUSHDIS 0x20
531 1.1.6.2 bouyer bit SELBUSB 0x08
532 1.1.6.2 bouyer bit ENAB40 0x08 /* LVD transceiver active */
533 1.1.6.2 bouyer bit ENAB20 0x04 /* SE/HVD transceiver active */
534 1.1.6.2 bouyer bit SELWIDE 0x02
535 1.1.6.2 bouyer bit XCVR 0x01 /* External transceiver active */
536 1.1.6.2 bouyer }
537 1.1.6.2 bouyer
538 1.1.6.2 bouyer /*
539 1.1.6.2 bouyer * Sequencer Control (p. 3-33)
540 1.1.6.2 bouyer * Error detection mode and speed configuration
541 1.1.6.2 bouyer */
542 1.1.6.2 bouyer register SEQCTL {
543 1.1.6.2 bouyer address 0x060
544 1.1.6.2 bouyer access_mode RW
545 1.1.6.2 bouyer bit PERRORDIS 0x80
546 1.1.6.2 bouyer bit PAUSEDIS 0x40
547 1.1.6.2 bouyer bit FAILDIS 0x20
548 1.1.6.2 bouyer bit FASTMODE 0x10
549 1.1.6.2 bouyer bit BRKADRINTEN 0x08
550 1.1.6.2 bouyer bit STEP 0x04
551 1.1.6.2 bouyer bit SEQRESET 0x02
552 1.1.6.2 bouyer bit LOADRAM 0x01
553 1.1.6.2 bouyer }
554 1.1.6.2 bouyer
555 1.1.6.2 bouyer /*
556 1.1.6.2 bouyer * Sequencer RAM Data (p. 3-34)
557 1.1.6.2 bouyer * Single byte window into the Scratch Ram area starting at the address
558 1.1.6.2 bouyer * specified by SEQADDR0 and SEQADDR1. To write a full word, simply write
559 1.1.6.2 bouyer * four bytes in succession. The SEQADDRs will increment after the most
560 1.1.6.2 bouyer * significant byte is written
561 1.1.6.2 bouyer */
562 1.1.6.2 bouyer register SEQRAM {
563 1.1.6.2 bouyer address 0x061
564 1.1.6.2 bouyer access_mode RW
565 1.1.6.2 bouyer }
566 1.1.6.2 bouyer
567 1.1.6.2 bouyer /*
568 1.1.6.2 bouyer * Sequencer Address Registers (p. 3-35)
569 1.1.6.2 bouyer * Only the first bit of SEQADDR1 holds addressing information
570 1.1.6.2 bouyer */
571 1.1.6.2 bouyer register SEQADDR0 {
572 1.1.6.2 bouyer address 0x062
573 1.1.6.2 bouyer access_mode RW
574 1.1.6.2 bouyer }
575 1.1.6.2 bouyer
576 1.1.6.2 bouyer register SEQADDR1 {
577 1.1.6.2 bouyer address 0x063
578 1.1.6.2 bouyer access_mode RW
579 1.1.6.2 bouyer mask SEQADDR1_MASK 0x01
580 1.1.6.2 bouyer }
581 1.1.6.2 bouyer
582 1.1.6.2 bouyer /*
583 1.1.6.2 bouyer * Accumulator
584 1.1.6.2 bouyer * We cheat by passing arguments in the Accumulator up to the kernel driver
585 1.1.6.2 bouyer */
586 1.1.6.2 bouyer register ACCUM {
587 1.1.6.2 bouyer address 0x064
588 1.1.6.2 bouyer access_mode RW
589 1.1.6.2 bouyer accumulator
590 1.1.6.2 bouyer }
591 1.1.6.2 bouyer
592 1.1.6.2 bouyer register SINDEX {
593 1.1.6.2 bouyer address 0x065
594 1.1.6.2 bouyer access_mode RW
595 1.1.6.2 bouyer sindex
596 1.1.6.2 bouyer }
597 1.1.6.2 bouyer
598 1.1.6.2 bouyer register DINDEX {
599 1.1.6.2 bouyer address 0x066
600 1.1.6.2 bouyer access_mode RW
601 1.1.6.2 bouyer }
602 1.1.6.2 bouyer
603 1.1.6.2 bouyer register ALLONES {
604 1.1.6.2 bouyer address 0x069
605 1.1.6.2 bouyer access_mode RO
606 1.1.6.2 bouyer allones
607 1.1.6.2 bouyer }
608 1.1.6.2 bouyer
609 1.1.6.2 bouyer register ALLZEROS {
610 1.1.6.2 bouyer address 0x06a
611 1.1.6.2 bouyer access_mode RO
612 1.1.6.2 bouyer allzeros
613 1.1.6.2 bouyer }
614 1.1.6.2 bouyer
615 1.1.6.2 bouyer register NONE {
616 1.1.6.2 bouyer address 0x06a
617 1.1.6.2 bouyer access_mode WO
618 1.1.6.2 bouyer none
619 1.1.6.2 bouyer }
620 1.1.6.2 bouyer
621 1.1.6.2 bouyer register FLAGS {
622 1.1.6.2 bouyer address 0x06b
623 1.1.6.2 bouyer access_mode RO
624 1.1.6.2 bouyer bit ZERO 0x02
625 1.1.6.2 bouyer bit CARRY 0x01
626 1.1.6.2 bouyer }
627 1.1.6.2 bouyer
628 1.1.6.2 bouyer register SINDIR {
629 1.1.6.2 bouyer address 0x06c
630 1.1.6.2 bouyer access_mode RO
631 1.1.6.2 bouyer }
632 1.1.6.2 bouyer
633 1.1.6.2 bouyer register DINDIR {
634 1.1.6.2 bouyer address 0x06d
635 1.1.6.2 bouyer access_mode WO
636 1.1.6.2 bouyer }
637 1.1.6.2 bouyer
638 1.1.6.2 bouyer register FUNCTION1 {
639 1.1.6.2 bouyer address 0x06e
640 1.1.6.2 bouyer access_mode RW
641 1.1.6.2 bouyer }
642 1.1.6.2 bouyer
643 1.1.6.2 bouyer register STACK {
644 1.1.6.2 bouyer address 0x06f
645 1.1.6.2 bouyer access_mode RO
646 1.1.6.2 bouyer }
647 1.1.6.2 bouyer
648 1.1.6.2 bouyer /*
649 1.1.6.2 bouyer * Board Control (p. 3-43)
650 1.1.6.2 bouyer */
651 1.1.6.2 bouyer register BCTL {
652 1.1.6.2 bouyer address 0x084
653 1.1.6.2 bouyer access_mode RW
654 1.1.6.2 bouyer bit ACE 0x08
655 1.1.6.2 bouyer bit ENABLE 0x01
656 1.1.6.2 bouyer }
657 1.1.6.2 bouyer
658 1.1.6.2 bouyer /*
659 1.1.6.2 bouyer * On the aic78X0 chips, Board Control is replaced by the DSCommand
660 1.1.6.2 bouyer * register (p. 4-64)
661 1.1.6.2 bouyer */
662 1.1.6.2 bouyer register DSCOMMAND0 {
663 1.1.6.2 bouyer address 0x084
664 1.1.6.2 bouyer access_mode RW
665 1.1.6.2 bouyer bit CACHETHEN 0x80 /* Cache Threshold enable */
666 1.1.6.2 bouyer bit DPARCKEN 0x40 /* Data Parity Check Enable */
667 1.1.6.2 bouyer bit MPARCKEN 0x20 /* Memory Parity Check Enable */
668 1.1.6.2 bouyer bit EXTREQLCK 0x10 /* External Request Lock */
669 1.1.6.2 bouyer /* aic7890/91/96/97 only */
670 1.1.6.2 bouyer bit INTSCBRAMSEL 0x08 /* Internal SCB RAM Select */
671 1.1.6.2 bouyer bit RAMPS 0x04 /* External SCB RAM Present */
672 1.1.6.2 bouyer bit USCBSIZE32 0x02 /* Use 32byte SCB Page Size */
673 1.1.6.2 bouyer bit CIOPARCKEN 0x01 /* Internal bus parity error enable */
674 1.1.6.2 bouyer }
675 1.1.6.2 bouyer
676 1.1.6.2 bouyer /*
677 1.1.6.2 bouyer * Bus On/Off Time (p. 3-44)
678 1.1.6.2 bouyer */
679 1.1.6.2 bouyer register BUSTIME {
680 1.1.6.2 bouyer address 0x085
681 1.1.6.2 bouyer access_mode RW
682 1.1.6.2 bouyer mask BOFF 0xf0
683 1.1.6.2 bouyer mask BON 0x0f
684 1.1.6.2 bouyer }
685 1.1.6.2 bouyer
686 1.1.6.2 bouyer /*
687 1.1.6.2 bouyer * Bus Speed (p. 3-45) aic7770 only
688 1.1.6.2 bouyer */
689 1.1.6.2 bouyer register BUSSPD {
690 1.1.6.2 bouyer address 0x086
691 1.1.6.2 bouyer access_mode RW
692 1.1.6.2 bouyer mask DFTHRSH 0xc0
693 1.1.6.2 bouyer mask STBOFF 0x38
694 1.1.6.2 bouyer mask STBON 0x07
695 1.1.6.2 bouyer mask DFTHRSH_100 0xc0
696 1.1.6.2 bouyer }
697 1.1.6.2 bouyer
698 1.1.6.2 bouyer /* aic7850/55/60/70/80/95 only */
699 1.1.6.2 bouyer register DSPCISTATUS {
700 1.1.6.2 bouyer address 0x086
701 1.1.6.2 bouyer mask DFTHRSH_100 0xc0
702 1.1.6.2 bouyer }
703 1.1.6.2 bouyer
704 1.1.6.2 bouyer /* aic7890/91/96/97 only */
705 1.1.6.2 bouyer register HS_MAILBOX {
706 1.1.6.2 bouyer address 0x086
707 1.1.6.2 bouyer mask HOST_MAILBOX 0xF0
708 1.1.6.2 bouyer mask SEQ_MAILBOX 0x0F
709 1.1.6.2 bouyer }
710 1.1.6.2 bouyer
711 1.1.6.2 bouyer const HOST_MAILBOX_SHIFT 4
712 1.1.6.2 bouyer const SEQ_MAILBOX_SHIFT 0
713 1.1.6.2 bouyer
714 1.1.6.2 bouyer /*
715 1.1.6.2 bouyer * Host Control (p. 3-47) R/W
716 1.1.6.2 bouyer * Overall host control of the device.
717 1.1.6.2 bouyer */
718 1.1.6.2 bouyer register HCNTRL {
719 1.1.6.2 bouyer address 0x087
720 1.1.6.2 bouyer access_mode RW
721 1.1.6.2 bouyer bit POWRDN 0x40
722 1.1.6.2 bouyer bit SWINT 0x10
723 1.1.6.2 bouyer bit IRQMS 0x08
724 1.1.6.2 bouyer bit PAUSE 0x04
725 1.1.6.2 bouyer bit INTEN 0x02
726 1.1.6.2 bouyer bit CHIPRST 0x01
727 1.1.6.2 bouyer bit CHIPRSTACK 0x01
728 1.1.6.2 bouyer }
729 1.1.6.2 bouyer
730 1.1.6.2 bouyer /*
731 1.1.6.2 bouyer * Host Address (p. 3-48)
732 1.1.6.2 bouyer * This register contains the address of the byte about
733 1.1.6.2 bouyer * to be transferred across the host bus.
734 1.1.6.2 bouyer */
735 1.1.6.2 bouyer register HADDR {
736 1.1.6.2 bouyer address 0x088
737 1.1.6.2 bouyer size 4
738 1.1.6.2 bouyer access_mode RW
739 1.1.6.2 bouyer }
740 1.1.6.2 bouyer
741 1.1.6.2 bouyer register HCNT {
742 1.1.6.2 bouyer address 0x08c
743 1.1.6.2 bouyer size 3
744 1.1.6.2 bouyer access_mode RW
745 1.1.6.2 bouyer }
746 1.1.6.2 bouyer
747 1.1.6.2 bouyer /*
748 1.1.6.2 bouyer * SCB Pointer (p. 3-49)
749 1.1.6.2 bouyer * Gate one of the four SCBs into the SCBARRAY window.
750 1.1.6.2 bouyer */
751 1.1.6.2 bouyer register SCBPTR {
752 1.1.6.2 bouyer address 0x090
753 1.1.6.2 bouyer access_mode RW
754 1.1.6.2 bouyer }
755 1.1.6.2 bouyer
756 1.1.6.2 bouyer /*
757 1.1.6.2 bouyer * Interrupt Status (p. 3-50)
758 1.1.6.2 bouyer * Status for system interrupts
759 1.1.6.2 bouyer */
760 1.1.6.2 bouyer register INTSTAT {
761 1.1.6.2 bouyer address 0x091
762 1.1.6.2 bouyer access_mode RW
763 1.1.6.2 bouyer bit BRKADRINT 0x08
764 1.1.6.2 bouyer bit SCSIINT 0x04
765 1.1.6.2 bouyer bit CMDCMPLT 0x02
766 1.1.6.2 bouyer bit SEQINT 0x01
767 1.1.6.2 bouyer mask BAD_PHASE SEQINT /* unknown scsi bus phase */
768 1.1.6.2 bouyer mask SEND_REJECT 0x10|SEQINT /* sending a message reject */
769 1.1.6.2 bouyer mask NO_IDENT 0x20|SEQINT /* no IDENTIFY after reconnect*/
770 1.1.6.2 bouyer mask NO_MATCH 0x30|SEQINT /* no cmd match for reconnect */
771 1.1.6.2 bouyer mask UPDATE_TMSG_REQ 0x60|SEQINT /* Update TMSG_REQ values */
772 1.1.6.2 bouyer mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
773 1.1.6.2 bouyer mask RESIDUAL 0x80|SEQINT /* Residual byte count != 0 */
774 1.1.6.2 bouyer mask TRACE_POINT 0x90|SEQINT
775 1.1.6.2 bouyer mask HOST_MSG_LOOP 0xa0|SEQINT /*
776 1.1.6.2 bouyer * The bus is ready for the
777 1.1.6.2 bouyer * host to perform another
778 1.1.6.2 bouyer * message transaction. This
779 1.1.6.2 bouyer * mechanism is used for things
780 1.1.6.2 bouyer * like sync/wide negotiation
781 1.1.6.2 bouyer * that require a kernel based
782 1.1.6.2 bouyer * message state engine.
783 1.1.6.2 bouyer */
784 1.1.6.2 bouyer mask PERR_DETECTED 0xb0|SEQINT /*
785 1.1.6.2 bouyer * Either the phase_lock
786 1.1.6.2 bouyer * or inb_next routine has
787 1.1.6.2 bouyer * noticed a parity error.
788 1.1.6.2 bouyer */
789 1.1.6.2 bouyer mask TRACEPOINT 0xd0|SEQINT
790 1.1.6.2 bouyer mask MSGIN_PHASEMIS 0xe0|SEQINT /*
791 1.1.6.2 bouyer * Target changed phase on us
792 1.1.6.2 bouyer * when we were expecting
793 1.1.6.2 bouyer * another msgin byte.
794 1.1.6.2 bouyer */
795 1.1.6.2 bouyer mask DATA_OVERRUN 0xf0|SEQINT /*
796 1.1.6.2 bouyer * Target attempted to write
797 1.1.6.2 bouyer * beyond the bounds of its
798 1.1.6.2 bouyer * command.
799 1.1.6.2 bouyer */
800 1.1.6.2 bouyer
801 1.1.6.2 bouyer mask SEQINT_MASK 0xf0|SEQINT /* SEQINT Status Codes */
802 1.1.6.2 bouyer mask INT_PEND (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT)
803 1.1.6.2 bouyer }
804 1.1.6.2 bouyer
805 1.1.6.2 bouyer /*
806 1.1.6.2 bouyer * Hard Error (p. 3-53)
807 1.1.6.2 bouyer * Reporting of catastrophic errors. You usually cannot recover from
808 1.1.6.2 bouyer * these without a full board reset.
809 1.1.6.2 bouyer */
810 1.1.6.2 bouyer register ERROR {
811 1.1.6.2 bouyer address 0x092
812 1.1.6.2 bouyer access_mode RO
813 1.1.6.2 bouyer bit CIOPARERR 0x80 /* Ultra2 only */
814 1.1.6.2 bouyer bit PCIERRSTAT 0x40 /* PCI only */
815 1.1.6.2 bouyer bit MPARERR 0x20 /* PCI only */
816 1.1.6.2 bouyer bit DPARERR 0x10 /* PCI only */
817 1.1.6.2 bouyer bit SQPARERR 0x08
818 1.1.6.2 bouyer bit ILLOPCODE 0x04
819 1.1.6.2 bouyer bit ILLSADDR 0x02
820 1.1.6.2 bouyer bit ILLHADDR 0x01
821 1.1.6.2 bouyer }
822 1.1.6.2 bouyer
823 1.1.6.2 bouyer /*
824 1.1.6.2 bouyer * Clear Interrupt Status (p. 3-52)
825 1.1.6.2 bouyer */
826 1.1.6.2 bouyer register CLRINT {
827 1.1.6.2 bouyer address 0x092
828 1.1.6.2 bouyer access_mode WO
829 1.1.6.2 bouyer bit CLRPARERR 0x10 /* PCI only */
830 1.1.6.2 bouyer bit CLRBRKADRINT 0x08
831 1.1.6.2 bouyer bit CLRSCSIINT 0x04
832 1.1.6.2 bouyer bit CLRCMDINT 0x02
833 1.1.6.2 bouyer bit CLRSEQINT 0x01
834 1.1.6.2 bouyer }
835 1.1.6.2 bouyer
836 1.1.6.2 bouyer register DFCNTRL {
837 1.1.6.2 bouyer address 0x093
838 1.1.6.2 bouyer access_mode RW
839 1.1.6.2 bouyer bit PRELOADEN 0x80 /* aic7890 only */
840 1.1.6.2 bouyer bit WIDEODD 0x40
841 1.1.6.2 bouyer bit SCSIEN 0x20
842 1.1.6.2 bouyer bit SDMAEN 0x10
843 1.1.6.2 bouyer bit SDMAENACK 0x10
844 1.1.6.2 bouyer bit HDMAEN 0x08
845 1.1.6.2 bouyer bit HDMAENACK 0x08
846 1.1.6.2 bouyer bit DIRECTION 0x04
847 1.1.6.2 bouyer bit FIFOFLUSH 0x02
848 1.1.6.2 bouyer bit FIFORESET 0x01
849 1.1.6.2 bouyer }
850 1.1.6.2 bouyer
851 1.1.6.2 bouyer register DFSTATUS {
852 1.1.6.2 bouyer address 0x094
853 1.1.6.2 bouyer access_mode RO
854 1.1.6.2 bouyer bit PRELOAD_AVAIL 0x80
855 1.1.6.2 bouyer bit DWORDEMP 0x20
856 1.1.6.2 bouyer bit MREQPEND 0x10
857 1.1.6.2 bouyer bit HDONE 0x08
858 1.1.6.2 bouyer bit DFTHRESH 0x04
859 1.1.6.2 bouyer bit FIFOFULL 0x02
860 1.1.6.2 bouyer bit FIFOEMP 0x01
861 1.1.6.2 bouyer }
862 1.1.6.2 bouyer
863 1.1.6.2 bouyer register DFWADDR {
864 1.1.6.2 bouyer address 0x95
865 1.1.6.2 bouyer access_mode RW
866 1.1.6.2 bouyer }
867 1.1.6.2 bouyer
868 1.1.6.2 bouyer register DFRADDR {
869 1.1.6.2 bouyer address 0x97
870 1.1.6.2 bouyer access_mode RW
871 1.1.6.2 bouyer }
872 1.1.6.2 bouyer
873 1.1.6.2 bouyer register DFDAT {
874 1.1.6.2 bouyer address 0x099
875 1.1.6.2 bouyer access_mode RW
876 1.1.6.2 bouyer }
877 1.1.6.2 bouyer
878 1.1.6.2 bouyer /*
879 1.1.6.2 bouyer * SCB Auto Increment (p. 3-59)
880 1.1.6.2 bouyer * Byte offset into the SCB Array and an optional bit to allow auto
881 1.1.6.2 bouyer * incrementing of the address during download and upload operations
882 1.1.6.2 bouyer */
883 1.1.6.2 bouyer register SCBCNT {
884 1.1.6.2 bouyer address 0x09a
885 1.1.6.2 bouyer access_mode RW
886 1.1.6.2 bouyer bit SCBAUTO 0x80
887 1.1.6.2 bouyer mask SCBCNT_MASK 0x1f
888 1.1.6.2 bouyer }
889 1.1.6.2 bouyer
890 1.1.6.2 bouyer /*
891 1.1.6.2 bouyer * Queue In FIFO (p. 3-60)
892 1.1.6.2 bouyer * Input queue for queued SCBs (commands that the seqencer has yet to start)
893 1.1.6.2 bouyer */
894 1.1.6.2 bouyer register QINFIFO {
895 1.1.6.2 bouyer address 0x09b
896 1.1.6.2 bouyer access_mode RW
897 1.1.6.2 bouyer }
898 1.1.6.2 bouyer
899 1.1.6.2 bouyer /*
900 1.1.6.2 bouyer * Queue In Count (p. 3-60)
901 1.1.6.2 bouyer * Number of queued SCBs
902 1.1.6.2 bouyer */
903 1.1.6.2 bouyer register QINCNT {
904 1.1.6.2 bouyer address 0x09c
905 1.1.6.2 bouyer access_mode RO
906 1.1.6.2 bouyer }
907 1.1.6.2 bouyer
908 1.1.6.2 bouyer /*
909 1.1.6.2 bouyer * Queue Out FIFO (p. 3-61)
910 1.1.6.2 bouyer * Queue of SCBs that have completed and await the host
911 1.1.6.2 bouyer */
912 1.1.6.2 bouyer register QOUTFIFO {
913 1.1.6.2 bouyer address 0x09d
914 1.1.6.2 bouyer access_mode WO
915 1.1.6.2 bouyer }
916 1.1.6.2 bouyer
917 1.1.6.2 bouyer register CRCCONTROL1 {
918 1.1.6.2 bouyer address 0x09d
919 1.1.6.2 bouyer access_mode RW
920 1.1.6.2 bouyer bit CRCONSEEN 0x80
921 1.1.6.2 bouyer bit CRCVALCHKEN 0x40
922 1.1.6.2 bouyer bit CRCENDCHKEN 0x20
923 1.1.6.2 bouyer bit CRCREQCHKEN 0x10
924 1.1.6.2 bouyer bit TARGCRCENDEN 0x08
925 1.1.6.2 bouyer bit TARGCRCCNTEN 0x04
926 1.1.6.2 bouyer }
927 1.1.6.2 bouyer
928 1.1.6.2 bouyer
929 1.1.6.2 bouyer /*
930 1.1.6.2 bouyer * Queue Out Count (p. 3-61)
931 1.1.6.2 bouyer * Number of queued SCBs in the Out FIFO
932 1.1.6.2 bouyer */
933 1.1.6.2 bouyer register QOUTCNT {
934 1.1.6.2 bouyer address 0x09e
935 1.1.6.2 bouyer access_mode RO
936 1.1.6.2 bouyer }
937 1.1.6.2 bouyer
938 1.1.6.2 bouyer register SCSIPHASE {
939 1.1.6.2 bouyer address 0x09e
940 1.1.6.2 bouyer access_mode RO
941 1.1.6.2 bouyer bit STATUS_PHASE 0x20
942 1.1.6.2 bouyer bit COMMAND_PHASE 0x10
943 1.1.6.2 bouyer bit MSG_IN_PHASE 0x08
944 1.1.6.2 bouyer bit MSG_OUT_PHASE 0x04
945 1.1.6.2 bouyer bit DATA_IN_PHASE 0x02
946 1.1.6.2 bouyer bit DATA_OUT_PHASE 0x01
947 1.1.6.2 bouyer }
948 1.1.6.2 bouyer
949 1.1.6.2 bouyer /*
950 1.1.6.2 bouyer * Special Function
951 1.1.6.2 bouyer */
952 1.1.6.2 bouyer register SFUNCT {
953 1.1.6.2 bouyer address 0x09f
954 1.1.6.2 bouyer access_mode RW
955 1.1.6.2 bouyer bit ALT_MODE 0x80
956 1.1.6.2 bouyer }
957 1.1.6.2 bouyer
958 1.1.6.2 bouyer /*
959 1.1.6.2 bouyer * SCB Definition (p. 5-4)
960 1.1.6.2 bouyer */
961 1.1.6.2 bouyer scb {
962 1.1.6.2 bouyer address 0x0a0
963 1.1.6.2 bouyer SCB_CONTROL {
964 1.1.6.2 bouyer size 1
965 1.1.6.2 bouyer bit TARGET_SCB 0x80
966 1.1.6.2 bouyer bit DISCENB 0x40
967 1.1.6.2 bouyer bit TAG_ENB 0x20
968 1.1.6.2 bouyer bit MK_MESSAGE 0x10
969 1.1.6.2 bouyer bit ULTRAENB 0x08
970 1.1.6.2 bouyer bit DISCONNECTED 0x04
971 1.1.6.2 bouyer mask SCB_TAG_TYPE 0x03
972 1.1.6.2 bouyer }
973 1.1.6.2 bouyer SCB_TCL {
974 1.1.6.2 bouyer size 1
975 1.1.6.2 bouyer bit SELBUSB 0x08
976 1.1.6.2 bouyer mask TID 0xf0
977 1.1.6.2 bouyer mask LID 0x07
978 1.1.6.2 bouyer }
979 1.1.6.2 bouyer SCB_TARGET_STATUS {
980 1.1.6.2 bouyer size 1
981 1.1.6.2 bouyer }
982 1.1.6.2 bouyer SCB_SGCOUNT {
983 1.1.6.2 bouyer size 1
984 1.1.6.2 bouyer }
985 1.1.6.2 bouyer SCB_SGPTR {
986 1.1.6.2 bouyer size 4
987 1.1.6.2 bouyer }
988 1.1.6.2 bouyer SCB_RESID_SGCNT {
989 1.1.6.2 bouyer size 1
990 1.1.6.2 bouyer }
991 1.1.6.2 bouyer SCB_RESID_DCNT {
992 1.1.6.2 bouyer size 3
993 1.1.6.2 bouyer }
994 1.1.6.2 bouyer SCB_DATAPTR {
995 1.1.6.2 bouyer size 4
996 1.1.6.2 bouyer }
997 1.1.6.2 bouyer SCB_DATACNT {
998 1.1.6.2 bouyer /*
999 1.1.6.2 bouyer * Really only 3 bytes, but padded to make
1000 1.1.6.2 bouyer * the kernel's job easier.
1001 1.1.6.2 bouyer */
1002 1.1.6.2 bouyer size 4
1003 1.1.6.2 bouyer }
1004 1.1.6.2 bouyer SCB_CMDPTR {
1005 1.1.6.2 bouyer alias SCB_TARGET_PHASES
1006 1.1.6.2 bouyer bit TARGET_DATA_IN 0x1 /* In the second byte */
1007 1.1.6.2 bouyer size 4
1008 1.1.6.2 bouyer }
1009 1.1.6.2 bouyer SCB_CMDLEN {
1010 1.1.6.2 bouyer alias SCB_INITIATOR_TAG
1011 1.1.6.2 bouyer size 1
1012 1.1.6.2 bouyer }
1013 1.1.6.2 bouyer SCB_TAG {
1014 1.1.6.2 bouyer size 1
1015 1.1.6.2 bouyer }
1016 1.1.6.2 bouyer SCB_NEXT {
1017 1.1.6.2 bouyer size 1
1018 1.1.6.2 bouyer }
1019 1.1.6.2 bouyer SCB_SCSIRATE {
1020 1.1.6.2 bouyer size 1
1021 1.1.6.2 bouyer }
1022 1.1.6.2 bouyer SCB_SCSIOFFSET {
1023 1.1.6.2 bouyer size 1
1024 1.1.6.2 bouyer }
1025 1.1.6.2 bouyer SCB_SPARE {
1026 1.1.6.2 bouyer size 3
1027 1.1.6.2 bouyer }
1028 1.1.6.2 bouyer SCB_CMDSTORE {
1029 1.1.6.2 bouyer size 16
1030 1.1.6.2 bouyer }
1031 1.1.6.2 bouyer SCB_CMDSTORE_BUSADDR {
1032 1.1.6.2 bouyer size 4
1033 1.1.6.2 bouyer }
1034 1.1.6.2 bouyer SCB_64BYTE_SPARE {
1035 1.1.6.2 bouyer size 12
1036 1.1.6.2 bouyer }
1037 1.1.6.2 bouyer }
1038 1.1.6.2 bouyer
1039 1.1.6.2 bouyer const SCB_32BYTE_SIZE 28
1040 1.1.6.2 bouyer const SCB_64BYTE_SIZE 48
1041 1.1.6.2 bouyer
1042 1.1.6.2 bouyer const SG_SIZEOF 0x08 /* sizeof(struct ahc_dma) */
1043 1.1.6.2 bouyer
1044 1.1.6.2 bouyer /* --------------------- AHA-2840-only definitions -------------------- */
1045 1.1.6.2 bouyer
1046 1.1.6.2 bouyer register SEECTL_2840 {
1047 1.1.6.2 bouyer address 0x0c0
1048 1.1.6.2 bouyer access_mode RW
1049 1.1.6.2 bouyer bit CS_2840 0x04
1050 1.1.6.2 bouyer bit CK_2840 0x02
1051 1.1.6.2 bouyer bit DO_2840 0x01
1052 1.1.6.2 bouyer }
1053 1.1.6.2 bouyer
1054 1.1.6.2 bouyer register STATUS_2840 {
1055 1.1.6.2 bouyer address 0x0c1
1056 1.1.6.2 bouyer access_mode RW
1057 1.1.6.2 bouyer bit EEPROM_TF 0x80
1058 1.1.6.2 bouyer mask BIOS_SEL 0x60
1059 1.1.6.2 bouyer mask ADSEL 0x1e
1060 1.1.6.2 bouyer bit DI_2840 0x01
1061 1.1.6.2 bouyer }
1062 1.1.6.2 bouyer
1063 1.1.6.2 bouyer /* --------------------- AIC-7870-only definitions -------------------- */
1064 1.1.6.2 bouyer
1065 1.1.6.2 bouyer register CCHADDR {
1066 1.1.6.2 bouyer address 0x0E0
1067 1.1.6.2 bouyer size 8
1068 1.1.6.2 bouyer }
1069 1.1.6.2 bouyer
1070 1.1.6.2 bouyer register CCHCNT {
1071 1.1.6.2 bouyer address 0x0E8
1072 1.1.6.2 bouyer }
1073 1.1.6.2 bouyer
1074 1.1.6.2 bouyer register CCSGRAM {
1075 1.1.6.2 bouyer address 0x0E9
1076 1.1.6.2 bouyer }
1077 1.1.6.2 bouyer
1078 1.1.6.2 bouyer register CCSGADDR {
1079 1.1.6.2 bouyer address 0x0EA
1080 1.1.6.2 bouyer }
1081 1.1.6.2 bouyer
1082 1.1.6.2 bouyer register CCSGCTL {
1083 1.1.6.2 bouyer address 0x0EB
1084 1.1.6.2 bouyer bit CCSGDONE 0x80
1085 1.1.6.2 bouyer bit CCSGEN 0x08
1086 1.1.6.2 bouyer bit FLAG 0x02
1087 1.1.6.2 bouyer bit CCSGRESET 0x01
1088 1.1.6.2 bouyer }
1089 1.1.6.2 bouyer
1090 1.1.6.2 bouyer register CCSCBCNT {
1091 1.1.6.2 bouyer address 0xEF
1092 1.1.6.2 bouyer }
1093 1.1.6.2 bouyer
1094 1.1.6.2 bouyer register CCSCBCTL {
1095 1.1.6.2 bouyer address 0x0EE
1096 1.1.6.2 bouyer bit CCSCBDONE 0x80
1097 1.1.6.2 bouyer bit ARRDONE 0x40 /* SCB Array prefetch done */
1098 1.1.6.2 bouyer bit CCARREN 0x10
1099 1.1.6.2 bouyer bit CCSCBEN 0x08
1100 1.1.6.2 bouyer bit CCSCBDIR 0x04
1101 1.1.6.2 bouyer bit CCSCBRESET 0x01
1102 1.1.6.2 bouyer }
1103 1.1.6.2 bouyer
1104 1.1.6.2 bouyer register CCSCBADDR {
1105 1.1.6.2 bouyer address 0x0ED
1106 1.1.6.2 bouyer }
1107 1.1.6.2 bouyer
1108 1.1.6.2 bouyer register CCSCBRAM {
1109 1.1.6.2 bouyer address 0xEC
1110 1.1.6.2 bouyer }
1111 1.1.6.2 bouyer
1112 1.1.6.2 bouyer /*
1113 1.1.6.2 bouyer * SCB bank address (7895/7896/97 only)
1114 1.1.6.2 bouyer */
1115 1.1.6.2 bouyer register SCBBADDR {
1116 1.1.6.2 bouyer address 0x0F0
1117 1.1.6.2 bouyer access_mode RW
1118 1.1.6.2 bouyer }
1119 1.1.6.2 bouyer
1120 1.1.6.2 bouyer register CCSCBPTR {
1121 1.1.6.2 bouyer address 0x0F1
1122 1.1.6.2 bouyer }
1123 1.1.6.2 bouyer
1124 1.1.6.2 bouyer register HNSCB_QOFF {
1125 1.1.6.2 bouyer address 0x0F4
1126 1.1.6.2 bouyer }
1127 1.1.6.2 bouyer
1128 1.1.6.2 bouyer register SNSCB_QOFF {
1129 1.1.6.2 bouyer address 0x0F6
1130 1.1.6.2 bouyer }
1131 1.1.6.2 bouyer
1132 1.1.6.2 bouyer register SDSCB_QOFF {
1133 1.1.6.2 bouyer address 0x0F8
1134 1.1.6.2 bouyer }
1135 1.1.6.2 bouyer
1136 1.1.6.2 bouyer register QOFF_CTLSTA {
1137 1.1.6.2 bouyer address 0x0FA
1138 1.1.6.2 bouyer bit SCB_AVAIL 0x40
1139 1.1.6.2 bouyer bit SNSCB_ROLLOVER 0x20
1140 1.1.6.2 bouyer bit SDSCB_ROLLOVER 0x10
1141 1.1.6.2 bouyer mask SCB_QSIZE 0x07
1142 1.1.6.2 bouyer mask SCB_QSIZE_256 0x06
1143 1.1.6.2 bouyer }
1144 1.1.6.2 bouyer
1145 1.1.6.2 bouyer register DFF_THRSH {
1146 1.1.6.2 bouyer address 0x0FB
1147 1.1.6.2 bouyer mask WR_DFTHRSH 0x70
1148 1.1.6.2 bouyer mask RD_DFTHRSH 0x07
1149 1.1.6.2 bouyer mask RD_DFTHRSH_MIN 0x00
1150 1.1.6.2 bouyer mask RD_DFTHRSH_25 0x01
1151 1.1.6.2 bouyer mask RD_DFTHRSH_50 0x02
1152 1.1.6.2 bouyer mask RD_DFTHRSH_63 0x03
1153 1.1.6.2 bouyer mask RD_DFTHRSH_75 0x04
1154 1.1.6.2 bouyer mask RD_DFTHRSH_85 0x05
1155 1.1.6.2 bouyer mask RD_DFTHRSH_90 0x06
1156 1.1.6.2 bouyer mask RD_DFTHRSH_MAX 0x07
1157 1.1.6.2 bouyer mask WR_DFTHRSH_MIN 0x00
1158 1.1.6.2 bouyer mask WR_DFTHRSH_25 0x10
1159 1.1.6.2 bouyer mask WR_DFTHRSH_50 0x20
1160 1.1.6.2 bouyer mask WR_DFTHRSH_63 0x30
1161 1.1.6.2 bouyer mask WR_DFTHRSH_75 0x40
1162 1.1.6.2 bouyer mask WR_DFTHRSH_85 0x50
1163 1.1.6.2 bouyer mask WR_DFTHRSH_90 0x60
1164 1.1.6.2 bouyer mask WR_DFTHRSH_MAX 0x70
1165 1.1.6.2 bouyer }
1166 1.1.6.2 bouyer
1167 1.1.6.2 bouyer register SG_CACHEPTR {
1168 1.1.6.2 bouyer access_mode RW
1169 1.1.6.2 bouyer address 0x0fc
1170 1.1.6.2 bouyer mask SG_USER_DATA 0xfc
1171 1.1.6.2 bouyer bit LAST_SEG 0x02
1172 1.1.6.2 bouyer bit LAST_SEG_DONE 0x01
1173 1.1.6.2 bouyer }
1174 1.1.6.2 bouyer
1175 1.1.6.2 bouyer /* ---------------------- Scratch RAM Offsets ------------------------- */
1176 1.1.6.2 bouyer /* These offsets are either to values that are initialized by the board's
1177 1.1.6.2 bouyer * BIOS or are specified by the sequencer code.
1178 1.1.6.2 bouyer *
1179 1.1.6.2 bouyer * The host adapter card (at least the BIOS) uses 20-2f for SCSI
1180 1.1.6.2 bouyer * device information, 32-33 and 5a-5f as well. As it turns out, the
1181 1.1.6.2 bouyer * BIOS trashes 20-2f, writing the synchronous negotiation results
1182 1.1.6.2 bouyer * on top of the BIOS values, so we re-use those for our per-target
1183 1.1.6.2 bouyer * scratchspace (actually a value that can be copied directly into
1184 1.1.6.2 bouyer * SCSIRATE). The kernel driver will enable synchronous negotiation
1185 1.1.6.2 bouyer * for all targets that have a value other than 0 in the lower four
1186 1.1.6.2 bouyer * bits of the target scratch space. This should work regardless of
1187 1.1.6.2 bouyer * whether the bios has been installed.
1188 1.1.6.2 bouyer */
1189 1.1.6.2 bouyer
1190 1.1.6.2 bouyer scratch_ram {
1191 1.1.6.2 bouyer address 0x020
1192 1.1.6.2 bouyer
1193 1.1.6.2 bouyer /*
1194 1.1.6.2 bouyer * 1 byte per target starting at this address for configuration values
1195 1.1.6.2 bouyer */
1196 1.1.6.2 bouyer TARG_SCSIRATE {
1197 1.1.6.2 bouyer alias CMDSIZE_TABLE
1198 1.1.6.2 bouyer size 16
1199 1.1.6.2 bouyer }
1200 1.1.6.2 bouyer /*
1201 1.1.6.2 bouyer * Bit vector of targets that have ULTRA enabled.
1202 1.1.6.2 bouyer */
1203 1.1.6.2 bouyer ULTRA_ENB {
1204 1.1.6.2 bouyer size 2
1205 1.1.6.2 bouyer }
1206 1.1.6.2 bouyer /*
1207 1.1.6.2 bouyer * Bit vector of targets that have disconnection disabled.
1208 1.1.6.2 bouyer */
1209 1.1.6.2 bouyer DISC_DSB {
1210 1.1.6.2 bouyer size 2
1211 1.1.6.2 bouyer }
1212 1.1.6.2 bouyer /*
1213 1.1.6.2 bouyer * Single byte buffer used to designate the type or message
1214 1.1.6.2 bouyer * to send to a target.
1215 1.1.6.2 bouyer */
1216 1.1.6.2 bouyer MSG_OUT {
1217 1.1.6.2 bouyer size 1
1218 1.1.6.2 bouyer }
1219 1.1.6.2 bouyer /* Parameters for DMA Logic */
1220 1.1.6.2 bouyer DMAPARAMS {
1221 1.1.6.2 bouyer size 1
1222 1.1.6.2 bouyer bit PRELOADEN 0x80
1223 1.1.6.2 bouyer bit WIDEODD 0x40
1224 1.1.6.2 bouyer bit SCSIEN 0x20
1225 1.1.6.2 bouyer bit SDMAEN 0x10
1226 1.1.6.2 bouyer bit SDMAENACK 0x10
1227 1.1.6.2 bouyer bit HDMAEN 0x08
1228 1.1.6.2 bouyer bit HDMAENACK 0x08
1229 1.1.6.2 bouyer bit DIRECTION 0x04
1230 1.1.6.2 bouyer bit FIFOFLUSH 0x02
1231 1.1.6.2 bouyer bit FIFORESET 0x01
1232 1.1.6.2 bouyer }
1233 1.1.6.2 bouyer SEQ_FLAGS {
1234 1.1.6.2 bouyer size 1
1235 1.1.6.2 bouyer bit IDENTIFY_SEEN 0x80
1236 1.1.6.2 bouyer bit SCBPTR_VALID 0x40
1237 1.1.6.2 bouyer bit DPHASE 0x20
1238 1.1.6.2 bouyer /* Target flags */
1239 1.1.6.2 bouyer bit TARG_CMD_PENDING 0x10
1240 1.1.6.2 bouyer bit CMDPHASE_PENDING 0x08
1241 1.1.6.2 bouyer bit DPHASE_PENDING 0x04
1242 1.1.6.2 bouyer bit SPHASE_PENDING 0x02
1243 1.1.6.2 bouyer bit NO_DISCONNECT 0x01
1244 1.1.6.2 bouyer }
1245 1.1.6.2 bouyer /*
1246 1.1.6.2 bouyer * Temporary storage for the
1247 1.1.6.2 bouyer * target/channel/lun of a
1248 1.1.6.2 bouyer * reconnecting target
1249 1.1.6.2 bouyer */
1250 1.1.6.2 bouyer SAVED_TCL {
1251 1.1.6.2 bouyer size 1
1252 1.1.6.2 bouyer }
1253 1.1.6.2 bouyer /* Working value of the number of SG segments left */
1254 1.1.6.2 bouyer SG_COUNT {
1255 1.1.6.2 bouyer size 1
1256 1.1.6.2 bouyer }
1257 1.1.6.2 bouyer /* Working value of SG pointer */
1258 1.1.6.2 bouyer SG_NEXT {
1259 1.1.6.2 bouyer size 4
1260 1.1.6.2 bouyer }
1261 1.1.6.2 bouyer /*
1262 1.1.6.2 bouyer * The last bus phase as seen by the sequencer.
1263 1.1.6.2 bouyer */
1264 1.1.6.2 bouyer LASTPHASE {
1265 1.1.6.2 bouyer size 1
1266 1.1.6.2 bouyer bit CDI 0x80
1267 1.1.6.2 bouyer bit IOI 0x40
1268 1.1.6.2 bouyer bit MSGI 0x20
1269 1.1.6.2 bouyer mask PHASE_MASK CDI|IOI|MSGI
1270 1.1.6.2 bouyer mask P_DATAOUT 0x00
1271 1.1.6.2 bouyer mask P_DATAIN IOI
1272 1.1.6.2 bouyer mask P_COMMAND CDI
1273 1.1.6.2 bouyer mask P_MESGOUT CDI|MSGI
1274 1.1.6.2 bouyer mask P_STATUS CDI|IOI
1275 1.1.6.2 bouyer mask P_MESGIN CDI|IOI|MSGI
1276 1.1.6.2 bouyer mask P_BUSFREE 0x01
1277 1.1.6.2 bouyer }
1278 1.1.6.2 bouyer /*
1279 1.1.6.2 bouyer * head of list of SCBs awaiting
1280 1.1.6.2 bouyer * selection
1281 1.1.6.2 bouyer */
1282 1.1.6.2 bouyer WAITING_SCBH {
1283 1.1.6.2 bouyer size 1
1284 1.1.6.2 bouyer }
1285 1.1.6.2 bouyer /*
1286 1.1.6.2 bouyer * head of list of SCBs that are
1287 1.1.6.2 bouyer * disconnected. Used for SCB
1288 1.1.6.2 bouyer * paging.
1289 1.1.6.2 bouyer */
1290 1.1.6.2 bouyer DISCONNECTED_SCBH {
1291 1.1.6.2 bouyer size 1
1292 1.1.6.2 bouyer }
1293 1.1.6.2 bouyer /*
1294 1.1.6.2 bouyer * head of list of SCBs that are
1295 1.1.6.2 bouyer * not in use. Used for SCB paging.
1296 1.1.6.2 bouyer */
1297 1.1.6.2 bouyer FREE_SCBH {
1298 1.1.6.2 bouyer size 1
1299 1.1.6.2 bouyer }
1300 1.1.6.2 bouyer /*
1301 1.1.6.2 bouyer * Address of the hardware scb array in the host.
1302 1.1.6.2 bouyer */
1303 1.1.6.2 bouyer HSCB_ADDR {
1304 1.1.6.2 bouyer size 4
1305 1.1.6.2 bouyer }
1306 1.1.6.2 bouyer /*
1307 1.1.6.2 bouyer * Address of the 256 byte array storing the SCBID of outstanding
1308 1.1.6.2 bouyer * untagged SCBs indexed by TCL.
1309 1.1.6.2 bouyer */
1310 1.1.6.2 bouyer SCBID_ADDR {
1311 1.1.6.2 bouyer size 4
1312 1.1.6.2 bouyer }
1313 1.1.6.2 bouyer /*
1314 1.1.6.2 bouyer * Address of the array of command descriptors used to store
1315 1.1.6.2 bouyer * information about incoming selections.
1316 1.1.6.2 bouyer */
1317 1.1.6.2 bouyer TMODE_CMDADDR {
1318 1.1.6.2 bouyer size 4
1319 1.1.6.2 bouyer }
1320 1.1.6.2 bouyer KERNEL_QINPOS {
1321 1.1.6.2 bouyer size 1
1322 1.1.6.2 bouyer }
1323 1.1.6.2 bouyer QINPOS {
1324 1.1.6.2 bouyer size 1
1325 1.1.6.2 bouyer }
1326 1.1.6.2 bouyer QOUTPOS {
1327 1.1.6.2 bouyer size 1
1328 1.1.6.2 bouyer }
1329 1.1.6.2 bouyer /*
1330 1.1.6.2 bouyer * Kernel and sequencer offsets into the queue of
1331 1.1.6.2 bouyer * incoming target mode command descriptors. The
1332 1.1.6.2 bouyer * queue is full when the KERNEL_TQINPOS == TQINPOS.
1333 1.1.6.2 bouyer */
1334 1.1.6.2 bouyer KERNEL_TQINPOS {
1335 1.1.6.2 bouyer size 1
1336 1.1.6.2 bouyer }
1337 1.1.6.2 bouyer TQINPOS {
1338 1.1.6.2 bouyer size 1
1339 1.1.6.2 bouyer }
1340 1.1.6.2 bouyer ARG_1 {
1341 1.1.6.2 bouyer size 1
1342 1.1.6.2 bouyer mask SEND_MSG 0x80
1343 1.1.6.2 bouyer mask SEND_SENSE 0x40
1344 1.1.6.2 bouyer mask SEND_REJ 0x20
1345 1.1.6.2 bouyer mask MSGOUT_PHASEMIS 0x10
1346 1.1.6.2 bouyer mask EXIT_MSG_LOOP 0x08
1347 1.1.6.2 bouyer mask CONT_MSG_LOOP 0x04
1348 1.1.6.2 bouyer mask CONT_TARG_SESSION 0x02
1349 1.1.6.2 bouyer alias RETURN_1
1350 1.1.6.2 bouyer }
1351 1.1.6.2 bouyer ARG_2 {
1352 1.1.6.2 bouyer size 1
1353 1.1.6.2 bouyer alias RETURN_2
1354 1.1.6.2 bouyer }
1355 1.1.6.2 bouyer
1356 1.1.6.2 bouyer /*
1357 1.1.6.2 bouyer * Snapshot of MSG_OUT taken after each message is sent.
1358 1.1.6.2 bouyer */
1359 1.1.6.2 bouyer LAST_MSG {
1360 1.1.6.2 bouyer size 1
1361 1.1.6.2 bouyer }
1362 1.1.6.2 bouyer
1363 1.1.6.2 bouyer /*
1364 1.1.6.2 bouyer * Number of times we have filled the CCSGRAM with prefetched
1365 1.1.6.2 bouyer * SG elements.
1366 1.1.6.2 bouyer */
1367 1.1.6.2 bouyer PREFETCH_CNT {
1368 1.1.6.2 bouyer size 1
1369 1.1.6.2 bouyer }
1370 1.1.6.2 bouyer
1371 1.1.6.2 bouyer /*
1372 1.1.6.2 bouyer * Interrupt kernel for a message to this target on
1373 1.1.6.2 bouyer * the next transaction. This is usually used for
1374 1.1.6.2 bouyer * negotiation requests.
1375 1.1.6.2 bouyer */
1376 1.1.6.2 bouyer TARGET_MSG_REQUEST {
1377 1.1.6.2 bouyer size 2
1378 1.1.6.2 bouyer }
1379 1.1.6.2 bouyer
1380 1.1.6.2 bouyer /*
1381 1.1.6.2 bouyer * Sequences the kernel driver has okayed for us. This allows
1382 1.1.6.2 bouyer * the driver to do things like prevent initiator or target
1383 1.1.6.2 bouyer * operations.
1384 1.1.6.2 bouyer */
1385 1.1.6.2 bouyer SCSISEQ_TEMPLATE {
1386 1.1.6.2 bouyer size 1
1387 1.1.6.2 bouyer bit ENSELO 0x40
1388 1.1.6.2 bouyer bit ENSELI 0x20
1389 1.1.6.2 bouyer bit ENRSELI 0x10
1390 1.1.6.2 bouyer bit ENAUTOATNO 0x08
1391 1.1.6.2 bouyer bit ENAUTOATNI 0x04
1392 1.1.6.2 bouyer bit ENAUTOATNP 0x02
1393 1.1.6.2 bouyer }
1394 1.1.6.2 bouyer
1395 1.1.6.2 bouyer /*
1396 1.1.6.2 bouyer * Track whether the transfer byte count for
1397 1.1.6.2 bouyer * the current data phase is odd.
1398 1.1.6.2 bouyer */
1399 1.1.6.2 bouyer DATA_COUNT_ODD {
1400 1.1.6.2 bouyer size 1
1401 1.1.6.2 bouyer }
1402 1.1.6.2 bouyer
1403 1.1.6.2 bouyer /*
1404 1.1.6.2 bouyer * The initiator specified tag for this target mode transaction.
1405 1.1.6.2 bouyer */
1406 1.1.6.2 bouyer INITIATOR_TAG {
1407 1.1.6.2 bouyer size 1
1408 1.1.6.2 bouyer }
1409 1.1.6.2 bouyer
1410 1.1.6.2 bouyer /*
1411 1.1.6.2 bouyer * These are reserved registers in the card's scratch ram. Some of
1412 1.1.6.2 bouyer * the values are specified in the AHA2742 technical reference manual
1413 1.1.6.2 bouyer * and are initialized by the BIOS at boot time.
1414 1.1.6.2 bouyer */
1415 1.1.6.2 bouyer SCSICONF {
1416 1.1.6.2 bouyer address 0x05a
1417 1.1.6.2 bouyer size 1
1418 1.1.6.2 bouyer bit TERM_ENB 0x80
1419 1.1.6.2 bouyer bit RESET_SCSI 0x40
1420 1.1.6.2 bouyer bit ENSPCHK 0x20
1421 1.1.6.2 bouyer mask HSCSIID 0x07 /* our SCSI ID */
1422 1.1.6.2 bouyer mask HWSCSIID 0x0f /* our SCSI ID if Wide Bus */
1423 1.1.6.2 bouyer }
1424 1.1.6.2 bouyer HOSTCONF {
1425 1.1.6.2 bouyer address 0x05d
1426 1.1.6.2 bouyer size 1
1427 1.1.6.2 bouyer }
1428 1.1.6.2 bouyer HA_274_BIOSCTRL {
1429 1.1.6.2 bouyer address 0x05f
1430 1.1.6.2 bouyer size 1
1431 1.1.6.2 bouyer mask BIOSMODE 0x30
1432 1.1.6.2 bouyer mask BIOSDISABLED 0x30
1433 1.1.6.2 bouyer bit CHANNEL_B_PRIMARY 0x08
1434 1.1.6.2 bouyer }
1435 1.1.6.2 bouyer /*
1436 1.1.6.2 bouyer * Per target SCSI offset values for Ultra2 controllers.
1437 1.1.6.2 bouyer */
1438 1.1.6.2 bouyer TARG_OFFSET {
1439 1.1.6.2 bouyer address 0x070
1440 1.1.6.2 bouyer size 16
1441 1.1.6.2 bouyer }
1442 1.1.6.2 bouyer }
1443 1.1.6.2 bouyer
1444 1.1.6.2 bouyer const SCB_LIST_NULL 0xff
1445 1.1.6.2 bouyer const TARGET_CMD_CMPLT 0xfe
1446 1.1.6.2 bouyer
1447 1.1.6.2 bouyer const CCSGADDR_MAX 0x80
1448 1.1.6.2 bouyer const CCSGRAM_MAXSEGS 16
1449 1.1.6.2 bouyer
1450 1.1.6.2 bouyer /* Offsets into the SCBID array where different data is stored */
1451 1.1.6.2 bouyer const QOUTFIFO_OFFSET 0
1452 1.1.6.2 bouyer const QINFIFO_OFFSET 1
1453 1.1.6.2 bouyer const UNTAGGEDSCB_OFFSET 2
1454 1.1.6.2 bouyer
1455 1.1.6.2 bouyer /* WDTR Message values */
1456 1.1.6.2 bouyer const BUS_8_BIT 0x00
1457 1.1.6.2 bouyer const BUS_16_BIT 0x01
1458 1.1.6.2 bouyer const BUS_32_BIT 0x02
1459 1.1.6.2 bouyer
1460 1.1.6.2 bouyer /* Offset maximums */
1461 1.1.6.2 bouyer const MAX_OFFSET_8BIT 0x0f
1462 1.1.6.2 bouyer const MAX_OFFSET_16BIT 0x08
1463 1.1.6.2 bouyer const MAX_OFFSET_ULTRA2 0x7f
1464 1.1.6.2 bouyer const HOST_MSG 0xff
1465 1.1.6.2 bouyer
1466 1.1.6.2 bouyer /* Target mode command processing constants */
1467 1.1.6.2 bouyer const CMD_GROUP_CODE_SHIFT 0x05
1468 1.1.6.2 bouyer
1469 1.1.6.2 bouyer const TCL_TARGET_SHIFT 4
1470 1.1.6.2 bouyer /* The update interval must be a power of 2 */
1471 1.1.6.2 bouyer const TQINFIFO_UPDATE_CNT 32
1472 1.1.6.2 bouyer
1473 1.1.6.2 bouyer const STATUS_BUSY 0x08
1474 1.1.6.2 bouyer const STATUS_QUEUE_FULL 0x28
1475 1.1.6.2 bouyer
1476 1.1.6.2 bouyer /*
1477 1.1.6.2 bouyer * Downloaded (kernel inserted) constants
1478 1.1.6.2 bouyer */
1479 1.1.6.2 bouyer
1480 1.1.6.2 bouyer /*
1481 1.1.6.2 bouyer * Number of command descriptors in the command descriptor array.
1482 1.1.6.2 bouyer * No longer used, but left here as an example for how downloaded
1483 1.1.6.2 bouyer * constantants can be defined.
1484 1.1.6.2 bouyer const TMODE_NUMCMDS download
1485 1.1.6.2 bouyer */
1486