2 * Aic79xx register and scratch ram definitions.
4 * Copyright (c) 1994-2001 Justin T. Gibbs.
5 * Copyright (c) 2000-2002 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/aic79xx.reg#70 $"
45 * This file is processed by the aic7xxx_asm utility for use in assembling
46 * firmware for the aic79xx family of SCSI host adapters as well as to generate
47 * a C header file for use in the kernel portion of the Aic79xx driver.
50 /* Register window Modes */
58 #define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))
59 #define SET_MODE(src, dst) \
62 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
63 mvi MK_MODE(src, dst) call set_mode_work_around; \
65 mvi MODE_PTR, MK_MODE(src, dst); \
68 #define TOGGLE_DFF_MODE \
69 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
70 call toggle_dff_mode_work_around; \
72 xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); \
75 #define RESTORE_MODE(mode) \
76 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
77 mov mode call set_mode_work_around; \
82 #define SET_SEQINTCODE(code) \
83 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { \
84 mvi code call set_seqint_work_around; \
86 mvi SEQINTCODE, code; \
91 * Controls which of the 5, 512byte, address spaces should be used
92 * as the source and destination of any register accesses in our
103 const SRC_MODE_SHIFT 0
104 const DST_MODE_SHIFT 4
107 * Host Interrupt Status
124 * Sequencer Interrupt Code
126 register SEQINTCODE {
130 NO_SEQINT, /* No seqint pending. */
131 BAD_PHASE, /* unknown scsi bus phase */
132 SEND_REJECT, /* sending a message reject */
133 PROTO_VIOLATION, /* Protocol Violation */
134 NO_MATCH, /* no cmd match for reconnect */
135 IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
137 * Returned to data phase
139 * transfer pointers to be
140 * recalculated from the
144 * The bus is ready for the
145 * host to perform another
146 * message transaction. This
147 * mechanism is used for things
148 * like sync/wide negotiation
149 * that require a kernel based
150 * message state engine.
152 BAD_STATUS, /* Bad status from target */
154 * Target attempted to write
155 * beyond the bounds of its
159 * Target completed command
160 * without honoring our ATN
161 * request to issue a message.
164 * The sequencer never saw
165 * the bus go free after
166 * either a command complete
167 * or disconnect message.
176 TASKMGMT_FUNC_COMPLETE, /*
177 * Task management function
178 * request completed with
179 * an expected busfree.
181 TASKMGMT_CMD_CMPLT_OKAY, /*
182 * A command with a non-zero
183 * task management function
184 * has completed via the normal
185 * command completion method
186 * for commands with a zero
187 * task management function.
188 * This happens when an attempt
189 * to abort a command loses
190 * the race for the command to
203 * Clear Host Interrupt
208 field CLRHWERRINT 0x80 /* Rev B or greater */
209 field CLRBRKADRINT 0x40
210 field CLRSWTMINT 0x20
212 field CLRSCSIINT 0x08
215 field CLRSPLTINT 0x01
225 field CIOACCESFAIL 0x40 /* Rev B or greater */
239 field CLRCIOPARERR 0x80
240 field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
241 field CLRMPARERR 0x20
242 field CLRDPARERR 0x10
243 field CLRSQPARERR 0x08
244 field CLRILLOPCODE 0x04
245 field CLRDSCTMOUT 0x02
249 * Host Control Register
250 * Overall host control of the device.
255 field SEQ_RESET 0x80 /* Rev B or greater */
258 field SWTIMER_START_B 0x08 /* Rev B or greater */
262 field CHIPRSTACK 0x01
266 * Host New SCB Queue Offset
268 register HNSCB_QOFF {
275 * Host Empty SCB Queue Offset
277 register HESCB_QOFF {
285 register HS_MAILBOX {
288 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
289 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
293 * Sequencer Interupt Status
295 register SEQINTSTAT {
298 field SEQ_SWTMRTO 0x10
299 field SEQ_SEQINT 0x08
300 field SEQ_SCSIINT 0x04
301 field SEQ_PCIINT 0x02
302 field SEQ_SPLTINT 0x01
306 * Clear SEQ Interrupt
308 register CLRSEQINTSTAT {
311 field CLRSEQ_SWTMRTO 0x10
312 field CLRSEQ_SEQINT 0x08
313 field CLRSEQ_SCSIINT 0x04
314 field CLRSEQ_PCIINT 0x02
315 field CLRSEQ_SPLTINT 0x01
328 * SEQ New SCB Queue Offset
330 register SNSCB_QOFF {
338 * SEQ Empty SCB Queue Offset
340 register SESCB_QOFF {
347 * SEQ Done SCB Queue Offset
349 register SDSCB_QOFF {
357 * Queue Offset Control & Status
359 register QOFF_CTLSTA {
363 field EMPTY_SCB_AVAIL 0x80
364 field NEW_SCB_AVAIL 0x40
365 field SDSCB_ROLLOVR 0x20
366 field HS_MAILBOX_ACT 0x10
367 field SCB_QSIZE 0x0F {
390 field SWTMINTMASK 0x80
392 field SWTIMER_START 0x20
393 field AUTOCLRCMDINT 0x10
408 field SCSIENWRDIS 0x40 /* Rev B only. */
414 field DIRECTIONACK 0x04
416 field FIFOFLUSHACK 0x02
417 field DIRECTIONEN 0x01
421 * Device Space Command 0
423 register DSCOMMAND0 {
427 field CACHETHEN 0x80 /* Cache Threshold enable */
428 field DPARCKEN 0x40 /* Data Parity Check Enable */
429 field MPARCKEN 0x20 /* Memory Parity Check Enable */
430 field EXTREQLCK 0x10 /* External Request Lock */
431 field DISABLE_TWATE 0x02 /* Rev B or greater */
432 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
442 field PRELOAD_AVAIL 0x80
443 field PKT_PRELOAD_AVAIL 0x40
454 register SG_CACHE_PRE {
458 field SG_ADDR_MASK 0xf8
463 register SG_CACHE_SHADOW {
467 field SG_ADDR_MASK 0xf8
470 field LAST_SEG_DONE 0x01
480 field RESET_HARB 0x80
481 field RETRY_SWEN 0x08
486 * Data Channel Host Address
496 * Host Overlay DMA Address
513 field SPLIT_DROP_REQ 0x80
517 * Data Channel Host Count
527 * Host Overlay DMA Count
537 * Host Overlay DMA Enable
546 * Scatter/Gather Host Address
566 * Scatter/Gather Host Count
584 * Data FIFO Threshold
590 field WR_DFTHRSH 0x70 {
600 field RD_DFTHRSH 0x07 {
642 * Data Channel Receive Message 0
653 * CMC Recieve Message 0
664 * Overlay Recieve Message 0
666 register OVLYRXMSG0 {
675 * Relaxed Order Enable
690 * Data Channel Receive Message 1
700 * CMC Recieve Message 1
710 * Overlay Recieve Message 1
712 register OVLYRXMSG1 {
735 * Data Channel Receive Message 2
745 * CMC Recieve Message 2
755 * Overlay Recieve Message 2
757 register OVLYRXMSG2 {
765 * Outstanding Split Transactions
774 * Data Channel Receive Message 3
784 * CMC Recieve Message 3
794 * Overlay Recieve Message 3
796 register OVLYRXMSG3 {
811 field UNEXPSCIEN 0x20
812 field SPLTSMADIS 0x10
813 field SPLTSTADIS 0x08
820 * CMC Sequencer Byte Count
822 register CMCSEQBCNT {
829 * Overlay Sequencer Byte Count
831 register OVLYSEQBCNT {
838 * Data Channel Sequencer Byte Count
840 register DCHSEQBCNT {
848 * Data Channel Split Status 0
850 register DCHSPLTSTAT0 {
857 field SCDATBUCKET 0x10
858 field CNTNOTCMPLT 0x08
867 register CMCSPLTSTAT0 {
874 field SCDATBUCKET 0x10
875 field CNTNOTCMPLT 0x08
882 * Overlay Split Status 0
884 register OVLYSPLTSTAT0 {
891 field SCDATBUCKET 0x10
892 field CNTNOTCMPLT 0x08
899 * Data Channel Split Status 1
901 register DCHSPLTSTAT1 {
905 field RXDATABUCKET 0x01
911 register CMCSPLTSTAT1 {
915 field RXDATABUCKET 0x01
919 * Overlay Split Status 1
921 register OVLYSPLTSTAT1 {
925 field RXDATABUCKET 0x01
929 * S/G Receive Message 0
940 * S/G Receive Message 1
950 * S/G Receive Message 2
960 * S/G Receive Message 3
970 * Slave Split Out Address 0
972 register SLVSPLTOUTADR0 {
976 field LOWER_ADDR 0x7F
980 * Slave Split Out Address 1
982 register SLVSPLTOUTADR1 {
991 * Slave Split Out Address 2
993 register SLVSPLTOUTADR2 {
1001 * Slave Split Out Address 3
1003 register SLVSPLTOUTADR3 {
1012 * SG Sequencer Byte Count
1014 register SGSEQBCNT {
1017 modes M_DFF0, M_DFF1
1021 * Slave Split Out Attribute 0
1023 register SLVSPLTOUTATTR0 {
1027 field LOWER_BCNT 0xFF
1031 * Slave Split Out Attribute 1
1033 register SLVSPLTOUTATTR1 {
1037 field CMPLT_DNUM 0xF8
1038 field CMPLT_FNUM 0x07
1042 * Slave Split Out Attribute 2
1044 register SLVSPLTOUTATTR2 {
1049 field CMPLT_BNUM 0xFF
1052 * S/G Split Status 0
1054 register SGSPLTSTAT0 {
1057 modes M_DFF0, M_DFF1
1061 field SCDATBUCKET 0x10
1062 field CNTNOTCMPLT 0x08
1065 field RXSPLTRSP 0x01
1069 * S/G Split Status 1
1071 register SGSPLTSTAT1 {
1074 modes M_DFF0, M_DFF1
1075 field RXDATABUCKET 0x01
1085 field TEST_GROUP 0xF0
1090 * Data FIFO 0 PCI Status
1092 register DF0PCISTAT {
1107 * Data FIFO 1 PCI Status
1109 register DF1PCISTAT {
1126 register SGPCISTAT {
1142 register CMCPCISTAT {
1157 * Overlay PCI Status
1159 register OVLYPCISTAT {
1173 * PCI Status for MSI Master DMA Transfer
1175 register MSIPCISTAT {
1182 field CLRPENDMSI 0x08
1188 * PCI Status for Target
1190 register TARGPCISTAT {
1202 * The last LQ Packet received
1208 modes M_DFF0, M_DFF1, M_SCSI
1213 * SCB offset for Target Mode SCB type information
1223 * SCB offset to the Two Byte tag identifier used for target mode.
1232 * Logical Unit Number Pointer
1233 * SCB offset to the LSB (little endian) of the lun field.
1242 * Data Length Pointer
1243 * SCB offset for the 4 byte data length field in target mode.
1245 register DATALENPTR {
1252 * Status Length Pointer
1253 * SCB offset to the two byte status field in target SCBs.
1255 register STATLENPTR {
1262 * Command Length Pointer
1263 * Scb offset for the CDB length field in initiator SCBs.
1265 register CMDLENPTR {
1272 * Task Attribute Pointer
1273 * Scb offset for the byte field specifying the attribute byte
1274 * to be used in command packets.
1283 * Task Management Flags Pointer
1284 * Scb offset for the byte field specifying the attribute flags
1285 * byte to be used in command packets.
1295 * Scb offset for the first byte in the CDB for initiator SCBs.
1304 * Queue Next Pointer
1305 * Scb offset for the 2 byte "next scb link".
1315 * Scb offset to the value to place in the SCSIID register
1316 * during target mode connections.
1325 * Command Aborted Byte Pointer
1326 * Offset to the SCB flags field that includes the
1327 * "SCB aborted" status bit.
1329 register ABRTBYTEPTR {
1336 * Command Aborted Bit Pointer
1337 * Bit offset in the SCB flags field for "SCB aborted" status.
1339 register ABRTBITPTR {
1348 register MAXCMDBYTES {
1357 register MAXCMD2RCV {
1366 register SHORTTHRESH {
1373 * Logical Unit Number Length
1374 * The length, in bytes, of the SCB lun field.
1383 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1387 * The size, in bytes, of the embedded CDB field in initator SCBs.
1397 * The maximum number of commands to issue during a
1398 * single packetized connection.
1407 * Maximum Command Counter
1408 * The number of commands already sent during this connection
1410 register MAXCMDCNT {
1417 * LQ Packet Reserved Bytes
1418 * The bytes to be sent in the currently reserved fileds
1419 * of all LQ packets.
1438 * Command Reserved 0
1439 * The byte to be sent for the reserved byte 0 of
1440 * outgoing command packets.
1449 * LQ Manager Control 0
1455 field LQITARGCLT 0xC0
1456 field LQIINITGCLT 0x30
1457 field LQ0TARGCLT 0x0C
1458 field LQ0INITGCLT 0x03
1462 * LQ Manager Control 1
1467 modes M_DFF0, M_DFF1, M_SCSI
1469 field SINGLECMD 0x02
1470 field ABORTPENDING 0x01
1474 * LQ Manager Control 2
1479 modes M_DFF0, M_DFF1, M_SCSI
1481 field LQICONTINUE 0x40
1482 field LQITOIDLE 0x20
1485 field LQOCONTINUE 0x04
1486 field LQOTOIDLE 0x02
1497 field GSBISTERR 0x40
1498 field GSBISTDONE 0x20
1499 field GSBISTRUN 0x10
1500 field OSBISTERR 0x04
1501 field OSBISTDONE 0x02
1502 field OSBISTRUN 0x01
1506 * SCSI Sequence Control0
1511 modes M_DFF0, M_DFF1, M_SCSI
1515 field FORCEBUSFREE 0x10
1526 field NTBISTERR 0x04
1527 field NTBISTDONE 0x02
1528 field NTBISTRUN 0x01
1532 * SCSI Sequence Control 1
1537 modes M_DFF0, M_DFF1, M_SCSI
1538 field MANUALCTL 0x40
1542 field ENAUTOATNP 0x02
1547 * SCSI Transfer Control 0
1555 field BIOSCANCELEN 0x10
1560 * SCSI Transfer Control 1
1566 field BITBUCKET 0x80
1576 * SCSI Transfer Control 2
1582 field AUTORSTDIS 0x10
1588 * SCSI Bus Initiator IDs
1589 * Bitmask of observed initiators on the bus.
1591 register BUSINITID {
1599 * Data Length Counters
1600 * Packet byte counter.
1605 modes M_DFF0, M_DFF1
1616 field FIFO1FREE 0x20
1617 field FIFO0FREE 0x10
1619 * On the B, this enum only works
1620 * in the read direction. For writes,
1621 * you must use the B version of the
1622 * CURRFIFO_0 definition which is defined
1623 * as a constant outside of this register
1624 * definition to avoid confusing the
1625 * register pretty printing code.
1627 enum CURRFIFO 0x03 {
1634 const B_CURRFIFO_0 0x2
1637 * SCSI Bus Target IDs
1638 * Bitmask of observed targets on the bus.
1640 register BUSTARGID {
1648 * SCSI Control Signal Out
1653 modes M_DFF0, M_DFF1, M_SCSI
1663 * Possible phases to write into SCSISIG0
1665 enum PHASE_MASK CDO|IOO|MSGO {
1668 P_DATAOUT_DT P_DATAOUT|MSGO,
1669 P_DATAIN_DT P_DATAIN|MSGO,
1673 P_MESGIN CDO|IOO|MSGO
1680 modes M_DFF0, M_DFF1, M_SCSI
1690 * Possible phases in SCSISIGI
1692 enum PHASE_MASK CDO|IOO|MSGO {
1695 P_DATAOUT_DT P_DATAOUT|MSGO,
1696 P_DATAIN_DT P_DATAIN|MSGO,
1700 P_MESGIN CDO|IOO|MSGO
1705 * Multiple Target IDs
1706 * Bitmask of ids to respond as a target.
1708 register MULTARGID {
1718 register SCSIPHASE {
1721 modes M_DFF0, M_DFF1, M_SCSI
1722 field STATUS_PHASE 0x20
1723 field COMMAND_PHASE 0x10
1724 field MSG_IN_PHASE 0x08
1725 field MSG_OUT_PHASE 0x04
1726 field DATA_PHASE_MASK 0x03 {
1727 DATA_OUT_PHASE 0x01,
1735 register SCSIDAT0_IMG {
1738 modes M_DFF0, M_DFF1, M_SCSI
1747 modes M_DFF0, M_DFF1, M_SCSI
1757 modes M_DFF0, M_DFF1, M_SCSI
1767 modes M_DFF0, M_DFF1, M_SCSI
1773 * Selection/Reselection ID
1774 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1775 * device did not set its own ID.
1780 modes M_DFF0, M_DFF1, M_SCSI
1781 field SELID_MASK 0xf0
1786 * SCSI Block Control
1787 * Controls Bus type and channel selection. SELWIDE allows for the
1788 * coexistence of 8bit and 16bit devices on a wide bus.
1793 modes M_DFF0, M_DFF1, M_SCSI
1794 field DIAGLEDEN 0x80
1795 field DIAGLEDON 0x40
1796 field ENAB40 0x08 /* LVD transceiver active */
1797 field ENAB20 0x04 /* SE/HVD transceiver active */
1804 register OPTIONMODE {
1808 field BIOSCANCTL 0x80
1809 field AUTOACKEN 0x40
1810 field BIASCANCTL 0x20
1811 field BUSFREEREV 0x10
1812 field ENDGFORMCHK 0x04
1813 field AUTO_MSGOUT_DE 0x02
1814 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1823 modes M_DFF0, M_DFF1, M_SCSI
1824 field TARGET 0x80 /* Board acting as target */
1825 field SELDO 0x40 /* Selection Done */
1826 field SELDI 0x20 /* Board has been selected */
1827 field SELINGO 0x10 /* Selection In Progress */
1828 field IOERR 0x08 /* LVD Tranceiver mode changed */
1829 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1830 field SPIORDY 0x02 /* SCSI PIO Ready */
1831 field ARBDO 0x01 /* Arbitration Done Out */
1835 * Clear SCSI Interrupt 0
1836 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1841 modes M_DFF0, M_DFF1, M_SCSI
1844 field CLRSELINGO 0x10
1846 field CLROVERRUN 0x04
1847 field CLRSPIORDY 0x02
1852 * SCSI Interrupt Mode 0
1853 * Setting any bit will enable the corresponding function
1854 * in SIMODE0 to interrupt via the IRQ pin.
1862 field ENSELINGO 0x10
1864 field ENOVERRUN 0x04
1865 field ENSPIORDY 0x02
1875 modes M_DFF0, M_DFF1, M_SCSI
1882 field STRB2FAST 0x02
1887 * Clear SCSI Interrupt 1
1888 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1893 modes M_DFF0, M_DFF1, M_SCSI
1894 field CLRSELTIMEO 0x80
1896 field CLRSCSIRSTI 0x20
1897 field CLRBUSFREE 0x08
1898 field CLRSCSIPERR 0x04
1899 field CLRSTRB2FAST 0x02
1900 field CLRREQINIT 0x01
1909 modes M_DFF0, M_DFF1, M_SCSI
1910 field BUSFREETIME 0xc0 {
1915 field NONPACKREQ 0x20
1916 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
1917 field BSYX 0x08 /* Busy Expander */
1918 field WIDE_RES 0x04 /* Modes 0 and 1 only */
1919 field SDONE 0x02 /* Modes 0 and 1 only */
1920 field DMADONE 0x01 /* Modes 0 and 1 only */
1924 * Clear SCSI Interrupt 2
1929 modes M_DFF0, M_DFF1, M_SCSI
1930 field CLRNONPACKREQ 0x20
1931 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
1932 field CLRSDONE 0x02 /* Modes 0 and 1 only */
1933 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
1937 * SCSI Interrupt Mode 2
1943 field ENWIDE_RES 0x04
1945 field ENDMADONE 0x01
1949 * Physical Error Diagnosis
1954 modes M_DFF0, M_DFF1, M_SCSI
1957 field PREVPHASE 0x20
1958 field PARITYERR 0x10
1961 field DGFORMERR 0x02
1966 * LQI Manager Current State
1980 modes M_DFF0, M_DFF1, M_SCSI
1984 * LQO Manager Current State
1993 * LQI Manager Status
1998 modes M_DFF0, M_DFF1, M_SCSI
1999 field LQIATNQAS 0x20
2002 field LQIBADLQT 0x04
2004 field LQIATNCMD 0x01
2008 * Clear LQI Interrupts 0
2010 register CLRLQIINT0 {
2013 modes M_DFF0, M_DFF1, M_SCSI
2014 field CLRLQIATNQAS 0x20
2015 field CLRLQICRCT1 0x10
2016 field CLRLQICRCT2 0x08
2017 field CLRLQIBADLQT 0x04
2018 field CLRLQIATNLQ 0x02
2019 field CLRLQIATNCMD 0x01
2023 * LQI Manager Interrupt Mode 0
2029 field ENLQIATNQASK 0x20
2030 field ENLQICRCT1 0x10
2031 field ENLQICRCT2 0x08
2032 field ENLQIBADLQT 0x04
2033 field ENLQIATNLQ 0x02
2034 field ENLQIATNCMD 0x01
2038 * LQI Manager Status 1
2043 modes M_DFF0, M_DFF1, M_SCSI
2044 field LQIPHASE_LQ 0x80
2045 field LQIPHASE_NLQ 0x40
2047 field LQICRCI_LQ 0x10
2048 field LQICRCI_NLQ 0x08
2049 field LQIBADLQI 0x04
2050 field LQIOVERI_LQ 0x02
2051 field LQIOVERI_NLQ 0x01
2055 * Clear LQI Manager Interrupts1
2057 register CLRLQIINT1 {
2060 modes M_DFF0, M_DFF1, M_SCSI
2061 field CLRLQIPHASE_LQ 0x80
2062 field CLRLQIPHASE_NLQ 0x40
2063 field CLRLIQABORT 0x20
2064 field CLRLQICRCI_LQ 0x10
2065 field CLRLQICRCI_NLQ 0x08
2066 field CLRLQIBADLQI 0x04
2067 field CLRLQIOVERI_LQ 0x02
2068 field CLRLQIOVERI_NLQ 0x01
2072 * LQI Manager Interrupt Mode 1
2078 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2079 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2080 field ENLIQABORT 0x20
2081 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2082 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2083 field ENLQIBADLQI 0x04
2084 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2085 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2089 * LQI Manager Status 2
2094 modes M_DFF0, M_DFF1, M_SCSI
2095 field PACKETIZED 0x80
2096 field LQIPHASE_OUTPKT 0x40
2097 field LQIWORKONLQ 0x20
2098 field LQIWAITFIFO 0x10
2099 field LQISTOPPKT 0x08
2100 field LQISTOPLQ 0x04
2101 field LQISTOPCMD 0x02
2102 field LQIGSAVAIL 0x01
2111 modes M_DFF0, M_DFF1, M_SCSI
2112 field NTRAMPERR 0x02
2113 field OSRAMPERR 0x01
2117 * Clear SCSI Status 3
2122 modes M_DFF0, M_DFF1, M_SCSI
2123 field CLRNTRAMPERR 0x02
2124 field CLROSRAMPERR 0x01
2128 * SCSI Interrupt Mode 3
2134 field ENNTRAMPERR 0x02
2135 field ENOSRAMPERR 0x01
2139 * LQO Manager Status 0
2144 modes M_DFF0, M_DFF1, M_SCSI
2145 field LQOTARGSCBPERR 0x10
2146 field LQOSTOPT2 0x08
2148 field LQOATNPKT 0x02
2153 * Clear LQO Manager interrupt 0
2155 register CLRLQOINT0 {
2158 modes M_DFF0, M_DFF1, M_SCSI
2159 field CLRLQOTARGSCBPERR 0x10
2160 field CLRLQOSTOPT2 0x08
2161 field CLRLQOATNLQ 0x04
2162 field CLRLQOATNPKT 0x02
2163 field CLRLQOTCRC 0x01
2167 * LQO Manager Interrupt Mode 0
2173 field ENLQOTARGSCBPERR 0x10
2174 field ENLQOSTOPT2 0x08
2175 field ENLQOATNLQ 0x04
2176 field ENLQOATNPKT 0x02
2177 field ENLQOTCRC 0x01
2181 * LQO Manager Status 1
2186 modes M_DFF0, M_DFF1, M_SCSI
2187 field LQOINITSCBPERR 0x10
2188 field LQOSTOPI2 0x08
2189 field LQOBADQAS 0x04
2190 field LQOBUSFREE 0x02
2191 field LQOPHACHGINPKT 0x01
2195 * Clear LOQ Interrupt 1
2197 register CLRLQOINT1 {
2200 modes M_DFF0, M_DFF1, M_SCSI
2201 field CLRLQOINITSCBPERR 0x10
2202 field CLRLQOSTOPI2 0x08
2203 field CLRLQOBADQAS 0x04
2204 field CLRLQOBUSFREE 0x02
2205 field CLRLQOPHACHGINPKT 0x01
2209 * LQO Manager Interrupt Mode 1
2215 field ENLQOINITSCBPERR 0x10
2216 field ENLQOSTOPI2 0x08
2217 field ENLQOBADQAS 0x04
2218 field ENLQOBUSFREE 0x02
2219 field ENLQOPHACHGINPKT 0x01
2223 * LQO Manager Status 2
2228 modes M_DFF0, M_DFF1, M_SCSI
2230 field LQOWAITFIFO 0x10
2231 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2232 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2236 * Output Synchronizer Space Count
2238 register OS_SPACE_CNT {
2245 * SCSI Interrupt Mode 1
2246 * Setting any bit will enable the corresponding function
2247 * in SIMODE1 to interrupt via the IRQ pin.
2252 modes M_DFF0, M_DFF1, M_SCSI
2253 field ENSELTIMO 0x80
2254 field ENATNTARG 0x40
2255 field ENSCSIRST 0x20
2256 field ENPHASEMIS 0x10
2257 field ENBUSFREE 0x08
2258 field ENSCSIPERR 0x04
2259 field ENSTRB2FAST 0x02
2260 field ENREQINIT 0x01
2270 modes M_DFF0, M_DFF1, M_SCSI
2274 * Data FIFO SCSI Transfer Control
2276 register DFFSXFRCTL {
2279 modes M_DFF0, M_DFF1
2280 field DFFBITBUCKET 0x08
2287 * Next SCSI Control Block
2297 register LQOSCSCTL {
2302 field LQOH2A_VERSION 0x80
2303 field LQONOCHKOVER 0x01
2309 register SEQINTSRC {
2312 modes M_DFF0, M_DFF1
2316 field CFG4ISTAT 0x08
2317 field CFG4TSTAT 0x04
2323 * Clear Arp Interrupts
2325 register CLRSEQINTSRC {
2328 modes M_DFF0, M_DFF1
2329 field CLRCTXTDONE 0x40
2330 field CLRSAVEPTRS 0x20
2331 field CLRCFG4DATA 0x10
2332 field CLRCFG4ISTAT 0x08
2333 field CLRCFG4TSTAT 0x04
2334 field CLRCFG4ICMD 0x02
2335 field CLRCFG4TCMD 0x01
2339 * SEQ Interrupt Enabled (Shared)
2344 modes M_DFF0, M_DFF1
2345 field ENCTXTDONE 0x40
2346 field ENSAVEPTRS 0x20
2347 field ENCFG4DATA 0x10
2348 field ENCFG4ISTAT 0x08
2349 field ENCFG4TSTAT 0x04
2350 field ENCFG4ICMD 0x02
2351 field ENCFG4TCMD 0x01
2355 * Current SCSI Control Block
2370 modes M_DFF0, M_DFF1
2371 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2372 field SHCNTMINUS1 0x20 /* Rev B or higher */
2373 field LASTSDONE 0x10
2375 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2376 field DATAINFIFO 0x02
2383 register CRCCONTROL {
2387 field CRCVALCHKEN 0x40
2398 field SEL_TXPLL_DEBUG 0x04
2402 * Data FIFO Queue Tag
2408 modes M_DFF0, M_DFF1
2412 * Last SCSI Control Block
2422 * SCSI I/O Cell Power-down Control
2428 field DISABLE_OE 0x80
2429 field PDN_IDIST 0x04
2430 field PDN_DIFFSENSE 0x01
2434 * Shaddow Host Address.
2440 modes M_DFF0, M_DFF1
2444 * Data Group CRC Interval.
2454 * Data Transfer Negotiation Address
2463 * Data Transfer Negotiation Data - Period Byte
2465 register NEGPERIOD {
2472 * Packetized CRC Interval
2482 * Data Transfer Negotiation Data - Offset Byte
2484 register NEGOFFSET {
2491 * Data Transfer Negotiation Data - PPR Options
2493 register NEGPPROPTS {
2497 field PPROPT_PACE 0x08
2498 field PPROPT_QAS 0x04
2499 field PPROPT_DT 0x02
2500 field PPROPT_IUT 0x01
2504 * Data Transfer Negotiation Data - Connection Options
2506 register NEGCONOPTS {
2510 field ENSNAPSHOT 0x40
2511 field RTI_WRTDIS 0x20
2512 field RTI_OVRDTRN 0x10
2513 field ENSLOWCRC 0x08
2514 field ENAUTOATNI 0x04
2515 field ENAUTOATNO 0x02
2520 * Negotiation Table Annex Column Index.
2532 field STSELSKIDDIS 0x40
2533 field CURRFIFODEF 0x20
2534 field WIDERESEN 0x10
2535 field SDONEMSKDIS 0x08
2536 field DFFACTCLR 0x04
2537 field SHVALIDSTDIS 0x02
2538 field LSTSGCLRDIS 0x01
2541 const AHD_ANNEXCOL_PER_DEV0 4
2542 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2543 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2544 const AHD_PRECOMP_MASK 0x07
2545 const AHD_PRECOMP_SHIFT 0
2546 const AHD_PRECOMP_CUTBACK_17 0x04
2547 const AHD_PRECOMP_CUTBACK_29 0x06
2548 const AHD_PRECOMP_CUTBACK_37 0x07
2549 const AHD_SLEWRATE_MASK 0x78
2550 const AHD_SLEWRATE_SHIFT 3
2552 * Rev A has only a single bit (high bit of field) of slew adjustment.
2553 * Rev B has 4 bits. The current default happens to be the same for both.
2555 const AHD_SLEWRATE_DEF_REVA 0x08
2556 const AHD_SLEWRATE_DEF_REVB 0x08
2558 /* Rev A does not have any amplitude setting. */
2559 const AHD_ANNEXCOL_AMPLITUDE 6
2560 const AHD_AMPLITUDE_MASK 0x7
2561 const AHD_AMPLITUDE_SHIFT 0
2562 const AHD_AMPLITUDE_DEF 0x7
2565 * Negotiation Table Annex Data Port.
2574 * Initiator's Own Id.
2575 * The SCSI ID to use for Selection Out and seen during a reselection..
2584 * 960MHz Phase-Locked Loop Control 0
2586 register PLL960CTL0 {
2590 field PLL_VCOSEL 0x80
2593 field PLL_ENLUD 0x08
2594 field PLL_ENLPF 0x04
2596 field PLL_ENFBM 0x01
2609 * 960MHz Phase-Locked Loop Control 1
2611 register PLL960CTL1 {
2615 field PLL_CNTEN 0x80
2616 field PLL_CNTCLR 0x40
2621 * Expander Signature
2636 modes M_DFF0, M_DFF1
2649 * 960-MHz Phase-Locked Loop Test Count
2651 register PLL960CNT0 {
2659 * 400-MHz Phase-Locked Loop Control 0
2661 register PLL400CTL0 {
2665 field PLL_VCOSEL 0x80
2668 field PLL_ENLUD 0x08
2669 field PLL_ENLPF 0x04
2671 field PLL_ENFBM 0x01
2675 * Arbitration Fairness
2685 * 400-MHz Phase-Locked Loop Control 1
2687 register PLL400CTL1 {
2691 field PLL_CNTEN 0x80
2692 field PLL_CNTCLR 0x40
2697 * Arbitration Unfairness
2699 register UNFAIRNESS {
2707 * 400-MHz Phase-Locked Loop Test Count
2709 register PLL400CNT0 {
2723 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2727 * CMC SCB Array Count
2728 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2729 * Transfers must be 8byte aligned and sized.
2731 register CCSCBACNT {
2739 * SCB-Next Address Snooping logic. When an SCB is transferred to
2740 * the card, the next SCB address to be used by the CMC array can
2741 * be autoloaded from that transfer.
2743 register SCBAUTOPTR {
2747 field AUSCBPTR_EN 0x80
2748 field SCBPTR_ADDR 0x38
2749 field SCBPTR_OFF 0x07
2753 * CMC SG Ram Address Pointer
2758 modes M_DFF0, M_DFF1
2762 * CMC SCB RAM Address Pointer
2764 register CCSCBADDR {
2771 * CMC SCB Ram Back-up Address Pointer
2772 * Indicates the true stop location of transfers halted prior
2773 * to SCBHCNT going to 0.
2775 register CCSCBADR_BK {
2787 modes M_DFF0, M_DFF1
2789 field SG_CACHE_AVAIL 0x10
2790 field CCSGENACK 0x08
2792 field SG_FETCH_REQ 0x02
2793 field CCSGRESET 0x01
2803 field CCSCBDONE 0x80
2808 field CCSCBRESET 0x01
2814 register CMC_RAMBIST {
2818 field SG_ELEMENT_SIZE 0x80
2819 field SCBRAMBIST_FAIL 0x40
2820 field SG_BIST_FAIL 0x20
2821 field SG_BIST_EN 0x10
2822 field CMC_BUFFER_BIST_FAIL 0x02
2823 field CMC_BUFFER_BIST_EN 0x01
2827 * CMC SG RAM Data Port
2832 modes M_DFF0, M_DFF1
2836 * CMC SCB RAM Data Port
2855 * Flex DMA Byte Count
2867 register FLEXDMASTAT {
2871 field FLEXDMAERR 0x02
2872 field FLEXDMADONE 0x01
2876 * Flex DMA Data Port
2900 field FLXARBACK 0x80
2901 field FLXARBREQ 0x40
2909 * Serial EEPROM Address
2918 * Serial EEPROM Data
2928 * Serial EEPROM Status
2934 field INIT_DONE 0x80
2935 field SEEOPCODE 0x70
2936 field LDALTID_L 0x08
2937 field SEEARBACK 0x04
2943 * Serial EEPROM Control
2949 field SEEOPCODE 0x70 {
2954 * The following four commands use special
2955 * addresses for differentiation.
2959 mask SEEOP_EWEN 0x40
2960 mask SEEOP_WALL 0x40
2961 mask SEEOP_EWDS 0x40
2966 const SEEOP_ERAL_ADDR 0x80
2967 const SEEOP_EWEN_ADDR 0xC0
2968 const SEEOP_WRAL_ADDR 0x40
2969 const SEEOP_EWDS_ADDR 0x00
2981 * Data FIFO Write Address
2982 * Pointer to the next QWD location to be written to the data FIFO.
2988 modes M_DFF0, M_DFF1
2992 * DSP Filter Control
2994 register DSPFLTRCTL {
2998 field FLTRDISABLE 0x20
2999 field EDGESENSE 0x10
3000 field DSPFCNTSEL 0x0F
3004 * DSP Data Channel Control
3006 register DSPDATACTL {
3010 field BYPASSENAB 0x80
3012 field RCVROFFSTDIS 0x04
3013 field XMITOFFSTDIS 0x02
3017 * Data FIFO Read Address
3018 * Pointer to the next QWD location to be read from the data FIFO.
3024 modes M_DFF0, M_DFF1
3030 register DSPREQCTL {
3034 field MANREQCTL 0xC0
3035 field MANREQDLY 0x3F
3041 register DSPACKCTL {
3045 field MANACKCTL 0xC0
3046 field MANACKDLY 0x3F
3051 * Read/Write byte port into the data FIFO. The read and write
3052 * FIFO pointers increment with each read and write respectively
3058 modes M_DFF0, M_DFF1
3062 * DSP Channel Select
3064 register DSPSELECT {
3068 field AUTOINCEN 0x80
3075 * Write Bias Control
3077 register WRTBIASCTL {
3081 field AUTOXBCDIS 0x80
3082 field XMITMANVAL 0x3F
3086 * Currently the WRTBIASCTL is the same as the default.
3088 const WRTBIASCTL_HP_DEFAULT 0x0
3091 * Receiver Bias Control
3093 register RCVRBIOSCTL {
3097 field AUTORBCDIS 0x80
3098 field RCVRMANVAL 0x3F
3102 * Write Bias Calculator
3104 register WRTBIASCALC {
3111 * Data FIFO Pointers
3112 * Contains the byte offset from DFWADDR and DWRADDR to the current
3113 * FIFO write/read locations.
3118 modes M_DFF0, M_DFF1
3122 * Receiver Bias Calculator
3124 register RCVRBIASCALC {
3131 * Data FIFO Backup Read Pointer
3132 * Contains the data FIFO address to be restored if the last
3133 * data accessed from the data FIFO was not transferred successfully.
3139 modes M_DFF0, M_DFF1
3152 * Data FIFO Debug Control
3157 modes M_DFF0, M_DFF1
3158 field DFF_CIO_WR_RDY 0x20
3159 field DFF_CIO_RD_RDY 0x10
3160 field DFF_DIR_ERR 0x08
3161 field DFF_RAMBIST_FAIL 0x04
3162 field DFF_RAMBIST_DONE 0x02
3163 field DFF_RAMBIST_EN 0x01
3167 * Data FIFO Space Count
3168 * Number of FIFO locations that are free.
3174 modes M_DFF0, M_DFF1
3178 * Data FIFO Byte Count
3179 * Number of filled FIFO locations.
3185 modes M_DFF0, M_DFF1
3189 * Sequencer Program Overlay Address.
3190 * Low address must be written prior to high address.
3200 * Sequencer Control 0
3201 * Error detection mode, speed configuration,
3202 * single step, breakpoints and program load.
3207 field PERRORDIS 0x80
3211 field BRKADRINTEN 0x08
3218 * Sequencer Control 1
3219 * Instruction RAM Diagnostics
3224 field OVRLAY_DATA_CHK 0x08
3225 field RAMBIST_DONE 0x04
3226 field RAMBIST_FAIL 0x02
3227 field RAMBIST_EN 0x01
3232 * Zero and Carry state of the ALU.
3242 * Sequencer Interrupt Control
3244 register SEQINTCTL {
3247 field INTVEC1DSL 0x80
3248 field INT1_CONTEXT 0x20
3249 field SCS_SEQ_INT1M1 0x10
3250 field SCS_SEQ_INT1M0 0x08
3257 * Sequencer RAM Data Port
3258 * Single byte window into the Sequencer Instruction Ram area starting
3259 * at the address specified by OVLYADDR. To write a full instruction word,
3260 * simply write four bytes in succession. OVLYADDR will increment after the
3261 * most significant instrution byte (the byte with the parity bit) is written.
3269 * Sequencer Program Counter
3270 * Low byte must be written prior to high byte.
3288 * Source Index Register
3289 * Incrementing index for reads of SINDIR and the destination (low byte only)
3290 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3292 * mvi 0xFF call some_routine;
3294 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3304 * Destination Index Register
3305 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3315 * Sequencer instruction breakpoint address address.
3325 field BRKDIS 0x80 /* Disable Breakpoint */
3330 * All reads to this register return the value 0xFF.
3340 * All reads to this register return the value 0.
3350 * Writes to this register have no effect.
3359 * Source Index Indirect
3360 * Reading this register is equivalent to reading (register_base + SINDEX) and
3361 * incrementing SINDEX by 1.
3369 * Destination Index Indirect
3370 * Writing this register is equivalent to writing to (register_base + DINDEX)
3371 * and incrementing DINDEX by 1.
3380 * 2's complement to bit value conversion. Write the 2's complement value
3381 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3382 * on the next read of this register.
3387 register FUNCTION1 {
3394 * Window into the stack. Each stack location is 10 bits wide reported
3395 * low byte followed by high byte. There are 8 stack locations.
3403 * Interrupt Vector 1 Address
3404 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3406 register INTVEC1_ADDR {
3415 * Address of the SEQRAM instruction currently executing instruction.
3425 * Interrupt Vector 2 Address
3426 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3428 register INTVEC2_ADDR {
3437 * Address of the SEQRAM instruction executed prior to the current instruction.
3446 register AHD_PCI_CONFIG_BASE {
3453 /* ---------------------- Scratch RAM Offsets ------------------------- */
3470 field SEGS_AVAIL 0x01
3471 field LOADING_NEEDED 0x02
3472 field FETCH_INPROG 0x04
3475 * Track whether the transfer byte count for
3476 * the current data phase is odd.
3502 * Per "other-id" execution queues. We use an array of
3503 * tail pointers into lists of SCBs sorted by "other-id".
3504 * The execution head pointer threads the head SCBs for
3517 * SCBID of the next SCB in the new SCB queue.
3519 NEXT_QUEUED_SCB_ADDR {
3523 * head of list of SCBs that have
3524 * completed but have not been
3525 * put into the qoutfifo.
3531 * The list of completed SCBs in
3534 COMPLETE_SCB_DMAINPROG_HEAD {
3538 * head of list of SCBs that have
3539 * completed but need to be uploaded
3540 * to the host prior to being completed.
3542 COMPLETE_DMA_SCB_HEAD {
3545 /* Counting semaphore to prevent new select-outs */
3550 * Mode to restore on legacy idle loop exit.
3556 * Single byte buffer used to designate the type or message
3557 * to send to a target.
3562 /* Parameters for DMA Logic */
3565 field PRELOADEN 0x80
3569 field SDMAENACK 0x10
3571 field HDMAENACK 0x08
3572 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3573 field FIFOFLUSH 0x02
3574 field FIFORESET 0x01
3578 field NOT_IDENTIFIED 0x80
3579 field NO_CDB_SENT 0x40
3580 field TARGET_CMD_IS_TAGGED 0x40
3583 field TARG_CMD_PENDING 0x10
3584 field CMDPHASE_PENDING 0x08
3585 field DPHASE_PENDING 0x04
3586 field SPHASE_PENDING 0x02
3587 field NO_DISCONNECT 0x01
3590 * Temporary storage for the
3591 * target/channel/lun of a
3592 * reconnecting target
3601 * The last bus phase as seen by the sequencer.
3608 field P_BUSFREE 0x01
3609 enum PHASE_MASK CDO|IOO|MSGO {
3612 P_DATAOUT_DT P_DATAOUT|MSGO,
3613 P_DATAIN_DT P_DATAIN|MSGO,
3617 P_MESGIN CDO|IOO|MSGO
3621 * Value to "or" into the SCBPTR[1] value to
3622 * indicate that an entry in the QINFIFO is valid.
3624 QOUTFIFO_ENTRY_VALID_TAG {
3628 * Base address of our shared data with the kernel driver in host
3629 * memory. This includes the qoutfifo and target mode
3630 * incoming command queue.
3636 * Pointer to location in host memory for next
3637 * position in the qoutfifo.
3639 QOUTFIFO_NEXT_ADDR {
3643 * Kernel and sequencer offsets into the queue of
3644 * incoming target mode command descriptors. The
3645 * queue is full when the KERNEL_TQINPOS == TQINPOS.
3656 mask SEND_SENSE 0x40
3658 mask MSGOUT_PHASEMIS 0x10
3659 mask EXIT_MSG_LOOP 0x08
3660 mask CONT_MSG_LOOP_WRITE 0x04
3661 mask CONT_MSG_LOOP_READ 0x03
3662 mask CONT_MSG_LOOP_TARG 0x02
3671 * Snapshot of MSG_OUT taken after each message is sent.
3678 * Sequences the kernel driver has okayed for us. This allows
3679 * the driver to do things like prevent initiator or target
3684 field MANUALCTL 0x40
3688 field ENAUTOATNP 0x02
3693 * The initiator specified tag for this target mode transaction.
3701 field TARGET_MSG_PENDING 0x02
3702 field SELECTOUT_QFROZEN 0x04
3710 * The maximum amount of time to wait, when interrupt coalescing
3711 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3714 INT_COALESCING_TIMER {
3719 * The maximum number of commands to coalesce into a single interrupt.
3720 * Actually the 2's complement of that value to simplify sequencer
3723 INT_COALESCING_MAXCMDS {
3728 * The minimum number of commands still outstanding required
3729 * to continue coalescing (2's complement of value).
3731 INT_COALESCING_MINCMDS {
3736 * Number of commands "in-flight".
3743 * The count of commands that have been coalesced.
3745 INT_COALESCING_CMDCOUNT {
3750 * Since the HS_MAIBOX is self clearing, copy its contents to
3751 * this position in scratch ram every time it changes.
3757 * Target-mode CDB type to CDB length table used
3758 * in non-packetized operation.
3765 /************************* Hardware SCB Definition ****************************/
3770 SCB_RESIDUAL_DATACNT {
3773 alias SCB_HOST_CDB_PTR
3775 SCB_RESIDUAL_SGPTR {
3777 field SG_ADDR_MASK 0xf8 /* In the last byte */
3778 field SG_OVERRUN_RESID 0x02 /* In the first byte */
3779 field SG_LIST_NULL 0x01 /* In the first byte */
3783 alias SCB_HOST_CDB_LEN
3788 SCB_TARGET_DATA_DIR {
3796 * Only valid if CDB length is less than 13 bytes or
3797 * we are using a CDB pointer. Otherwise contains
3798 * the last 4 bytes of embedded cdb information.
3801 alias SCB_NEXT_COMPLETE
3804 alias SCB_FIFO_USE_COUNT
3809 field TARGET_SCB 0x80
3812 field MK_MESSAGE 0x10
3813 field STATUS_RCVD 0x08
3814 field DISCONNECTED 0x04
3815 field SCB_TAG_TYPE 0x03
3826 SCB_TASK_ATTRIBUTE {
3829 * Overloaded field for non-packetized
3830 * ignore wide residue message handling.
3832 field SCB_XFERLEN_ODD 0x01
3836 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
3838 SCB_TASK_MANAGEMENT {
3846 * The last byte is really the high address bits for
3850 field SG_LAST_SEG 0x80 /* In the fourth byte */
3851 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
3855 field SG_STATUS_VALID 0x04 /* In the first byte */
3856 field SG_FULL_RESID 0x02 /* In the first byte */
3857 field SG_LIST_NULL 0x01 /* In the first byte */
3863 alias SCB_NEXT_SCB_BUSADDR
3873 SCB_DISCONNECTED_LISTS {
3878 /*********************************** Constants ********************************/
3879 const MK_MESSAGE_BIT_OFFSET 4
3881 const TARGET_CMD_CMPLT 0xfe
3882 const INVALID_ADDR 0x80
3883 #define SCB_LIST_NULL 0xff
3884 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
3886 const CCSGADDR_MAX 0x80
3887 const CCSCBADDR_MAX 0x80
3888 const CCSGRAM_MAXSEGS 16
3890 /* Selection Timeout Timer Constants */
3891 const STIMESEL_SHIFT 3
3892 const STIMESEL_MIN 0x18
3893 const STIMESEL_BUG_ADJ 0x8
3895 /* WDTR Message values */
3896 const BUS_8_BIT 0x00
3897 const BUS_16_BIT 0x01
3898 const BUS_32_BIT 0x02
3900 /* Offset maximums */
3901 const MAX_OFFSET 0xfe
3902 const MAX_OFFSET_PACED 0xfe
3903 const MAX_OFFSET_PACED_BUG 0x7f
3905 * Some 160 devices incorrectly accept 0xfe as a
3906 * sync offset, but will overrun this value. Limit
3907 * to 0x7f for speed lower than U320 which will
3908 * avoid the persistent sync offset overruns.
3910 const MAX_OFFSET_NON_PACED 0x7f
3914 * The size of our sense buffers.
3915 * Sense buffer mapping can be handled in either of two ways.
3916 * The first is to allocate a dmamap for each transaction.
3917 * Depending on the architecture, dmamaps can be costly. The
3918 * alternative is to statically map the buffers in much the same
3919 * way we handle our scatter gather lists. The driver implements
3922 const AHD_SENSE_BUFSIZE 256
3924 /* Target mode command processing constants */
3925 const CMD_GROUP_CODE_SHIFT 0x05
3927 const STATUS_BUSY 0x08
3928 const STATUS_QUEUE_FULL 0x28
3929 const STATUS_PKT_SENSE 0xFF
3930 const TARGET_DATA_IN 1
3932 const SCB_TRANSFER_SIZE_FULL_LUN 56
3933 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
3934 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
3935 const PKT_OVERRUN_BUFSIZE 512
3940 const AHD_TIMER_US_PER_TICK 25
3941 const AHD_TIMER_MAX_TICKS 0xFFFF
3942 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
3945 * Downloaded (kernel inserted) constants
3947 const SG_PREFETCH_CNT download
3948 const SG_PREFETCH_CNT_LIMIT download
3949 const SG_PREFETCH_ALIGN_MASK download
3950 const SG_PREFETCH_ADDR_MASK download
3951 const SG_SIZEOF download
3952 const PKT_OVERRUN_BUFOFFSET download
3953 const SCB_TRANSFER_SIZE download
3958 const NVRAM_SCB_OFFSET 0x2C