2 * Aic7xxx register and scratch ram definitions.
4 * Copyright (c) 1994-2001 Justin T. Gibbs.
5 * Copyright (c) 2000-2001 Adaptec Inc.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions, and the following disclaimer,
13 * without modification.
14 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
15 * substantially similar to the "NO WARRANTY" disclaimer below
16 * ("Disclaimer") and any redistribution must be conditioned upon
17 * including a substantially similar Disclaimer requirement for further
18 * binary redistribution.
19 * 3. Neither the names of the above-listed copyright holders nor the names
20 * of any contributors may be used to endorse or promote products derived
21 * from this software without specific prior written permission.
23 * Alternatively, this software may be distributed under the terms of the
24 * GNU General Public License ("GPL") version 2 as published by the Free
25 * Software Foundation.
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
37 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 * POSSIBILITY OF SUCH DAMAGES.
42 VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#40 $"
45 * This file is processed by the aic7xxx_asm utility for use in assembling
46 * firmware for the aic7xxx family of SCSI host adapters as well as to generate
47 * a C header file for use in the kernel portion of the Aic7xxx driver.
49 * All page numbers refer to the Adaptec AIC-7770 Data Book available from
50 * Adaptec's Technical Documents Department 1-800-934-2766
54 * SCSI Sequence Control (p. 3-11).
55 * Each bit, when set starts a specific SCSI sequence on the bus
71 * SCSI Transfer Control 0 Register (pp. 3-13).
72 * Controls the SCSI module data path.
87 * SCSI Transfer Control 1 Register (pp. 3-14,15).
88 * Controls the SCSI module data path.
99 field STPWEN 0x01 /* Powered Termination */
103 * SCSI Control Signal Read Register (p. 3-15).
104 * Reads the actual state of the SCSI bus pins
118 * Possible phases in SCSISIGI
120 mask PHASE_MASK CDI|IOI|MSGI
123 mask P_DATAOUT_DT P_DATAOUT|MSGI
124 mask P_DATAIN_DT P_DATAIN|MSGI
126 mask P_MESGOUT CDI|MSGI
127 mask P_STATUS CDI|IOI
128 mask P_MESGIN CDI|IOI|MSGI
132 * SCSI Control Signal Write Register (p. 3-16).
133 * Writing to this register modifies the control signals on the bus. Only
134 * those signals that are allowed in the current mode (Initiator/Target) are
149 * Possible phases to write into SCSISIG0
151 mask PHASE_MASK CDI|IOI|MSGI
155 mask P_MESGOUT CDI|MSGI
156 mask P_STATUS CDI|IOI
157 mask P_MESGIN CDI|IOI|MSGI
161 * SCSI Rate Control (p. 3-17).
162 * Contents of this register determine the Synchronous SCSI data transfer
163 * rate and the maximum synchronous Req/Ack offset. An offset of 0 in the
164 * SOFS (3:0) bits disables synchronous data transfers. Any offset value
165 * greater than 0 enables synchronous transfers.
170 field WIDEXFER 0x80 /* Wide transfer control */
171 field ENABLE_CRC 0x40 /* CRC for D-Phases */
172 field SINGLE_EDGE 0x10 /* Disable DT Transfers */
173 mask SXFR 0x70 /* Sync transfer rate */
174 mask SXFR_ULTRA2 0x0f /* Sync transfer rate */
175 mask SOFS 0x0f /* Sync offset */
180 * Contains the ID of the board and the current target on the
186 mask TID 0xf0 /* Target ID mask */
188 field TWIN_CHNLB 0x80
189 mask OID 0x0f /* Our ID mask */
191 * SCSI Maximum Offset (p. 4-61 aic7890/91 Data Book)
192 * The aic7890/91 allow an offset of up to 127 transfers in both wide
196 mask SOFS_ULTRA2 0x7f /* Sync offset U2 chips */
200 * SCSI Latched Data (p. 3-19).
201 * Read/Write latches used to transfer data on the SCSI bus during
202 * Automatic or Manual PIO mode. SCSIDATH can be used for the
203 * upper byte of a 16bit wide asynchronouse data phase transfer.
216 * SCSI Transfer Count (pp. 3-19,20)
217 * These registers count down the number of bytes transferred
218 * across the SCSI bus. The counter is decremented only once
219 * the data has been safely transferred. SDONE in SSTAT0 is
220 * set when STCNT goes to 0
228 /* ALT_MODE registers (Ultra2 and Ultra160 chips) */
232 field AUTORSTDIS 0x10
234 mask ASYNC_SETUP 0x07
237 /* ALT_MODE register on Ultra160 chips */
238 register OPTIONMODE {
242 field AUTORATEEN 0x80
244 field ATNMGMNTEN 0x20
245 field BUSFREEREV 0x10
246 field EXPPHASEDIS 0x08
247 field SCSIDATL_IMGEN 0x04
248 field AUTO_MSGOUT_DE 0x02
249 field DIS_MSGIN_DUALEDGE 0x01
250 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE|DIS_MSGIN_DUALEDGE
253 /* ALT_MODE register on Ultra160 chips */
254 register TARGCRCCNT {
262 * Clear SCSI Interrupt 0 (p. 3-20)
263 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
270 field CLRSELINGO 0x10
272 field CLRIOERR 0x08 /* Ultra2 Only */
273 field CLRSPIORDY 0x02
277 * SCSI Status 0 (p. 3-21)
278 * Contains one set of SCSI Interrupt codes
279 * These are most likely of interest to the sequencer
284 field TARGET 0x80 /* Board acting as target */
285 field SELDO 0x40 /* Selection Done */
286 field SELDI 0x20 /* Board has been selected */
287 field SELINGO 0x10 /* Selection In Progress */
288 field SWRAP 0x08 /* 24bit counter wrap */
289 field IOERR 0x08 /* LVD Tranceiver mode changed */
290 field SDONE 0x04 /* STCNT = 0x000000 */
291 field SPIORDY 0x02 /* SCSI PIO Ready */
292 field DMADONE 0x01 /* DMA transfer completed */
296 * Clear SCSI Interrupt 1 (p. 3-23)
297 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
302 field CLRSELTIMEO 0x80
304 field CLRSCSIRSTI 0x20
305 field CLRBUSFREE 0x08
306 field CLRSCSIPERR 0x04
307 field CLRPHASECHG 0x02
308 field CLRREQINIT 0x01
312 * SCSI Status 1 (p. 3-24)
328 * SCSI Status 2 (pp. 3-25,26)
334 field SHVALID 0x40 /* Shaddow Layer non-zero */
335 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
336 field CRCVALERR 0x08 /* CRC doesn't match (U3 only) */
337 field CRCENDERR 0x04 /* No terminal CRC packet (U3 only) */
338 field CRCREQERR 0x02 /* Illegal CRC packet req (U3 only) */
339 field DUAL_EDGE_ERR 0x01 /* Incorrect data phase (U3 only) */
344 * SCSI Status 3 (p. 3-26)
356 * SCSI ID for the aic7890/91 chips
358 register SCSIID_ULTRA2 {
361 mask TID 0xf0 /* Target ID mask */
362 mask OID 0x0f /* Our ID mask */
366 * SCSI Interrupt Mode 1 (p. 3-28)
367 * Setting any bit will enable the corresponding function
368 * in SIMODE0 to interrupt via the IRQ pin.
378 field ENIOERR 0x08 /* LVD Tranceiver mode changes */
385 * SCSI Interrupt Mode 1 (pp. 3-28,29)
386 * Setting any bit will enable the corresponding function
387 * in SIMODE1 to interrupt via the IRQ pin.
395 field ENPHASEMIS 0x10
397 field ENSCSIPERR 0x04
398 field ENPHASECHG 0x02
403 * SCSI Data Bus (High) (p. 3-29)
404 * This register reads data on the SCSI Data bus directly.
417 * SCSI/Host Address (p. 3-30)
418 * These registers hold the host address for the byte about to be
419 * transferred on the SCSI bus. They are counted up in the same
420 * manner as STCNT is counted down. SHADDR should always be used
421 * to determine the address of the last byte transferred since HADDR
422 * can be skewed by write ahead.
431 * Selection Timeout Timer (p. 3-30)
447 * Selection/Reselection ID (p. 3-31)
448 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
449 * device did not set its own ID.
461 field ENSCAMSELO 0x80
462 field CLRSCAMSELID 0x40
469 * Target Mode Selecting in ID bitmask (aic7890/91/96/97)
479 * Serial Port I/O Cabability register (p. 4-95 aic7860 Data Book)
480 * Indicates if external logic has been attached to the chip to
481 * perform the tasks of accessing a serial eeprom, testing termination
482 * strength, and performing cable detection. On the aic7860, most of
483 * these features are handled on chip, but on the aic7855 an attached
484 * aic3800 does the grunt work.
493 field EXT_BRDCTL 0x10 /* External Board control */
494 field SEEPROM 0x08 /* External serial eeprom logic */
495 field EEPROM 0x04 /* Writable external BIOS ROM */
496 field ROM 0x02 /* Logic for accessing external ROM */
497 field SSPIOCPS 0x01 /* Termination and cable detection */
511 /* 7890 Definitions */
515 field BRDRW_ULTRA2 0x02
516 field BRDSTB_ULTRA2 0x01
520 * Serial EEPROM Control (p. 4-92 in 7870 Databook)
521 * Controls the reading and writing of an external serial 1-bit
522 * EEPROM Device. In order to access the serial EEPROM, you must
523 * first set the SEEMS bit that generates a request to the memory
524 * port for access to the serial EEPROM device. When the memory
525 * port is not busy servicing another request, it reconfigures
526 * to allow access to the serial EEPROM. When this happens, SEERDY
527 * gets set high to verify that the memory port access has been
530 * After successful arbitration for the memory port, the SEECS bit of
531 * the SEECTL register is connected to the chip select. The SEECK,
532 * SEEDO, and SEEDI are connected to the clock, data out, and data in
533 * lines respectively. The SEERDY bit of SEECTL is useful in that it
534 * gives us an 800 nsec timer. After a write to the SEECTL register,
535 * the SEERDY goes high 800 nsec later. The one exception to this is
536 * when we first request access to the memory port. The SEERDY goes
537 * high to signify that access has been granted and, for this case, has
540 * See 93cx6.c for detailed information on the protocol necessary to
541 * read the serial EEPROM.
556 * SCSI Block Control (p. 3-32)
557 * Controls Bus type and channel selection. In a twin channel configuration
558 * addresses 0x00-0x1e are gated to the appropriate channel based on this
559 * register. SELWIDE allows for the coexistence of 8bit and 16bit devices
565 field DIAGLEDEN 0x80 /* Aic78X0 only */
566 field DIAGLEDON 0x40 /* Aic78X0 only */
567 field AUTOFLUSHDIS 0x20
569 field ENAB40 0x08 /* LVD transceiver active */
570 field ENAB20 0x04 /* SE/HVD transceiver active */
572 field XCVR 0x01 /* External transceiver active */
576 * Sequencer Control (p. 3-33)
577 * Error detection mode and speed configuration
587 field BRKADRINTEN 0x08
594 * Sequencer RAM Data (p. 3-34)
595 * Single byte window into the Scratch Ram area starting at the address
596 * specified by SEQADDR0 and SEQADDR1. To write a full word, simply write
597 * four bytes in succession. The SEQADDRs will increment after the most
598 * significant byte is written
607 * Sequencer Address Registers (p. 3-35)
608 * Only the first bit of SEQADDR1 holds addressing information
619 mask SEQADDR1_MASK 0x01
624 * We cheat by passing arguments in the Accumulator up to the kernel driver
693 * Board Control (p. 3-43)
703 * On the aic78X0 chips, Board Control is replaced by the DSCommand
706 register DSCOMMAND0 {
710 field CACHETHEN 0x80 /* Cache Threshold enable */
711 field DPARCKEN 0x40 /* Data Parity Check Enable */
712 field MPARCKEN 0x20 /* Memory Parity Check Enable */
713 field EXTREQLCK 0x10 /* External Request Lock */
714 /* aic7890/91/96/97 only */
715 field INTSCBRAMSEL 0x08 /* Internal SCB RAM Select */
716 field RAMPS 0x04 /* External SCB RAM Present */
717 field USCBSIZE32 0x02 /* Use 32byte SCB Page Size */
718 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
721 register DSCOMMAND1 {
724 mask DSLATT 0xfc /* PCI latency timer (non-ultra2) */
725 field HADDLDSEL1 0x02 /* Host Address Load Select Bits */
726 field HADDLDSEL0 0x01
730 * Bus On/Off Time (p. 3-44) aic7770 only
741 * Bus Speed (p. 3-45) aic7770 only
750 mask DFTHRSH_100 0xc0
754 /* aic7850/55/60/70/80/95 only */
755 register DSPCISTATUS {
758 mask DFTHRSH_100 0xc0
761 /* aic7890/91/96/97 only */
762 register HS_MAILBOX {
764 mask HOST_MAILBOX 0xF0
765 mask SEQ_MAILBOX 0x0F
766 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
769 const HOST_MAILBOX_SHIFT 4
770 const SEQ_MAILBOX_SHIFT 0
773 * Host Control (p. 3-47) R/W
774 * Overall host control of the device.
786 field CHIPRSTACK 0x01
790 * Host Address (p. 3-48)
791 * This register contains the address of the byte about
792 * to be transferred across the host bus.
807 * SCB Pointer (p. 3-49)
808 * Gate one of the SCBs into the SCBARRAY window.
816 * Interrupt Status (p. 3-50)
817 * Status for system interrupts
826 mask BAD_PHASE SEQINT /* unknown scsi bus phase */
827 mask SEND_REJECT 0x10|SEQINT /* sending a message reject */
828 mask PROTO_VIOLATION 0x20|SEQINT /* SCSI protocol violation */
829 mask NO_MATCH 0x30|SEQINT /* no cmd match for reconnect */
830 mask IGN_WIDE_RES 0x40|SEQINT /* Complex IGN Wide Res Msg */
831 mask PDATA_REINIT 0x50|SEQINT /*
832 * Returned to data phase
834 * transfer pointers to be
835 * recalculated from the
838 mask HOST_MSG_LOOP 0x60|SEQINT /*
839 * The bus is ready for the
840 * host to perform another
841 * message transaction. This
842 * mechanism is used for things
843 * like sync/wide negotiation
844 * that require a kernel based
845 * message state engine.
847 mask BAD_STATUS 0x70|SEQINT /* Bad status from target */
848 mask PERR_DETECTED 0x80|SEQINT /*
849 * Either the phase_lock
850 * or inb_next routine has
851 * noticed a parity error.
853 mask DATA_OVERRUN 0x90|SEQINT /*
854 * Target attempted to write
855 * beyond the bounds of its
858 mask MKMSG_FAILED 0xa0|SEQINT /*
859 * Target completed command
860 * without honoring our ATN
861 * request to issue a message.
863 mask MISSED_BUSFREE 0xb0|SEQINT /*
864 * The sequencer never saw
865 * the bus go free after
866 * either a command complete
867 * or disconnect message.
869 mask SCB_MISMATCH 0xc0|SEQINT /*
870 * Downloaded SCB's tag does
871 * not match the entry we
872 * intended to download.
874 mask NO_FREE_SCB 0xd0|SEQINT /*
875 * get_free_or_disc_scb failed.
877 mask OUT_OF_RANGE 0xe0|SEQINT
879 mask SEQINT_MASK 0xf0|SEQINT /* SEQINT Status Codes */
880 mask INT_PEND (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT)
884 * Hard Error (p. 3-53)
885 * Reporting of catastrophic errors. You usually cannot recover from
886 * these without a full board reset.
892 field CIOPARERR 0x80 /* Ultra2 only */
893 field PCIERRSTAT 0x40 /* PCI only */
894 field MPARERR 0x20 /* PCI only */
895 field DPARERR 0x10 /* PCI only */
903 * Clear Interrupt Status (p. 3-52)
909 field CLRPARERR 0x10 /* PCI only */
910 field CLRBRKADRINT 0x08
911 field CLRSCSIINT 0x04
919 field PRELOADEN 0x80 /* aic7890 only */
934 field PRELOAD_AVAIL 0x80
936 field FIFOQWDEMP 0x20
960 * SCB Auto Increment (p. 3-59)
961 * Byte offset into the SCB Array and an optional bit to allow auto
962 * incrementing of the address during download and upload operations
969 mask SCBCNT_MASK 0x1f
973 * Queue In FIFO (p. 3-60)
974 * Input queue for queued SCBs (commands that the seqencer has yet to start)
983 * Queue In Count (p. 3-60)
984 * Number of queued SCBs
992 * Queue Out FIFO (p. 3-61)
993 * Queue of SCBs that have completed and await the host
1001 register CRCCONTROL1 {
1005 field CRCONSEEN 0x80
1006 field CRCVALCHKEN 0x40
1007 field CRCENDCHKEN 0x20
1008 field CRCREQCHKEN 0x10
1009 field TARGCRCENDEN 0x08
1010 field TARGCRCCNTEN 0x04
1015 * Queue Out Count (p. 3-61)
1016 * Number of queued SCBs in the Out FIFO
1023 register SCSIPHASE {
1026 field STATUS_PHASE 0x20
1027 field COMMAND_PHASE 0x10
1028 field MSG_IN_PHASE 0x08
1029 field MSG_OUT_PHASE 0x04
1030 field DATA_IN_PHASE 0x02
1031 field DATA_OUT_PHASE 0x01
1032 mask DATA_PHASE_MASK 0x03
1046 * SCB Definition (p. 5-4)
1054 alias SCB_RESIDUAL_DATACNT
1057 SCB_RESIDUAL_SGPTR {
1066 SCB_TARGET_DATA_DIR {
1077 * The last byte is really the high address bits for
1081 field SG_LAST_SEG 0x80 /* In the fourth byte */
1082 mask SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
1086 field SG_RESID_VALID 0x04 /* In the first byte */
1087 field SG_FULL_RESID 0x02 /* In the first byte */
1088 field SG_LIST_NULL 0x01 /* In the first byte */
1092 field TARGET_SCB 0x80
1093 field STATUS_RCVD 0x80
1096 field MK_MESSAGE 0x10
1098 field DISCONNECTED 0x04
1099 mask SCB_TAG_TYPE 0x03
1103 field TWIN_CHNLB 0x80
1109 field SCB_XFERLEN_ODD 0x80
1137 const SCB_UPLOAD_SIZE 32
1138 const SCB_DOWNLOAD_SIZE 32
1139 const SCB_DOWNLOAD_SIZE_64 48
1141 const SG_SIZEOF 0x08 /* sizeof(struct ahc_dma) */
1143 /* --------------------- AHA-2840-only definitions -------------------- */
1145 register SEECTL_2840 {
1154 register STATUS_2840 {
1158 field EEPROM_TF 0x80
1164 /* --------------------- AIC-7870-only definitions -------------------- */
1187 field SG_FETCH_NEEDED 0x02 /* Bit used for software state */
1188 field CCSGRESET 0x01
1198 field CCSCBDONE 0x80
1199 field ARRDONE 0x40 /* SCB Array prefetch done */
1203 field CCSCBRESET 0x01
1206 register CCSCBADDR {
1215 * SCB bank address (7895/7896/97 only)
1227 register HNSCB_QOFF {
1232 register SNSCB_QOFF {
1236 register SDSCB_QOFF {
1240 register QOFF_CTLSTA {
1242 field SCB_AVAIL 0x40
1243 field SNSCB_ROLLOVER 0x20
1244 field SDSCB_ROLLOVER 0x10
1246 mask SCB_QSIZE_256 0x06
1249 register DFF_THRSH {
1251 mask WR_DFTHRSH 0x70
1252 mask RD_DFTHRSH 0x07
1253 mask RD_DFTHRSH_MIN 0x00
1254 mask RD_DFTHRSH_25 0x01
1255 mask RD_DFTHRSH_50 0x02
1256 mask RD_DFTHRSH_63 0x03
1257 mask RD_DFTHRSH_75 0x04
1258 mask RD_DFTHRSH_85 0x05
1259 mask RD_DFTHRSH_90 0x06
1260 mask RD_DFTHRSH_MAX 0x07
1261 mask WR_DFTHRSH_MIN 0x00
1262 mask WR_DFTHRSH_25 0x10
1263 mask WR_DFTHRSH_50 0x20
1264 mask WR_DFTHRSH_63 0x30
1265 mask WR_DFTHRSH_75 0x40
1266 mask WR_DFTHRSH_85 0x50
1267 mask WR_DFTHRSH_90 0x60
1268 mask WR_DFTHRSH_MAX 0x70
1272 register SG_CACHE_PRE {
1275 mask SG_ADDR_MASK 0xf8
1277 field LAST_SEG_DONE 0x01
1280 register SG_CACHE_SHADOW {
1283 mask SG_ADDR_MASK 0xf8
1285 field LAST_SEG_DONE 0x01
1287 /* ---------------------- Scratch RAM Offsets ------------------------- */
1288 /* These offsets are either to values that are initialized by the board's
1289 * BIOS or are specified by the sequencer code.
1291 * The host adapter card (at least the BIOS) uses 20-2f for SCSI
1292 * device information, 32-33 and 5a-5f as well. As it turns out, the
1293 * BIOS trashes 20-2f, writing the synchronous negotiation results
1294 * on top of the BIOS values, so we re-use those for our per-target
1295 * scratchspace (actually a value that can be copied directly into
1296 * SCSIRATE). The kernel driver will enable synchronous negotiation
1297 * for all targets that have a value other than 0 in the lower four
1298 * bits of the target scratch space. This should work regardless of
1299 * whether the bios has been installed.
1307 * 1 byte per target starting at this address for configuration values
1314 * Bit vector of targets that have ULTRA enabled as set by
1315 * the BIOS. The Sequencer relies on a per-SCB field to
1316 * control whether to enable Ultra transfers or not. During
1317 * initialization, we read this field and reuse it for 2
1318 * entries in the busy target table.
1326 * Bit vector of targets that have disconnection disabled as set by
1327 * the BIOS. The Sequencer relies in a per-SCB field to control the
1328 * disconnect priveldge. During initialization, we read this field
1329 * and reuse it for 2 entries in the busy target table.
1335 CMDSIZE_TABLE_TAIL {
1339 * Partial transfer past cacheline end to be
1340 * transferred using an extra S/G.
1346 * SCBID of the next SCB to be started by the controller.
1352 * Single byte buffer used to designate the type or message
1353 * to send to a target.
1358 /* Parameters for DMA Logic */
1362 field PRELOADEN 0x80
1366 field SDMAENACK 0x10
1368 field HDMAENACK 0x08
1369 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
1370 field FIFOFLUSH 0x02
1371 field FIFORESET 0x01
1375 field NOT_IDENTIFIED 0x80
1376 field NO_CDB_SENT 0x40
1377 field TARGET_CMD_IS_TAGGED 0x40
1380 field TARG_CMD_PENDING 0x10
1381 field CMDPHASE_PENDING 0x08
1382 field DPHASE_PENDING 0x04
1383 field SPHASE_PENDING 0x02
1384 field NO_DISCONNECT 0x01
1387 * Temporary storage for the
1388 * target/channel/lun of a
1389 * reconnecting target
1398 * The last bus phase as seen by the sequencer.
1405 mask PHASE_MASK CDI|IOI|MSGI
1409 mask P_MESGOUT CDI|MSGI
1410 mask P_STATUS CDI|IOI
1411 mask P_MESGIN CDI|IOI|MSGI
1415 * head of list of SCBs awaiting
1422 * head of list of SCBs that are
1423 * disconnected. Used for SCB
1430 * head of list of SCBs that are
1431 * not in use. Used for SCB paging.
1437 * head of list of SCBs that have
1438 * completed but have not been
1439 * put into the qoutfifo.
1445 * Address of the hardware scb array in the host.
1451 * Base address of our shared data with the kernel driver in host
1452 * memory. This includes the qoutfifo and target mode
1453 * incoming command queue.
1468 * Kernel and sequencer offsets into the queue of
1469 * incoming target mode command descriptors. The
1470 * queue is full when the KERNEL_TQINPOS == TQINPOS.
1482 mask SEND_SENSE 0x40
1484 mask MSGOUT_PHASEMIS 0x10
1485 mask EXIT_MSG_LOOP 0x08
1486 mask CONT_MSG_LOOP 0x04
1487 mask CONT_TARG_SESSION 0x02
1496 * Snapshot of MSG_OUT taken after each message is sent.
1500 alias TARG_IMMEDIATE_SCB
1504 * Sequences the kernel driver has okayed for us. This allows
1505 * the driver to do things like prevent initiator or target
1513 field ENAUTOATNO 0x08
1514 field ENAUTOATNI 0x04
1515 field ENAUTOATNP 0x02
1523 * These scratch ram locations are initialized by the 274X BIOS.
1524 * We reuse them after capturing the BIOS settings during
1529 * The initiator specified tag for this target mode transaction.
1533 field HA_274_EXTENDED_TRANS 0x01
1541 field TARGET_MSG_PENDING 0x02
1549 * These are reserved registers in the card's scratch ram on the 2742.
1550 * The EISA configuraiton chip is mapped here. On Rev E. of the
1551 * aic7770, the sequencer can use this area for scratch, but the
1552 * host cannot directly access these registers. On later chips, this
1553 * area can be read and written by both the host and the sequencer.
1554 * Even on later chips, many of these locations are initialized by
1561 field RESET_SCSI 0x40
1563 mask HSCSIID 0x07 /* our SCSI ID */
1564 mask HWSCSIID 0x0f /* our SCSI ID if Wide Bus */
1570 field EDGE_TRIG 0x80
1583 mask BIOSDISABLED 0x30
1584 field CHANNEL_B_PRIMARY 0x08
1593 * Per target SCSI offset values for Ultra2 controllers.
1602 const SCB_LIST_NULL 0xff
1603 const TARGET_CMD_CMPLT 0xfe
1605 const CCSGADDR_MAX 0x80
1606 const CCSGRAM_MAXSEGS 16
1608 /* WDTR Message values */
1609 const BUS_8_BIT 0x00
1610 const BUS_16_BIT 0x01
1611 const BUS_32_BIT 0x02
1613 /* Offset maximums */
1614 const MAX_OFFSET_8BIT 0x0f
1615 const MAX_OFFSET_16BIT 0x08
1616 const MAX_OFFSET_ULTRA2 0x7f
1617 const MAX_OFFSET 0x7f
1620 /* Target mode command processing constants */
1621 const CMD_GROUP_CODE_SHIFT 0x05
1623 const STATUS_BUSY 0x08
1624 const STATUS_QUEUE_FULL 0x28
1625 const TARGET_DATA_IN 1
1628 * Downloaded (kernel inserted) constants
1630 /* Offsets into the SCBID array where different data is stored */
1631 const QOUTFIFO_OFFSET download
1632 const QINFIFO_OFFSET download
1633 const CACHESIZE_MASK download
1634 const INVERTED_CACHESIZE_MASK download
1635 const SG_PREFETCH_CNT download
1636 const SG_PREFETCH_ALIGN_MASK download
1637 const SG_PREFETCH_ADDR_MASK download