2 * Aic79xx register and scratch ram definitions.
4 * Copyright (c) 1994-2001, 2004 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#77 $"
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 RESTORE_MODE(mode) \
69 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
70 mov mode call set_mode_work_around; \
75 #define SET_SEQINTCODE(code) \
76 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { \
77 mvi code call set_seqint_work_around; \
79 mvi SEQINTCODE, code; \
84 * Controls which of the 5, 512byte, address spaces should be used
85 * as the source and destination of any register accesses in our
96 const SRC_MODE_SHIFT 0
97 const DST_MODE_SHIFT 4
100 * Host Interrupt Status
117 * Sequencer Interrupt Code
119 register SEQINTCODE {
123 NO_SEQINT, /* No seqint pending. */
124 BAD_PHASE, /* unknown scsi bus phase */
125 SEND_REJECT, /* sending a message reject */
126 PROTO_VIOLATION, /* Protocol Violation */
127 NO_MATCH, /* no cmd match for reconnect */
128 IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
130 * Returned to data phase
132 * transfer pointers to be
133 * recalculated from the
137 * The bus is ready for the
138 * host to perform another
139 * message transaction. This
140 * mechanism is used for things
141 * like sync/wide negotiation
142 * that require a kernel based
143 * message state engine.
145 BAD_STATUS, /* Bad status from target */
147 * Target attempted to write
148 * beyond the bounds of its
152 * Target completed command
153 * without honoring our ATN
154 * request to issue a message.
157 * The sequencer never saw
158 * the bus go free after
159 * either a command complete
160 * or disconnect message.
169 TASKMGMT_FUNC_COMPLETE, /*
170 * Task management function
171 * request completed with
172 * an expected busfree.
174 TASKMGMT_CMD_CMPLT_OKAY, /*
175 * A command with a non-zero
176 * task management function
177 * has completed via the normal
178 * command completion method
179 * for commands with a zero
180 * task management function.
181 * This happens when an attempt
182 * to abort a command loses
183 * the race for the command to
196 * Clear Host Interrupt
202 field CLRHWERRINT 0x80 /* Rev B or greater */
203 field CLRBRKADRINT 0x40
204 field CLRSWTMINT 0x20
206 field CLRSCSIINT 0x08
209 field CLRSPLTINT 0x01
219 field CIOACCESFAIL 0x40 /* Rev B or greater */
233 field CLRCIOPARERR 0x80
234 field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
235 field CLRMPARERR 0x20
236 field CLRDPARERR 0x10
237 field CLRSQPARERR 0x08
238 field CLRILLOPCODE 0x04
239 field CLRDSCTMOUT 0x02
243 * Host Control Register
244 * Overall host control of the device.
250 field SEQ_RESET 0x80 /* Rev B or greater */
253 field SWTIMER_START_B 0x08 /* Rev B or greater */
257 field CHIPRSTACK 0x01
261 * Host New SCB Queue Offset
263 register HNSCB_QOFF {
271 * Host Empty SCB Queue Offset
273 register HESCB_QOFF {
282 register HS_MAILBOX {
285 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
286 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
290 * Sequencer Interupt Status
292 register SEQINTSTAT {
296 field SEQ_SWTMRTO 0x10
297 field SEQ_SEQINT 0x08
298 field SEQ_SCSIINT 0x04
299 field SEQ_PCIINT 0x02
300 field SEQ_SPLTINT 0x01
304 * Clear SEQ Interrupt
306 register CLRSEQINTSTAT {
309 field CLRSEQ_SWTMRTO 0x10
310 field CLRSEQ_SEQINT 0x08
311 field CLRSEQ_SCSIINT 0x04
312 field CLRSEQ_PCIINT 0x02
313 field CLRSEQ_SPLTINT 0x01
326 * SEQ New SCB Queue Offset
328 register SNSCB_QOFF {
336 * SEQ Empty SCB Queue Offset
338 register SESCB_QOFF {
346 * SEQ Done SCB Queue Offset
348 register SDSCB_QOFF {
356 * Queue Offset Control & Status
358 register QOFF_CTLSTA {
362 field EMPTY_SCB_AVAIL 0x80
363 field NEW_SCB_AVAIL 0x40
364 field SDSCB_ROLLOVR 0x20
365 field HS_MAILBOX_ACT 0x10
366 field SCB_QSIZE 0x0F {
389 field SWTMINTMASK 0x80
391 field SWTIMER_START 0x20
392 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 {
428 field CACHETHEN 0x80 /* Cache Threshold enable */
429 field DPARCKEN 0x40 /* Data Parity Check Enable */
430 field MPARCKEN 0x20 /* Memory Parity Check Enable */
431 field EXTREQLCK 0x10 /* External Request Lock */
432 field DISABLE_TWATE 0x02 /* Rev B or greater */
433 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
443 field PRELOAD_AVAIL 0x80
444 field PKT_PRELOAD_AVAIL 0x40
455 register SG_CACHE_PRE {
459 field SG_ADDR_MASK 0xf8
464 register SG_CACHE_SHADOW {
468 field SG_ADDR_MASK 0xf8
471 field LAST_SEG_DONE 0x01
481 field RESET_HARB 0x80
482 field RETRY_SWEN 0x08
487 * Data Channel Host Address
497 * Host Overlay DMA Address
514 field SPLIT_DROP_REQ 0x80
518 * Data Channel Host Count
528 * Host Overlay DMA Count
538 * Host Overlay DMA Enable
547 * Scatter/Gather Host Address
567 * Scatter/Gather Host Count
585 * Data FIFO Threshold
592 field WR_DFTHRSH 0x70 {
602 field RD_DFTHRSH 0x07 {
644 * Data Channel Receive Message 0
655 * CMC Recieve Message 0
666 * Overlay Recieve Message 0
668 register OVLYRXMSG0 {
677 * Relaxed Order Enable
692 * Data Channel Receive Message 1
702 * CMC Recieve Message 1
712 * Overlay Recieve Message 1
714 register OVLYRXMSG1 {
737 * Data Channel Receive Message 2
747 * CMC Recieve Message 2
757 * Overlay Recieve Message 2
759 register OVLYRXMSG2 {
767 * Outstanding Split Transactions
776 * Data Channel Receive Message 3
786 * CMC Recieve Message 3
796 * Overlay Recieve Message 3
798 register OVLYRXMSG3 {
814 field UNEXPSCIEN 0x20
815 field SPLTSMADIS 0x10
816 field SPLTSTADIS 0x08
823 * CMC Sequencer Byte Count
825 register CMCSEQBCNT {
832 * Overlay Sequencer Byte Count
834 register OVLYSEQBCNT {
841 * Data Channel Sequencer Byte Count
843 register DCHSEQBCNT {
851 * Data Channel Split Status 0
853 register DCHSPLTSTAT0 {
861 field SCDATBUCKET 0x10
862 field CNTNOTCMPLT 0x08
871 register CMCSPLTSTAT0 {
878 field SCDATBUCKET 0x10
879 field CNTNOTCMPLT 0x08
886 * Overlay Split Status 0
888 register OVLYSPLTSTAT0 {
895 field SCDATBUCKET 0x10
896 field CNTNOTCMPLT 0x08
903 * Data Channel Split Status 1
905 register DCHSPLTSTAT1 {
910 field RXDATABUCKET 0x01
916 register CMCSPLTSTAT1 {
920 field RXDATABUCKET 0x01
924 * Overlay Split Status 1
926 register OVLYSPLTSTAT1 {
930 field RXDATABUCKET 0x01
934 * S/G Receive Message 0
945 * S/G Receive Message 1
955 * S/G Receive Message 2
965 * S/G Receive Message 3
975 * Slave Split Out Address 0
977 register SLVSPLTOUTADR0 {
981 field LOWER_ADDR 0x7F
985 * Slave Split Out Address 1
987 register SLVSPLTOUTADR1 {
996 * Slave Split Out Address 2
998 register SLVSPLTOUTADR2 {
1006 * Slave Split Out Address 3
1008 register SLVSPLTOUTADR3 {
1017 * SG Sequencer Byte Count
1019 register SGSEQBCNT {
1022 modes M_DFF0, M_DFF1
1026 * Slave Split Out Attribute 0
1028 register SLVSPLTOUTATTR0 {
1032 field LOWER_BCNT 0xFF
1036 * Slave Split Out Attribute 1
1038 register SLVSPLTOUTATTR1 {
1042 field CMPLT_DNUM 0xF8
1043 field CMPLT_FNUM 0x07
1047 * Slave Split Out Attribute 2
1049 register SLVSPLTOUTATTR2 {
1054 field CMPLT_BNUM 0xFF
1057 * S/G Split Status 0
1059 register SGSPLTSTAT0 {
1062 modes M_DFF0, M_DFF1
1067 field SCDATBUCKET 0x10
1068 field CNTNOTCMPLT 0x08
1071 field RXSPLTRSP 0x01
1075 * S/G Split Status 1
1077 register SGSPLTSTAT1 {
1080 modes M_DFF0, M_DFF1
1082 field RXDATABUCKET 0x01
1092 field TEST_GROUP 0xF0
1097 * Data FIFO 0 PCI Status
1099 register DF0PCISTAT {
1115 * Data FIFO 1 PCI Status
1117 register DF1PCISTAT {
1134 register SGPCISTAT {
1150 register CMCPCISTAT {
1165 * Overlay PCI Status
1167 register OVLYPCISTAT {
1181 * PCI Status for MSI Master DMA Transfer
1183 register MSIPCISTAT {
1190 field CLRPENDMSI 0x08
1196 * PCI Status for Target
1198 register TARGPCISTAT {
1211 * The last LQ Packet recieved
1218 modes M_DFF0, M_DFF1, M_SCSI
1223 * SCB offset for Target Mode SCB type information
1233 * SCB offset to the Two Byte tag identifier used for target mode.
1242 * Logical Unit Number Pointer
1243 * SCB offset to the LSB (little endian) of the lun field.
1253 * Data Length Pointer
1254 * SCB offset for the 4 byte data length field in target mode.
1256 register DATALENPTR {
1263 * Status Length Pointer
1264 * SCB offset to the two byte status field in target SCBs.
1266 register STATLENPTR {
1273 * Command Length Pointer
1274 * Scb offset for the CDB length field in initiator SCBs.
1276 register CMDLENPTR {
1284 * Task Attribute Pointer
1285 * Scb offset for the byte field specifying the attribute byte
1286 * to be used in command packets.
1296 * Task Management Flags Pointer
1297 * Scb offset for the byte field specifying the attribute flags
1298 * byte to be used in command packets.
1309 * Scb offset for the first byte in the CDB for initiator SCBs.
1319 * Queue Next Pointer
1320 * Scb offset for the 2 byte "next scb link".
1331 * Scb offset to the value to place in the SCSIID register
1332 * during target mode connections.
1341 * Command Aborted Byte Pointer
1342 * Offset to the SCB flags field that includes the
1343 * "SCB aborted" status bit.
1345 register ABRTBYTEPTR {
1353 * Command Aborted Bit Pointer
1354 * Bit offset in the SCB flags field for "SCB aborted" status.
1356 register ABRTBITPTR {
1366 register MAXCMDBYTES {
1375 register MAXCMD2RCV {
1384 register SHORTTHRESH {
1391 * Logical Unit Number Length
1392 * The length, in bytes, of the SCB lun field.
1402 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1406 * The size, in bytes, of the embedded CDB field in initator SCBs.
1417 * The maximum number of commands to issue during a
1418 * single packetized connection.
1428 * Maximum Command Counter
1429 * The number of commands already sent during this connection
1431 register MAXCMDCNT {
1438 * LQ Packet Reserved Bytes
1439 * The bytes to be sent in the currently reserved fileds
1440 * of all LQ packets.
1459 * Command Reserved 0
1460 * The byte to be sent for the reserved byte 0 of
1461 * outgoing command packets.
1470 * LQ Manager Control 0
1476 field LQITARGCLT 0xC0
1477 field LQIINITGCLT 0x30
1478 field LQ0TARGCLT 0x0C
1479 field LQ0INITGCLT 0x03
1483 * LQ Manager Control 1
1488 modes M_DFF0, M_DFF1, M_SCSI
1491 field SINGLECMD 0x02
1492 field ABORTPENDING 0x01
1496 * LQ Manager Control 2
1501 modes M_DFF0, M_DFF1, M_SCSI
1504 field LQICONTINUE 0x40
1505 field LQITOIDLE 0x20
1508 field LQOCONTINUE 0x04
1509 field LQOTOIDLE 0x02
1520 field GSBISTERR 0x40
1521 field GSBISTDONE 0x20
1522 field GSBISTRUN 0x10
1523 field OSBISTERR 0x04
1524 field OSBISTDONE 0x02
1525 field OSBISTRUN 0x01
1529 * SCSI Sequence Control0
1534 modes M_DFF0, M_DFF1, M_SCSI
1538 field FORCEBUSFREE 0x10
1549 field NTBISTERR 0x04
1550 field NTBISTDONE 0x02
1551 field NTBISTRUN 0x01
1555 * SCSI Sequence Control 1
1560 modes M_DFF0, M_DFF1, M_SCSI
1562 field MANUALCTL 0x40
1566 field ENAUTOATNP 0x02
1571 * SCSI Transfer Control 0
1579 field BIOSCANCELEN 0x10
1584 * SCSI Transfer Control 1
1590 field BITBUCKET 0x80
1600 * SCSI Transfer Control 2
1606 field AUTORSTDIS 0x10
1612 * SCSI Bus Initiator IDs
1613 * Bitmask of observed initiators on the bus.
1615 register BUSINITID {
1623 * Data Length Counters
1624 * Packet byte counter.
1629 modes M_DFF0, M_DFF1
1640 field FIFO1FREE 0x20
1641 field FIFO0FREE 0x10
1643 * On the B, this enum only works
1644 * in the read direction. For writes,
1645 * you must use the B version of the
1646 * CURRFIFO_0 definition which is defined
1647 * as a constant outside of this register
1648 * definition to avoid confusing the
1649 * register pretty printing code.
1651 enum CURRFIFO 0x03 {
1658 const B_CURRFIFO_0 0x2
1661 * SCSI Bus Target IDs
1662 * Bitmask of observed targets on the bus.
1664 register BUSTARGID {
1672 * SCSI Control Signal Out
1677 modes M_DFF0, M_DFF1, M_SCSI
1687 * Possible phases to write into SCSISIG0
1689 enum PHASE_MASK CDO|IOO|MSGO {
1692 P_DATAOUT_DT P_DATAOUT|MSGO,
1693 P_DATAIN_DT P_DATAIN|MSGO,
1697 P_MESGIN CDO|IOO|MSGO
1702 * SCSI Control Signal In
1707 modes M_DFF0, M_DFF1, M_SCSI
1717 * Possible phases in SCSISIGI
1719 enum PHASE_MASK CDO|IOO|MSGO {
1722 P_DATAOUT_DT P_DATAOUT|MSGO,
1723 P_DATAIN_DT P_DATAIN|MSGO,
1727 P_MESGIN CDO|IOO|MSGO
1732 * Multiple Target IDs
1733 * Bitmask of ids to respond as a target.
1735 register MULTARGID {
1746 register SCSIPHASE {
1749 modes M_DFF0, M_DFF1, M_SCSI
1750 field STATUS_PHASE 0x20
1751 field COMMAND_PHASE 0x10
1752 field MSG_IN_PHASE 0x08
1753 field MSG_OUT_PHASE 0x04
1754 field DATA_PHASE_MASK 0x03 {
1755 DATA_OUT_PHASE 0x01,
1763 register SCSIDAT0_IMG {
1766 modes M_DFF0, M_DFF1, M_SCSI
1775 modes M_DFF0, M_DFF1, M_SCSI
1785 modes M_DFF0, M_DFF1, M_SCSI
1795 modes M_DFF0, M_DFF1, M_SCSI
1802 * Selection/Reselection ID
1803 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1804 * device did not set its own ID.
1809 modes M_DFF0, M_DFF1, M_SCSI
1810 field SELID_MASK 0xf0
1815 * SCSI Block Control
1816 * Controls Bus type and channel selection. SELWIDE allows for the
1817 * coexistence of 8bit and 16bit devices on a wide bus.
1822 modes M_DFF0, M_DFF1, M_SCSI
1823 field DIAGLEDEN 0x80
1824 field DIAGLEDON 0x40
1825 field ENAB40 0x08 /* LVD transceiver active */
1826 field ENAB20 0x04 /* SE/HVD transceiver active */
1833 register OPTIONMODE {
1838 field BIOSCANCTL 0x80
1839 field AUTOACKEN 0x40
1840 field BIASCANCTL 0x20
1841 field BUSFREEREV 0x10
1842 field ENDGFORMCHK 0x04
1843 field AUTO_MSGOUT_DE 0x02
1844 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1853 modes M_DFF0, M_DFF1, M_SCSI
1854 field TARGET 0x80 /* Board acting as target */
1855 field SELDO 0x40 /* Selection Done */
1856 field SELDI 0x20 /* Board has been selected */
1857 field SELINGO 0x10 /* Selection In Progress */
1858 field IOERR 0x08 /* LVD Tranceiver mode changed */
1859 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1860 field SPIORDY 0x02 /* SCSI PIO Ready */
1861 field ARBDO 0x01 /* Arbitration Done Out */
1865 * Clear SCSI Interrupt 0
1866 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1871 modes M_DFF0, M_DFF1, M_SCSI
1874 field CLRSELINGO 0x10
1876 field CLROVERRUN 0x04
1877 field CLRSPIORDY 0x02
1882 * SCSI Interrupt Mode 0
1883 * Setting any bit will enable the corresponding function
1884 * in SIMODE0 to interrupt via the IRQ pin.
1893 field ENSELINGO 0x10
1895 field ENOVERRUN 0x04
1896 field ENSPIORDY 0x02
1906 modes M_DFF0, M_DFF1, M_SCSI
1913 field STRB2FAST 0x02
1918 * Clear SCSI Interrupt 1
1919 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1924 modes M_DFF0, M_DFF1, M_SCSI
1925 field CLRSELTIMEO 0x80
1927 field CLRSCSIRSTI 0x20
1928 field CLRBUSFREE 0x08
1929 field CLRSCSIPERR 0x04
1930 field CLRSTRB2FAST 0x02
1931 field CLRREQINIT 0x01
1940 modes M_DFF0, M_DFF1, M_SCSI
1941 field BUSFREETIME 0xc0 {
1946 field NONPACKREQ 0x20
1947 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
1948 field BSYX 0x08 /* Busy Expander */
1949 field WIDE_RES 0x04 /* Modes 0 and 1 only */
1950 field SDONE 0x02 /* Modes 0 and 1 only */
1951 field DMADONE 0x01 /* Modes 0 and 1 only */
1955 * Clear SCSI Interrupt 2
1960 modes M_DFF0, M_DFF1, M_SCSI
1961 field CLRNONPACKREQ 0x20
1962 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
1963 field CLRSDONE 0x02 /* Modes 0 and 1 only */
1964 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
1968 * SCSI Interrupt Mode 2
1974 field ENWIDE_RES 0x04
1976 field ENDMADONE 0x01
1980 * Physical Error Diagnosis
1985 modes M_DFF0, M_DFF1, M_SCSI
1989 field PREVPHASE 0x20
1990 field PARITYERR 0x10
1993 field DGFORMERR 0x02
1998 * LQI Manager Current State
2013 modes M_DFF0, M_DFF1, M_SCSI
2018 * LQO Manager Current State
2028 * LQI Manager Status
2033 modes M_DFF0, M_DFF1, M_SCSI
2035 field LQIATNQAS 0x20
2038 field LQIBADLQT 0x04
2040 field LQIATNCMD 0x01
2044 * Clear LQI Interrupts 0
2046 register CLRLQIINT0 {
2049 modes M_DFF0, M_DFF1, M_SCSI
2051 field CLRLQIATNQAS 0x20
2052 field CLRLQICRCT1 0x10
2053 field CLRLQICRCT2 0x08
2054 field CLRLQIBADLQT 0x04
2055 field CLRLQIATNLQ 0x02
2056 field CLRLQIATNCMD 0x01
2060 * LQI Manager Interrupt Mode 0
2067 field ENLQIATNQASK 0x20
2068 field ENLQICRCT1 0x10
2069 field ENLQICRCT2 0x08
2070 field ENLQIBADLQT 0x04
2071 field ENLQIATNLQ 0x02
2072 field ENLQIATNCMD 0x01
2076 * LQI Manager Status 1
2081 modes M_DFF0, M_DFF1, M_SCSI
2083 field LQIPHASE_LQ 0x80
2084 field LQIPHASE_NLQ 0x40
2086 field LQICRCI_LQ 0x10
2087 field LQICRCI_NLQ 0x08
2088 field LQIBADLQI 0x04
2089 field LQIOVERI_LQ 0x02
2090 field LQIOVERI_NLQ 0x01
2094 * Clear LQI Manager Interrupts1
2096 register CLRLQIINT1 {
2099 modes M_DFF0, M_DFF1, M_SCSI
2101 field CLRLQIPHASE_LQ 0x80
2102 field CLRLQIPHASE_NLQ 0x40
2103 field CLRLIQABORT 0x20
2104 field CLRLQICRCI_LQ 0x10
2105 field CLRLQICRCI_NLQ 0x08
2106 field CLRLQIBADLQI 0x04
2107 field CLRLQIOVERI_LQ 0x02
2108 field CLRLQIOVERI_NLQ 0x01
2112 * LQI Manager Interrupt Mode 1
2119 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2120 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2121 field ENLIQABORT 0x20
2122 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2123 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2124 field ENLQIBADLQI 0x04
2125 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2126 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2130 * LQI Manager Status 2
2135 modes M_DFF0, M_DFF1, M_SCSI
2136 field PACKETIZED 0x80
2137 field LQIPHASE_OUTPKT 0x40
2138 field LQIWORKONLQ 0x20
2139 field LQIWAITFIFO 0x10
2140 field LQISTOPPKT 0x08
2141 field LQISTOPLQ 0x04
2142 field LQISTOPCMD 0x02
2143 field LQIGSAVAIL 0x01
2152 modes M_DFF0, M_DFF1, M_SCSI
2154 field NTRAMPERR 0x02
2155 field OSRAMPERR 0x01
2159 * Clear SCSI Status 3
2164 modes M_DFF0, M_DFF1, M_SCSI
2166 field CLRNTRAMPERR 0x02
2167 field CLROSRAMPERR 0x01
2171 * SCSI Interrupt Mode 3
2178 field ENNTRAMPERR 0x02
2179 field ENOSRAMPERR 0x01
2183 * LQO Manager Status 0
2188 modes M_DFF0, M_DFF1, M_SCSI
2190 field LQOTARGSCBPERR 0x10
2191 field LQOSTOPT2 0x08
2193 field LQOATNPKT 0x02
2198 * Clear LQO Manager interrupt 0
2200 register CLRLQOINT0 {
2203 modes M_DFF0, M_DFF1, M_SCSI
2205 field CLRLQOTARGSCBPERR 0x10
2206 field CLRLQOSTOPT2 0x08
2207 field CLRLQOATNLQ 0x04
2208 field CLRLQOATNPKT 0x02
2209 field CLRLQOTCRC 0x01
2213 * LQO Manager Interrupt Mode 0
2220 field ENLQOTARGSCBPERR 0x10
2221 field ENLQOSTOPT2 0x08
2222 field ENLQOATNLQ 0x04
2223 field ENLQOATNPKT 0x02
2224 field ENLQOTCRC 0x01
2228 * LQO Manager Status 1
2233 modes M_DFF0, M_DFF1, M_SCSI
2234 field LQOINITSCBPERR 0x10
2235 field LQOSTOPI2 0x08
2236 field LQOBADQAS 0x04
2237 field LQOBUSFREE 0x02
2238 field LQOPHACHGINPKT 0x01
2242 * Clear LOQ Interrupt 1
2244 register CLRLQOINT1 {
2247 modes M_DFF0, M_DFF1, M_SCSI
2249 field CLRLQOINITSCBPERR 0x10
2250 field CLRLQOSTOPI2 0x08
2251 field CLRLQOBADQAS 0x04
2252 field CLRLQOBUSFREE 0x02
2253 field CLRLQOPHACHGINPKT 0x01
2257 * LQO Manager Interrupt Mode 1
2264 field ENLQOINITSCBPERR 0x10
2265 field ENLQOSTOPI2 0x08
2266 field ENLQOBADQAS 0x04
2267 field ENLQOBUSFREE 0x02
2268 field ENLQOPHACHGINPKT 0x01
2272 * LQO Manager Status 2
2277 modes M_DFF0, M_DFF1, M_SCSI
2279 field LQOWAITFIFO 0x10
2280 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2281 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2285 * Output Synchronizer Space Count
2287 register OS_SPACE_CNT {
2295 * SCSI Interrupt Mode 1
2296 * Setting any bit will enable the corresponding function
2297 * in SIMODE1 to interrupt via the IRQ pin.
2302 modes M_DFF0, M_DFF1, M_SCSI
2303 field ENSELTIMO 0x80
2304 field ENATNTARG 0x40
2305 field ENSCSIRST 0x20
2306 field ENPHASEMIS 0x10
2307 field ENBUSFREE 0x08
2308 field ENSCSIPERR 0x04
2309 field ENSTRB2FAST 0x02
2310 field ENREQINIT 0x01
2320 modes M_DFF0, M_DFF1, M_SCSI
2324 * Data FIFO SCSI Transfer Control
2326 register DFFSXFRCTL {
2329 modes M_DFF0, M_DFF1
2330 field DFFBITBUCKET 0x08
2337 * Next SCSI Control Block
2350 register LQOSCSCTL {
2356 field LQOH2A_VERSION 0x80
2357 field LQOBUSETDLY 0x40
2358 field LQONOHOLDLACK 0x02
2359 field LQONOCHKOVER 0x01
2365 register SEQINTSRC {
2368 modes M_DFF0, M_DFF1
2372 field CFG4ISTAT 0x08
2373 field CFG4TSTAT 0x04
2379 * Clear Arp Interrupts
2381 register CLRSEQINTSRC {
2384 modes M_DFF0, M_DFF1
2385 field CLRCTXTDONE 0x40
2386 field CLRSAVEPTRS 0x20
2387 field CLRCFG4DATA 0x10
2388 field CLRCFG4ISTAT 0x08
2389 field CLRCFG4TSTAT 0x04
2390 field CLRCFG4ICMD 0x02
2391 field CLRCFG4TCMD 0x01
2395 * SEQ Interrupt Enabled (Shared)
2400 modes M_DFF0, M_DFF1
2401 field ENCTXTDONE 0x40
2402 field ENSAVEPTRS 0x20
2403 field ENCFG4DATA 0x10
2404 field ENCFG4ISTAT 0x08
2405 field ENCFG4TSTAT 0x04
2406 field ENCFG4ICMD 0x02
2407 field ENCFG4TCMD 0x01
2411 * Current SCSI Control Block
2426 modes M_DFF0, M_DFF1
2427 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2428 field SHCNTMINUS1 0x20 /* Rev B or higher */
2429 field LASTSDONE 0x10
2431 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2432 field DATAINFIFO 0x02
2439 register CRCCONTROL {
2443 field CRCVALCHKEN 0x40
2454 field SEL_TXPLL_DEBUG 0x04
2458 * Data FIFO Queue Tag
2464 modes M_DFF0, M_DFF1
2468 * Last SCSI Control Block
2478 * SCSI I/O Cell Power-down Control
2484 field DISABLE_OE 0x80
2485 field PDN_IDIST 0x04
2486 field PDN_DIFFSENSE 0x01
2490 * Shaddow Host Address.
2496 modes M_DFF0, M_DFF1
2500 * Data Group CRC Interval.
2510 * Data Transfer Negotiation Address
2519 * Data Transfer Negotiation Data - Period Byte
2521 register NEGPERIOD {
2529 * Packetized CRC Interval
2539 * Data Transfer Negotiation Data - Offset Byte
2541 register NEGOFFSET {
2549 * Data Transfer Negotiation Data - PPR Options
2551 register NEGPPROPTS {
2556 field PPROPT_PACE 0x08
2557 field PPROPT_QAS 0x04
2558 field PPROPT_DT 0x02
2559 field PPROPT_IUT 0x01
2563 * Data Transfer Negotiation Data - Connection Options
2565 register NEGCONOPTS {
2569 field ENSNAPSHOT 0x40
2570 field RTI_WRTDIS 0x20
2571 field RTI_OVRDTRN 0x10
2572 field ENSLOWCRC 0x08
2573 field ENAUTOATNI 0x04
2574 field ENAUTOATNO 0x02
2579 * Negotiation Table Annex Column Index.
2597 field BIDICHKDIS 0x80
2598 field STSELSKIDDIS 0x40
2599 field CURRFIFODEF 0x20
2600 field WIDERESEN 0x10
2601 field SDONEMSKDIS 0x08
2602 field DFFACTCLR 0x04
2603 field SHVALIDSTDIS 0x02
2604 field LSTSGCLRDIS 0x01
2607 const AHD_ANNEXCOL_PER_DEV0 4
2608 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2609 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2610 const AHD_PRECOMP_MASK 0x07
2611 const AHD_PRECOMP_SHIFT 0
2612 const AHD_PRECOMP_CUTBACK_17 0x04
2613 const AHD_PRECOMP_CUTBACK_29 0x06
2614 const AHD_PRECOMP_CUTBACK_37 0x07
2615 const AHD_SLEWRATE_MASK 0x78
2616 const AHD_SLEWRATE_SHIFT 3
2618 * Rev A has only a single bit (high bit of field) of slew adjustment.
2619 * Rev B has 4 bits. The current default happens to be the same for both.
2621 const AHD_SLEWRATE_DEF_REVA 0x08
2622 const AHD_SLEWRATE_DEF_REVB 0x08
2624 /* Rev A does not have any amplitude setting. */
2625 const AHD_ANNEXCOL_AMPLITUDE 6
2626 const AHD_AMPLITUDE_MASK 0x7
2627 const AHD_AMPLITUDE_SHIFT 0
2628 const AHD_AMPLITUDE_DEF 0x7
2631 * Negotiation Table Annex Data Port.
2641 * Initiator's Own Id.
2642 * The SCSI ID to use for Selection Out and seen during a reselection..
2651 * 960MHz Phase-Locked Loop Control 0
2653 register PLL960CTL0 {
2657 field PLL_VCOSEL 0x80
2660 field PLL_ENLUD 0x08
2661 field PLL_ENLPF 0x04
2663 field PLL_ENFBM 0x01
2677 * 960MHz Phase-Locked Loop Control 1
2679 register PLL960CTL1 {
2683 field PLL_CNTEN 0x80
2684 field PLL_CNTCLR 0x40
2689 * Expander Signature
2704 modes M_DFF0, M_DFF1
2717 * 960-MHz Phase-Locked Loop Test Count
2719 register PLL960CNT0 {
2727 * 400-MHz Phase-Locked Loop Control 0
2729 register PLL400CTL0 {
2733 field PLL_VCOSEL 0x80
2736 field PLL_ENLUD 0x08
2737 field PLL_ENLPF 0x04
2739 field PLL_ENFBM 0x01
2743 * Arbitration Fairness
2753 * 400-MHz Phase-Locked Loop Control 1
2755 register PLL400CTL1 {
2759 field PLL_CNTEN 0x80
2760 field PLL_CNTCLR 0x40
2765 * Arbitration Unfairness
2767 register UNFAIRNESS {
2775 * 400-MHz Phase-Locked Loop Test Count
2777 register PLL400CNT0 {
2791 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2795 * CMC SCB Array Count
2796 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2797 * Transfers must be 8byte aligned and sized.
2799 register CCSCBACNT {
2807 * SCB-Next Address Snooping logic. When an SCB is transferred to
2808 * the card, the next SCB address to be used by the CMC array can
2809 * be autoloaded from that transfer.
2811 register SCBAUTOPTR {
2816 field AUSCBPTR_EN 0x80
2817 field SCBPTR_ADDR 0x38
2818 field SCBPTR_OFF 0x07
2822 * CMC SG Ram Address Pointer
2827 modes M_DFF0, M_DFF1
2831 * CMC SCB RAM Address Pointer
2833 register CCSCBADDR {
2840 * CMC SCB Ram Back-up Address Pointer
2841 * Indicates the true stop location of transfers halted prior
2842 * to SCBHCNT going to 0.
2844 register CCSCBADR_BK {
2856 modes M_DFF0, M_DFF1
2858 field SG_CACHE_AVAIL 0x10
2859 field CCSGENACK 0x08
2861 field SG_FETCH_REQ 0x02
2862 field CCSGRESET 0x01
2872 field CCSCBDONE 0x80
2877 field CCSCBRESET 0x01
2883 register CMC_RAMBIST {
2887 field SG_ELEMENT_SIZE 0x80
2888 field SCBRAMBIST_FAIL 0x40
2889 field SG_BIST_FAIL 0x20
2890 field SG_BIST_EN 0x10
2891 field CMC_BUFFER_BIST_FAIL 0x02
2892 field CMC_BUFFER_BIST_EN 0x01
2896 * CMC SG RAM Data Port
2901 modes M_DFF0, M_DFF1
2905 * CMC SCB RAM Data Port
2924 * Flex DMA Byte Count
2936 register FLEXDMASTAT {
2940 field FLEXDMAERR 0x02
2941 field FLEXDMADONE 0x01
2945 * Flex DMA Data Port
2971 field FLXARBACK 0x80
2972 field FLXARBREQ 0x40
2980 * Serial EEPROM Address
2990 * Serial EEPROM Data
3001 * Serial EEPROM Status
3008 field INIT_DONE 0x80
3009 field SEEOPCODE 0x70
3010 field LDALTID_L 0x08
3011 field SEEARBACK 0x04
3017 * Serial EEPROM Control
3024 field SEEOPCODE 0x70 {
3029 * The following four commands use special
3030 * addresses for differentiation.
3034 mask SEEOP_EWEN 0x40
3035 mask SEEOP_WALL 0x40
3036 mask SEEOP_EWDS 0x40
3041 const SEEOP_ERAL_ADDR 0x80
3042 const SEEOP_EWEN_ADDR 0xC0
3043 const SEEOP_WRAL_ADDR 0x40
3044 const SEEOP_EWDS_ADDR 0x00
3056 * Data FIFO Write Address
3057 * Pointer to the next QWD location to be written to the data FIFO.
3063 modes M_DFF0, M_DFF1
3067 * DSP Filter Control
3069 register DSPFLTRCTL {
3073 field FLTRDISABLE 0x20
3074 field EDGESENSE 0x10
3075 field DSPFCNTSEL 0x0F
3079 * DSP Data Channel Control
3081 register DSPDATACTL {
3086 field BYPASSENAB 0x80
3088 field RCVROFFSTDIS 0x04
3089 field XMITOFFSTDIS 0x02
3093 * Data FIFO Read Address
3094 * Pointer to the next QWD location to be read from the data FIFO.
3100 modes M_DFF0, M_DFF1
3106 register DSPREQCTL {
3110 field MANREQCTL 0xC0
3111 field MANREQDLY 0x3F
3117 register DSPACKCTL {
3121 field MANACKCTL 0xC0
3122 field MANACKDLY 0x3F
3127 * Read/Write byte port into the data FIFO. The read and write
3128 * FIFO pointers increment with each read and write respectively
3134 modes M_DFF0, M_DFF1
3138 * DSP Channel Select
3140 register DSPSELECT {
3145 field AUTOINCEN 0x80
3152 * Write Bias Control
3154 register WRTBIASCTL {
3159 field AUTOXBCDIS 0x80
3160 field XMITMANVAL 0x3F
3164 * Currently the WRTBIASCTL is the same as the default.
3166 const WRTBIASCTL_HP_DEFAULT 0x0
3169 * Receiver Bias Control
3171 register RCVRBIOSCTL {
3175 field AUTORBCDIS 0x80
3176 field RCVRMANVAL 0x3F
3180 * Write Bias Calculator
3182 register WRTBIASCALC {
3189 * Data FIFO Pointers
3190 * Contains the byte offset from DFWADDR and DWRADDR to the current
3191 * FIFO write/read locations.
3196 modes M_DFF0, M_DFF1
3200 * Receiver Bias Calculator
3202 register RCVRBIASCALC {
3209 * Data FIFO Backup Read Pointer
3210 * Contains the data FIFO address to be restored if the last
3211 * data accessed from the data FIFO was not transferred successfully.
3217 modes M_DFF0, M_DFF1
3230 * Data FIFO Debug Control
3235 modes M_DFF0, M_DFF1
3236 field DFF_CIO_WR_RDY 0x20
3237 field DFF_CIO_RD_RDY 0x10
3238 field DFF_DIR_ERR 0x08
3239 field DFF_RAMBIST_FAIL 0x04
3240 field DFF_RAMBIST_DONE 0x02
3241 field DFF_RAMBIST_EN 0x01
3245 * Data FIFO Space Count
3246 * Number of FIFO locations that are free.
3252 modes M_DFF0, M_DFF1
3256 * Data FIFO Byte Count
3257 * Number of filled FIFO locations.
3263 modes M_DFF0, M_DFF1
3267 * Sequencer Program Overlay Address.
3268 * Low address must be written prior to high address.
3278 * Sequencer Control 0
3279 * Error detection mode, speed configuration,
3280 * single step, breakpoints and program load.
3286 field PERRORDIS 0x80
3290 field BRKADRINTEN 0x08
3297 * Sequencer Control 1
3298 * Instruction RAM Diagnostics
3303 field OVRLAY_DATA_CHK 0x08
3304 field RAMBIST_DONE 0x04
3305 field RAMBIST_FAIL 0x02
3306 field RAMBIST_EN 0x01
3311 * Zero and Carry state of the ALU.
3322 * Sequencer Interrupt Control
3324 register SEQINTCTL {
3327 field INTVEC1DSL 0x80
3328 field INT1_CONTEXT 0x20
3329 field SCS_SEQ_INT1M1 0x10
3330 field SCS_SEQ_INT1M0 0x08
3337 * Sequencer RAM Data Port
3338 * Single byte window into the Sequencer Instruction Ram area starting
3339 * at the address specified by OVLYADDR. To write a full instruction word,
3340 * simply write four bytes in succession. OVLYADDR will increment after the
3341 * most significant instrution byte (the byte with the parity bit) is written.
3350 * Sequencer Program Counter
3351 * Low byte must be written prior to high byte.
3370 * Source Index Register
3371 * Incrementing index for reads of SINDIR and the destination (low byte only)
3372 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3374 * mvi 0xFF call some_routine;
3376 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3386 * Destination Index Register
3387 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3397 * Sequencer instruction breakpoint address address.
3407 field BRKDIS 0x80 /* Disable Breakpoint */
3412 * All reads to this register return the value 0xFF.
3422 * All reads to this register return the value 0.
3432 * Writes to this register have no effect.
3441 * Source Index Indirect
3442 * Reading this register is equivalent to reading (register_base + SINDEX) and
3443 * incrementing SINDEX by 1.
3451 * Destination Index Indirect
3452 * Writing this register is equivalent to writing to (register_base + DINDEX)
3453 * and incrementing DINDEX by 1.
3462 * 2's complement to bit value conversion. Write the 2's complement value
3463 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3464 * on the next read of this register.
3469 register FUNCTION1 {
3476 * Window into the stack. Each stack location is 10 bits wide reported
3477 * low byte followed by high byte. There are 8 stack locations.
3485 * Interrupt Vector 1 Address
3486 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3488 register INTVEC1_ADDR {
3498 * Address of the SEQRAM instruction currently executing instruction.
3509 * Interrupt Vector 2 Address
3510 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3512 register INTVEC2_ADDR {
3522 * Address of the SEQRAM instruction executed prior to the current instruction.
3531 register AHD_PCI_CONFIG_BASE {
3538 /* ---------------------- Scratch RAM Offsets ------------------------- */
3555 field SEGS_AVAIL 0x01
3556 field LOADING_NEEDED 0x02
3557 field FETCH_INPROG 0x04
3560 * Track whether the transfer byte count for
3561 * the current data phase is odd.
3587 * Per "other-id" execution queues. We use an array of
3588 * tail pointers into lists of SCBs sorted by "other-id".
3589 * The execution head pointer threads the head SCBs for
3602 * SCBID of the next SCB in the new SCB queue.
3604 NEXT_QUEUED_SCB_ADDR {
3608 * head of list of SCBs that have
3609 * completed but have not been
3610 * put into the qoutfifo.
3616 * The list of completed SCBs in
3619 COMPLETE_SCB_DMAINPROG_HEAD {
3623 * head of list of SCBs that have
3624 * completed but need to be uploaded
3625 * to the host prior to being completed.
3627 COMPLETE_DMA_SCB_HEAD {
3631 * tail of list of SCBs that have
3632 * completed but need to be uploaded
3633 * to the host prior to being completed.
3635 COMPLETE_DMA_SCB_TAIL {
3639 * head of list of SCBs that have
3640 * been uploaded to the host, but cannot
3641 * be completed until the QFREEZE is in
3642 * full effect (i.e. no selections pending).
3644 COMPLETE_ON_QFREEZE_HEAD {
3648 * Counting semaphore to prevent new select-outs
3649 * The queue is frozen so long as the sequencer
3650 * and kernel freeze counts differ.
3655 KERNEL_QFREEZE_COUNT {
3659 * Mode to restore on legacy idle loop exit.
3665 * Single byte buffer used to designate the type or message
3666 * to send to a target.
3671 /* Parameters for DMA Logic */
3675 field PRELOADEN 0x80
3679 field SDMAENACK 0x10
3681 field HDMAENACK 0x08
3682 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3683 field FIFOFLUSH 0x02
3684 field FIFORESET 0x01
3688 field NOT_IDENTIFIED 0x80
3689 field NO_CDB_SENT 0x40
3690 field TARGET_CMD_IS_TAGGED 0x40
3693 field TARG_CMD_PENDING 0x10
3694 field CMDPHASE_PENDING 0x08
3695 field DPHASE_PENDING 0x04
3696 field SPHASE_PENDING 0x02
3697 field NO_DISCONNECT 0x01
3700 * Temporary storage for the
3701 * target/channel/lun of a
3702 * reconnecting target
3711 * The last bus phase as seen by the sequencer.
3718 field P_BUSFREE 0x01
3719 enum PHASE_MASK CDO|IOO|MSGO {
3722 P_DATAOUT_DT P_DATAOUT|MSGO,
3723 P_DATAIN_DT P_DATAIN|MSGO,
3727 P_MESGIN CDO|IOO|MSGO
3731 * Value to "or" into the SCBPTR[1] value to
3732 * indicate that an entry in the QINFIFO is valid.
3734 QOUTFIFO_ENTRY_VALID_TAG {
3738 * Kernel and sequencer offsets into the queue of
3739 * incoming target mode command descriptors. The
3740 * queue is full when the KERNEL_TQINPOS == TQINPOS.
3751 * Base address of our shared data with the kernel driver in host
3752 * memory. This includes the qoutfifo and target mode
3753 * incoming command queue.
3759 * Pointer to location in host memory for next
3760 * position in the qoutfifo.
3762 QOUTFIFO_NEXT_ADDR {
3768 mask SEND_SENSE 0x40
3770 mask MSGOUT_PHASEMIS 0x10
3771 mask EXIT_MSG_LOOP 0x08
3772 mask CONT_MSG_LOOP_WRITE 0x04
3773 mask CONT_MSG_LOOP_READ 0x03
3774 mask CONT_MSG_LOOP_TARG 0x02
3784 * Snapshot of MSG_OUT taken after each message is sent.
3791 * Sequences the kernel driver has okayed for us. This allows
3792 * the driver to do things like prevent initiator or target
3798 field MANUALCTL 0x40
3802 field ENAUTOATNP 0x02
3807 * The initiator specified tag for this target mode transaction.
3816 field PENDING_MK_MESSAGE 0x01
3817 field TARGET_MSG_PENDING 0x02
3818 field SELECTOUT_QFROZEN 0x04
3826 * The maximum amount of time to wait, when interrupt coalescing
3827 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3830 INT_COALESCING_TIMER {
3835 * The maximum number of commands to coalesce into a single interrupt.
3836 * Actually the 2's complement of that value to simplify sequencer
3839 INT_COALESCING_MAXCMDS {
3844 * The minimum number of commands still outstanding required
3845 * to continue coalescing (2's complement of value).
3847 INT_COALESCING_MINCMDS {
3852 * Number of commands "in-flight".
3859 * The count of commands that have been coalesced.
3861 INT_COALESCING_CMDCOUNT {
3866 * Since the HS_MAIBOX is self clearing, copy its contents to
3867 * this position in scratch ram every time it changes.
3873 * Target-mode CDB type to CDB length table used
3874 * in non-packetized operation.
3881 * When an SCB with the MK_MESSAGE flag is
3882 * queued to the controller, it cannot enter
3883 * the waiting for selection list until the
3884 * selections for any previously queued
3885 * commands to that target complete. During
3886 * the wait, the MK_MESSAGE SCB is queued
3893 * Saved SCSIID of MK_MESSAGE_SCB to avoid
3894 * an extra SCBPTR operation when deciding
3895 * if the MK_MESSAGE_SCB can be run.
3902 /************************* Hardware SCB Definition ****************************/
3907 SCB_RESIDUAL_DATACNT {
3910 alias SCB_HOST_CDB_PTR
3912 SCB_RESIDUAL_SGPTR {
3914 field SG_ADDR_MASK 0xf8 /* In the last byte */
3915 field SG_OVERRUN_RESID 0x02 /* In the first byte */
3916 field SG_LIST_NULL 0x01 /* In the first byte */
3920 alias SCB_HOST_CDB_LEN
3925 SCB_TARGET_DATA_DIR {
3933 * Only valid if CDB length is less than 13 bytes or
3934 * we are using a CDB pointer. Otherwise contains
3935 * the last 4 bytes of embedded cdb information.
3938 alias SCB_NEXT_COMPLETE
3941 alias SCB_FIFO_USE_COUNT
3946 field TARGET_SCB 0x80
3949 field MK_MESSAGE 0x10
3950 field STATUS_RCVD 0x08
3951 field DISCONNECTED 0x04
3952 field SCB_TAG_TYPE 0x03
3963 SCB_TASK_ATTRIBUTE {
3966 * Overloaded field for non-packetized
3967 * ignore wide residue message handling.
3969 field SCB_XFERLEN_ODD 0x01
3973 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
3975 SCB_TASK_MANAGEMENT {
3983 * The last byte is really the high address bits for
3987 field SG_LAST_SEG 0x80 /* In the fourth byte */
3988 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
3992 field SG_STATUS_VALID 0x04 /* In the first byte */
3993 field SG_FULL_RESID 0x02 /* In the first byte */
3994 field SG_LIST_NULL 0x01 /* In the first byte */
4000 alias SCB_NEXT_SCB_BUSADDR
4010 SCB_DISCONNECTED_LISTS {
4015 /*********************************** Constants ********************************/
4016 const MK_MESSAGE_BIT_OFFSET 4
4018 const TARGET_CMD_CMPLT 0xfe
4019 const INVALID_ADDR 0x80
4020 #define SCB_LIST_NULL 0xff
4021 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
4023 const CCSGADDR_MAX 0x80
4024 const CCSCBADDR_MAX 0x80
4025 const CCSGRAM_MAXSEGS 16
4027 /* Selection Timeout Timer Constants */
4028 const STIMESEL_SHIFT 3
4029 const STIMESEL_MIN 0x18
4030 const STIMESEL_BUG_ADJ 0x8
4032 /* WDTR Message values */
4033 const BUS_8_BIT 0x00
4034 const BUS_16_BIT 0x01
4035 const BUS_32_BIT 0x02
4037 /* Offset maximums */
4038 const MAX_OFFSET 0xfe
4039 const MAX_OFFSET_PACED 0xfe
4040 const MAX_OFFSET_PACED_BUG 0x7f
4042 * Some 160 devices incorrectly accept 0xfe as a
4043 * sync offset, but will overrun this value. Limit
4044 * to 0x7f for speed lower than U320 which will
4045 * avoid the persistent sync offset overruns.
4047 const MAX_OFFSET_NON_PACED 0x7f
4051 * The size of our sense buffers.
4052 * Sense buffer mapping can be handled in either of two ways.
4053 * The first is to allocate a dmamap for each transaction.
4054 * Depending on the architecture, dmamaps can be costly. The
4055 * alternative is to statically map the buffers in much the same
4056 * way we handle our scatter gather lists. The driver implements
4059 const AHD_SENSE_BUFSIZE 256
4061 /* Target mode command processing constants */
4062 const CMD_GROUP_CODE_SHIFT 0x05
4064 const STATUS_BUSY 0x08
4065 const STATUS_QUEUE_FULL 0x28
4066 const STATUS_PKT_SENSE 0xFF
4067 const TARGET_DATA_IN 1
4069 const SCB_TRANSFER_SIZE_FULL_LUN 56
4070 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
4071 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
4072 const PKT_OVERRUN_BUFSIZE 512
4077 const AHD_TIMER_US_PER_TICK 25
4078 const AHD_TIMER_MAX_TICKS 0xFFFF
4079 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
4082 * Downloaded (kernel inserted) constants
4084 const SG_PREFETCH_CNT download
4085 const SG_PREFETCH_CNT_LIMIT download
4086 const SG_PREFETCH_ALIGN_MASK download
4087 const SG_PREFETCH_ADDR_MASK download
4088 const SG_SIZEOF download
4089 const PKT_OVERRUN_BUFOFFSET download
4090 const SCB_TRANSFER_SIZE download
4091 const CACHELINE_MASK download
4096 const NVRAM_SCB_OFFSET 0x2C