1 /* $NetBSD: aic79xx.reg,v 1.11 2005/12/11 12:22:18 christos Exp $ */
4 * Aic79xx register and scratch ram definitions.
6 * Copyright (c) 1994-2001 Justin T. Gibbs.
7 * Copyright (c) 2000-2002 Adaptec Inc.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions, and the following disclaimer,
15 * without modification.
16 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
17 * substantially similar to the "NO WARRANTY" disclaimer below
18 * ("Disclaimer") and any redistribution must be conditioned upon
19 * including a substantially similar Disclaimer requirement for further
20 * binary redistribution.
21 * 3. Neither the names of the above-listed copyright holders nor the names
22 * of any contributors may be used to endorse or promote products derived
23 * from this software without specific prior written permission.
25 * Alternatively, this software may be distributed under the terms of the
26 * GNU General Public License ("GPL") version 2 as published by the Free
27 * Software Foundation.
30 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
31 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
32 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
33 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
34 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
35 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
36 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
37 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
38 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
39 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
40 * POSSIBILITY OF SUCH DAMAGES.
42 * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.reg,v 1.15 2003/06/10 03:25:24 gibbs Exp $
44 VERSION = "Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#70 $"
47 * This file is processed by the aic7xxx_asm utility for use in assembling
48 * firmware for the aic79xx family of SCSI host adapters as well as to generate
49 * a C header file for use in the kernel portion of the Aic79xx driver.
52 /* Register window Modes */
60 #define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))
61 #define SET_MODE(src, dst) \
64 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
65 mvi MK_MODE(src, dst) call set_mode_work_around; \
67 mvi MODE_PTR, MK_MODE(src, dst); \
70 #define TOGGLE_DFF_MODE \
71 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
72 call toggle_dff_mode_work_around; \
74 xor MODE_PTR, MK_MODE(M_DFF1, M_DFF1); \
77 #define RESTORE_MODE(mode) \
78 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
79 mov mode call set_mode_work_around; \
84 #define SET_SEQINTCODE(code) \
85 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { \
86 mvi code call set_seqint_work_around; \
88 mvi SEQINTCODE, code; \
93 * Controls which of the 5, 512byte, address spaces should be used
94 * as the source and destination of any register accesses in our
105 const SRC_MODE_SHIFT 0
106 const DST_MODE_SHIFT 4
109 * Host Interrupt Status
126 * Sequencer Interrupt Code
128 register SEQINTCODE {
132 NO_SEQINT, /* No seqint pending. */
133 BAD_PHASE, /* unknown scsi bus phase */
134 SEND_REJECT, /* sending a message reject */
135 PROTO_VIOLATION, /* Protocol Violation */
136 NO_MATCH, /* no cmd match for reconnect */
137 IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
139 * Returned to data phase
141 * transfer pointers to be
142 * recalculated from the
146 * The bus is ready for the
147 * host to perform another
148 * message transaction. This
149 * mechanism is used for things
150 * like sync/wide negotiation
151 * that require a kernel based
152 * message state engine.
154 BAD_STATUS, /* Bad status from target */
156 * Target attempted to write
157 * beyond the bounds of its
161 * Target completed command
162 * without honoring our ATN
163 * request to issue a message.
166 * The sequencer never saw
167 * the bus go free after
168 * either a command complete
169 * or disconnect message.
178 TASKMGMT_FUNC_COMPLETE, /*
179 * Task management function
180 * request completed with
181 * an expected busfree.
183 TASKMGMT_CMD_CMPLT_OKAY, /*
184 * A command with a non-zero
185 * task management function
186 * has completed via the normal
187 * command completion method
188 * for commands with a zero
189 * task management function.
190 * This happens when an attempt
191 * to abort a command loses
192 * the race for the command to
205 * Clear Host Interrupt
210 field CLRHWERRINT 0x80 /* Rev B or greater */
211 field CLRBRKADRINT 0x40
212 field CLRSWTMINT 0x20
214 field CLRSCSIINT 0x08
217 field CLRSPLTINT 0x01
227 field CIOACCESFAIL 0x40 /* Rev B or greater */
241 field CLRCIOPARERR 0x80
242 field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
243 field CLRMPARERR 0x20
244 field CLRDPARERR 0x10
245 field CLRSQPARERR 0x08
246 field CLRILLOPCODE 0x04
247 field CLRDSCTMOUT 0x02
251 * Host Control Register
252 * Overall host control of the device.
257 field SEQ_RESET 0x80 /* Rev B or greater */
260 field SWTIMER_START_B 0x08 /* Rev B or greater */
264 field CHIPRSTACK 0x01
268 * Host New SCB Queue Offset
270 register HNSCB_QOFF {
277 * Host Empty SCB Queue Offset
279 register HESCB_QOFF {
287 register HS_MAILBOX {
290 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
291 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
295 * Sequencer Interrupt Status
297 register SEQINTSTAT {
300 field SEQ_SWTMRTO 0x10
301 field SEQ_SEQINT 0x08
302 field SEQ_SCSIINT 0x04
303 field SEQ_PCIINT 0x02
304 field SEQ_SPLTINT 0x01
308 * Clear SEQ Interrupt
310 register CLRSEQINTSTAT {
313 field CLRSEQ_SWTMRTO 0x10
314 field CLRSEQ_SEQINT 0x08
315 field CLRSEQ_SCSIINT 0x04
316 field CLRSEQ_PCIINT 0x02
317 field CLRSEQ_SPLTINT 0x01
330 * SEQ New SCB Queue Offset
332 register SNSCB_QOFF {
340 * SEQ Empty SCB Queue Offset
342 register SESCB_QOFF {
349 * SEQ Done SCB Queue Offset
351 register SDSCB_QOFF {
359 * Queue Offset Control & Status
361 register QOFF_CTLSTA {
365 field EMPTY_SCB_AVAIL 0x80
366 field NEW_SCB_AVAIL 0x40
367 field SDSCB_ROLLOVR 0x20
368 field HS_MAILBOX_ACT 0x10
369 field SCB_QSIZE 0x0F {
392 field SWTMINTMASK 0x80
394 field SWTIMER_START 0x20
395 field AUTOCLRCMDINT 0x10
410 field SCSIENWRDIS 0x40 /* Rev B only. */
416 field DIRECTIONACK 0x04
418 field FIFOFLUSHACK 0x02
419 field DIRECTIONEN 0x01
423 * Device Space Command 0
425 register DSCOMMAND0 {
429 field CACHETHEN 0x80 /* Cache Threshold enable */
430 field DPARCKEN 0x40 /* Data Parity Check Enable */
431 field MPARCKEN 0x20 /* Memory Parity Check Enable */
432 field EXTREQLCK 0x10 /* External Request Lock */
433 field DISABLE_TWATE 0x02 /* Rev B or greater */
434 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
444 field PRELOAD_AVAIL 0x80
445 field PKT_PRELOAD_AVAIL 0x40
456 register SG_CACHE_PRE {
460 field SG_ADDR_MASK 0xf8
465 register SG_CACHE_SHADOW {
469 field SG_ADDR_MASK 0xf8
472 field LAST_SEG_DONE 0x01
482 field RESET_HARB 0x80
483 field RETRY_SWEN 0x08
488 * Data Channel Host Address
498 * Host Overlay DMA Address
515 field SPLIT_DROP_REQ 0x80
519 * Data Channel Host Count
529 * Host Overlay DMA Count
539 * Host Overlay DMA Enable
548 * Scatter/Gather Host Address
568 * Scatter/Gather Host Count
586 * 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 {
813 field UNEXPSCIEN 0x20
814 field SPLTSMADIS 0x10
815 field SPLTSTADIS 0x08
822 * CMC Sequencer Byte Count
824 register CMCSEQBCNT {
831 * Overlay Sequencer Byte Count
833 register OVLYSEQBCNT {
840 * Data Channel Sequencer Byte Count
842 register DCHSEQBCNT {
850 * Data Channel Split Status 0
852 register DCHSPLTSTAT0 {
859 field SCDATBUCKET 0x10
860 field CNTNOTCMPLT 0x08
869 register CMCSPLTSTAT0 {
876 field SCDATBUCKET 0x10
877 field CNTNOTCMPLT 0x08
884 * Overlay Split Status 0
886 register OVLYSPLTSTAT0 {
893 field SCDATBUCKET 0x10
894 field CNTNOTCMPLT 0x08
901 * Data Channel Split Status 1
903 register DCHSPLTSTAT1 {
907 field RXDATABUCKET 0x01
913 register CMCSPLTSTAT1 {
917 field RXDATABUCKET 0x01
921 * Overlay Split Status 1
923 register OVLYSPLTSTAT1 {
927 field RXDATABUCKET 0x01
931 * S/G Receive Message 0
942 * S/G Receive Message 1
952 * S/G Receive Message 2
962 * S/G Receive Message 3
972 * Slave Split Out Address 0
974 register SLVSPLTOUTADR0 {
978 field LOWER_ADDR 0x7F
982 * Slave Split Out Address 1
984 register SLVSPLTOUTADR1 {
993 * Slave Split Out Address 2
995 register SLVSPLTOUTADR2 {
1003 * Slave Split Out Address 3
1005 register SLVSPLTOUTADR3 {
1014 * SG Sequencer Byte Count
1016 register SGSEQBCNT {
1019 modes M_DFF0, M_DFF1
1023 * Slave Split Out Attribute 0
1025 register SLVSPLTOUTATTR0 {
1029 field LOWER_BCNT 0xFF
1033 * Slave Split Out Attribute 1
1035 register SLVSPLTOUTATTR1 {
1039 field CMPLT_DNUM 0xF8
1040 field CMPLT_FNUM 0x07
1044 * Slave Split Out Attribute 2
1046 register SLVSPLTOUTATTR2 {
1051 field CMPLT_BNUM 0xFF
1054 * S/G Split Status 0
1056 register SGSPLTSTAT0 {
1059 modes M_DFF0, M_DFF1
1063 field SCDATBUCKET 0x10
1064 field CNTNOTCMPLT 0x08
1067 field RXSPLTRSP 0x01
1071 * S/G Split Status 1
1073 register SGSPLTSTAT1 {
1076 modes M_DFF0, M_DFF1
1077 field RXDATABUCKET 0x01
1087 field TEST_GROUP 0xF0
1092 * Data FIFO 0 PCI Status
1094 register DF0PCISTAT {
1109 * Data FIFO 1 PCI Status
1111 register DF1PCISTAT {
1128 register SGPCISTAT {
1144 register CMCPCISTAT {
1159 * Overlay PCI Status
1161 register OVLYPCISTAT {
1175 * PCI Status for MSI Master DMA Transfer
1177 register MSIPCISTAT {
1184 field CLRPENDMSI 0x08
1190 * PCI Status for Target
1192 register TARGPCISTAT {
1204 * The last LQ Packet recieved
1210 modes M_DFF0, M_DFF1, M_SCSI
1215 * SCB offset for Target Mode SCB type information
1225 * SCB offset to the Two Byte tag identifier used for target mode.
1234 * Logical Unit Number Pointer
1235 * SCB offset to the LSB (little endian) of the lun field.
1244 * Data Length Pointer
1245 * SCB offset for the 4 byte data length field in target mode.
1247 register DATALENPTR {
1254 * Status Length Pointer
1255 * SCB offset to the two byte status field in target SCBs.
1257 register STATLENPTR {
1264 * Command Length Pointer
1265 * Scb offset for the CDB length field in initiator SCBs.
1267 register CMDLENPTR {
1274 * Task Attribute Pointer
1275 * Scb offset for the byte field specifying the attribute byte
1276 * to be used in command packets.
1285 * Task Management Flags Pointer
1286 * Scb offset for the byte field specifying the attribute flags
1287 * byte to be used in command packets.
1297 * Scb offset for the first byte in the CDB for initiator SCBs.
1306 * Queue Next Pointer
1307 * Scb offset for the 2 byte "next scb link".
1317 * Scb offset to the value to place in the SCSIID register
1318 * during target mode connections.
1327 * Command Aborted Byte Pointer
1328 * Offset to the SCB flags field that includes the
1329 * "SCB aborted" status bit.
1331 register ABRTBYTEPTR {
1338 * Command Aborted Bit Pointer
1339 * Bit offset in the SCB flags field for "SCB aborted" status.
1341 register ABRTBITPTR {
1350 register MAXCMDBYTES {
1359 register MAXCMD2RCV {
1368 register SHORTTHRESH {
1375 * Logical Unit Number Length
1376 * The length, in bytes, of the SCB lun field.
1385 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1389 * The size, in bytes, of the embedded CDB field in initator SCBs.
1399 * The maximum number of commands to issue during a
1400 * single packetized connection.
1409 * Maximum Command Counter
1410 * The number of commands already sent during this connection
1412 register MAXCMDCNT {
1419 * LQ Packet Reserved Bytes
1420 * The bytes to be sent in the currently reserved fileds
1421 * of all LQ packets.
1440 * Command Reserved 0
1441 * The byte to be sent for the reserved byte 0 of
1442 * outgoing command packets.
1451 * LQ Manager Control 0
1457 field LQITARGCLT 0xC0
1458 field LQIINITGCLT 0x30
1459 field LQ0TARGCLT 0x0C
1460 field LQ0INITGCLT 0x03
1464 * LQ Manager Control 1
1469 modes M_DFF0, M_DFF1, M_SCSI
1471 field SINGLECMD 0x02
1472 field ABORTPENDING 0x01
1476 * LQ Manager Control 2
1481 modes M_DFF0, M_DFF1, M_SCSI
1483 field LQICONTINUE 0x40
1484 field LQITOIDLE 0x20
1487 field LQOCONTINUE 0x04
1488 field LQOTOIDLE 0x02
1499 field GSBISTERR 0x40
1500 field GSBISTDONE 0x20
1501 field GSBISTRUN 0x10
1502 field OSBISTERR 0x04
1503 field OSBISTDONE 0x02
1504 field OSBISTRUN 0x01
1508 * SCSI Sequence Control0
1513 modes M_DFF0, M_DFF1, M_SCSI
1517 field FORCEBUSFREE 0x10
1528 field NTBISTERR 0x04
1529 field NTBISTDONE 0x02
1530 field NTBISTRUN 0x01
1534 * SCSI Sequence Control 1
1539 modes M_DFF0, M_DFF1, M_SCSI
1540 field MANUALCTL 0x40
1544 field ENAUTOATNP 0x02
1549 * SCSI Transfer Control 0
1557 field BIOSCANCELEN 0x10
1562 * SCSI Transfer Control 1
1568 field BITBUCKET 0x80
1578 * SCSI Transfer Control 2
1584 field AUTORSTDIS 0x10
1590 * SCSI Bus Initiator IDs
1591 * Bitmask of observed initiators on the bus.
1593 register BUSINITID {
1601 * Data Length Counters
1602 * Packet byte counter.
1607 modes M_DFF0, M_DFF1
1618 field FIFO1FREE 0x20
1619 field FIFO0FREE 0x10
1621 * On the B, this enum only works
1622 * in the read direction. For writes,
1623 * you must use the B version of the
1624 * CURRFIFO_0 definition which is defined
1625 * as a constant outside of this register
1626 * definition to avoid confusing the
1627 * register pretty printing code.
1629 enum CURRFIFO 0x03 {
1636 const B_CURRFIFO_0 0x2
1639 * SCSI Bus Target IDs
1640 * Bitmask of observed targets on the bus.
1642 register BUSTARGID {
1650 * SCSI Control Signal Out
1655 modes M_DFF0, M_DFF1, M_SCSI
1665 * Possible phases to write into SCSISIG0
1667 enum PHASE_MASK CDO|IOO|MSGO {
1670 P_DATAOUT_DT P_DATAOUT|MSGO,
1671 P_DATAIN_DT P_DATAIN|MSGO,
1675 P_MESGIN CDO|IOO|MSGO
1682 modes M_DFF0, M_DFF1, M_SCSI
1692 * Possible phases in SCSISIGI
1694 enum PHASE_MASK CDO|IOO|MSGO {
1697 P_DATAOUT_DT P_DATAOUT|MSGO,
1698 P_DATAIN_DT P_DATAIN|MSGO,
1702 P_MESGIN CDO|IOO|MSGO
1707 * Multiple Target IDs
1708 * Bitmask of ids to respond as a target.
1710 register MULTARGID {
1720 register SCSIPHASE {
1723 modes M_DFF0, M_DFF1, M_SCSI
1724 field STATUS_PHASE 0x20
1725 field COMMAND_PHASE 0x10
1726 field MSG_IN_PHASE 0x08
1727 field MSG_OUT_PHASE 0x04
1728 field DATA_PHASE_MASK 0x03 {
1729 DATA_OUT_PHASE 0x01,
1737 register SCSIDAT0_IMG {
1740 modes M_DFF0, M_DFF1, M_SCSI
1749 modes M_DFF0, M_DFF1, M_SCSI
1759 modes M_DFF0, M_DFF1, M_SCSI
1769 modes M_DFF0, M_DFF1, M_SCSI
1775 * Selection/Reselection ID
1776 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1777 * device did not set its own ID.
1782 modes M_DFF0, M_DFF1, M_SCSI
1783 field SELID_MASK 0xf0
1788 * SCSI Block Control
1789 * Controls Bus type and channel selection. SELWIDE allows for the
1790 * coexistence of 8bit and 16bit devices on a wide bus.
1795 modes M_DFF0, M_DFF1, M_SCSI
1796 field DIAGLEDEN 0x80
1797 field DIAGLEDON 0x40
1798 field ENAB40 0x08 /* LVD transceiver active */
1799 field ENAB20 0x04 /* SE/HVD transceiver active */
1806 register OPTIONMODE {
1810 field BIOSCANCTL 0x80
1811 field AUTOACKEN 0x40
1812 field BIASCANCTL 0x20
1813 field BUSFREEREV 0x10
1814 field ENDGFORMCHK 0x04
1815 field AUTO_MSGOUT_DE 0x02
1816 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1825 modes M_DFF0, M_DFF1, M_SCSI
1826 field TARGET 0x80 /* Board acting as target */
1827 field SELDO 0x40 /* Selection Done */
1828 field SELDI 0x20 /* Board has been selected */
1829 field SELINGO 0x10 /* Selection In Progress */
1830 field IOERR 0x08 /* LVD Tranceiver mode changed */
1831 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1832 field SPIORDY 0x02 /* SCSI PIO Ready */
1833 field ARBDO 0x01 /* Arbitration Done Out */
1837 * Clear SCSI Interrupt 0
1838 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1843 modes M_DFF0, M_DFF1, M_SCSI
1846 field CLRSELINGO 0x10
1848 field CLROVERRUN 0x04
1849 field CLRSPIORDY 0x02
1854 * SCSI Interrupt Mode 0
1855 * Setting any bit will enable the corresponding function
1856 * in SIMODE0 to interrupt via the IRQ pin.
1864 field ENSELINGO 0x10
1866 field ENOVERRUN 0x04
1867 field ENSPIORDY 0x02
1877 modes M_DFF0, M_DFF1, M_SCSI
1884 field STRB2FAST 0x02
1889 * Clear SCSI Interrupt 1
1890 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1895 modes M_DFF0, M_DFF1, M_SCSI
1896 field CLRSELTIMEO 0x80
1898 field CLRSCSIRSTI 0x20
1899 field CLRBUSFREE 0x08
1900 field CLRSCSIPERR 0x04
1901 field CLRSTRB2FAST 0x02
1902 field CLRREQINIT 0x01
1911 modes M_DFF0, M_DFF1, M_SCSI
1912 field BUSFREETIME 0xc0 {
1917 field NONPACKREQ 0x20
1918 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
1919 field BSYX 0x08 /* Busy Expander */
1920 field WIDE_RES 0x04 /* Modes 0 and 1 only */
1921 field SDONE 0x02 /* Modes 0 and 1 only */
1922 field DMADONE 0x01 /* Modes 0 and 1 only */
1926 * Clear SCSI Interrupt 2
1931 modes M_DFF0, M_DFF1, M_SCSI
1932 field CLRNONPACKREQ 0x20
1933 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
1934 field CLRSDONE 0x02 /* Modes 0 and 1 only */
1935 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
1939 * SCSI Interrupt Mode 2
1945 field ENWIDE_RES 0x04
1947 field ENDMADONE 0x01
1951 * Physical Error Diagnosis
1956 modes M_DFF0, M_DFF1, M_SCSI
1959 field PREVPHASE 0x20
1960 field PARITYERR 0x10
1963 field DGFORMERR 0x02
1968 * LQI Manager Current State
1982 modes M_DFF0, M_DFF1, M_SCSI
1986 * LQO Manager Current State
1995 * LQI Manager Status
2000 modes M_DFF0, M_DFF1, M_SCSI
2001 field LQIATNQAS 0x20
2004 field LQIBADLQT 0x04
2006 field LQIATNCMD 0x01
2010 * Clear LQI Interrupts 0
2012 register CLRLQIINT0 {
2015 modes M_DFF0, M_DFF1, M_SCSI
2016 field CLRLQIATNQAS 0x20
2017 field CLRLQICRCT1 0x10
2018 field CLRLQICRCT2 0x08
2019 field CLRLQIBADLQT 0x04
2020 field CLRLQIATNLQ 0x02
2021 field CLRLQIATNCMD 0x01
2025 * LQI Manager Interrupt Mode 0
2031 field ENLQIATNQASK 0x20
2032 field ENLQICRCT1 0x10
2033 field ENLQICRCT2 0x08
2034 field ENLQIBADLQT 0x04
2035 field ENLQIATNLQ 0x02
2036 field ENLQIATNCMD 0x01
2040 * LQI Manager Status 1
2045 modes M_DFF0, M_DFF1, M_SCSI
2046 field LQIPHASE_LQ 0x80
2047 field LQIPHASE_NLQ 0x40
2049 field LQICRCI_LQ 0x10
2050 field LQICRCI_NLQ 0x08
2051 field LQIBADLQI 0x04
2052 field LQIOVERI_LQ 0x02
2053 field LQIOVERI_NLQ 0x01
2057 * Clear LQI Manager Interrupts1
2059 register CLRLQIINT1 {
2062 modes M_DFF0, M_DFF1, M_SCSI
2063 field CLRLQIPHASE_LQ 0x80
2064 field CLRLQIPHASE_NLQ 0x40
2065 field CLRLIQABORT 0x20
2066 field CLRLQICRCI_LQ 0x10
2067 field CLRLQICRCI_NLQ 0x08
2068 field CLRLQIBADLQI 0x04
2069 field CLRLQIOVERI_LQ 0x02
2070 field CLRLQIOVERI_NLQ 0x01
2074 * LQI Manager Interrupt Mode 1
2080 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2081 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2082 field ENLIQABORT 0x20
2083 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2084 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2085 field ENLQIBADLQI 0x04
2086 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2087 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2091 * LQI Manager Status 2
2096 modes M_DFF0, M_DFF1, M_SCSI
2097 field PACKETIZED 0x80
2098 field LQIPHASE_OUTPKT 0x40
2099 field LQIWORKONLQ 0x20
2100 field LQIWAITFIFO 0x10
2101 field LQISTOPPKT 0x08
2102 field LQISTOPLQ 0x04
2103 field LQISTOPCMD 0x02
2104 field LQIGSAVAIL 0x01
2113 modes M_DFF0, M_DFF1, M_SCSI
2114 field NTRAMPERR 0x02
2115 field OSRAMPERR 0x01
2119 * Clear SCSI Status 3
2124 modes M_DFF0, M_DFF1, M_SCSI
2125 field CLRNTRAMPERR 0x02
2126 field CLROSRAMPERR 0x01
2130 * SCSI Interrupt Mode 3
2136 field ENNTRAMPERR 0x02
2137 field ENOSRAMPERR 0x01
2141 * LQO Manager Status 0
2146 modes M_DFF0, M_DFF1, M_SCSI
2147 field LQOTARGSCBPERR 0x10
2148 field LQOSTOPT2 0x08
2150 field LQOATNPKT 0x02
2155 * Clear LQO Manager interrupt 0
2157 register CLRLQOINT0 {
2160 modes M_DFF0, M_DFF1, M_SCSI
2161 field CLRLQOTARGSCBPERR 0x10
2162 field CLRLQOSTOPT2 0x08
2163 field CLRLQOATNLQ 0x04
2164 field CLRLQOATNPKT 0x02
2165 field CLRLQOTCRC 0x01
2169 * LQO Manager Interrupt Mode 0
2175 field ENLQOTARGSCBPERR 0x10
2176 field ENLQOSTOPT2 0x08
2177 field ENLQOATNLQ 0x04
2178 field ENLQOATNPKT 0x02
2179 field ENLQOTCRC 0x01
2183 * LQO Manager Status 1
2188 modes M_DFF0, M_DFF1, M_SCSI
2189 field LQOINITSCBPERR 0x10
2190 field LQOSTOPI2 0x08
2191 field LQOBADQAS 0x04
2192 field LQOBUSFREE 0x02
2193 field LQOPHACHGINPKT 0x01
2197 * Clear LOQ Interrupt 1
2199 register CLRLQOINT1 {
2202 modes M_DFF0, M_DFF1, M_SCSI
2203 field CLRLQOINITSCBPERR 0x10
2204 field CLRLQOSTOPI2 0x08
2205 field CLRLQOBADQAS 0x04
2206 field CLRLQOBUSFREE 0x02
2207 field CLRLQOPHACHGINPKT 0x01
2211 * LQO Manager Interrupt Mode 1
2217 field ENLQOINITSCBPERR 0x10
2218 field ENLQOSTOPI2 0x08
2219 field ENLQOBADQAS 0x04
2220 field ENLQOBUSFREE 0x02
2221 field ENLQOPHACHGINPKT 0x01
2225 * LQO Manager Status 2
2230 modes M_DFF0, M_DFF1, M_SCSI
2232 field LQOWAITFIFO 0x10
2233 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2234 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2238 * Output Synchronizer Space Count
2240 register OS_SPACE_CNT {
2247 * SCSI Interrupt Mode 1
2248 * Setting any bit will enable the corresponding function
2249 * in SIMODE1 to interrupt via the IRQ pin.
2254 modes M_DFF0, M_DFF1, M_SCSI
2255 field ENSELTIMO 0x80
2256 field ENATNTARG 0x40
2257 field ENSCSIRST 0x20
2258 field ENPHASEMIS 0x10
2259 field ENBUSFREE 0x08
2260 field ENSCSIPERR 0x04
2261 field ENSTRB2FAST 0x02
2262 field ENREQINIT 0x01
2272 modes M_DFF0, M_DFF1, M_SCSI
2276 * Data FIFO SCSI Transfer Control
2278 register DFFSXFRCTL {
2281 modes M_DFF0, M_DFF1
2282 field DFFBITBUCKET 0x08
2289 * Next SCSI Control Block
2299 register LQOSCSCTL {
2304 field LQOH2A_VERSION 0x80
2305 field LQONOCHKOVER 0x01
2311 register SEQINTSRC {
2314 modes M_DFF0, M_DFF1
2318 field CFG4ISTAT 0x08
2319 field CFG4TSTAT 0x04
2325 * Clear Arp Interrupts
2327 register CLRSEQINTSRC {
2330 modes M_DFF0, M_DFF1
2331 field CLRCTXTDONE 0x40
2332 field CLRSAVEPTRS 0x20
2333 field CLRCFG4DATA 0x10
2334 field CLRCFG4ISTAT 0x08
2335 field CLRCFG4TSTAT 0x04
2336 field CLRCFG4ICMD 0x02
2337 field CLRCFG4TCMD 0x01
2341 * SEQ Interrupt Enabled (Shared)
2346 modes M_DFF0, M_DFF1
2347 field ENCTXTDONE 0x40
2348 field ENSAVEPTRS 0x20
2349 field ENCFG4DATA 0x10
2350 field ENCFG4ISTAT 0x08
2351 field ENCFG4TSTAT 0x04
2352 field ENCFG4ICMD 0x02
2353 field ENCFG4TCMD 0x01
2357 * Current SCSI Control Block
2372 modes M_DFF0, M_DFF1
2373 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2374 field SHCNTMINUS1 0x20 /* Rev B or higher */
2375 field LASTSDONE 0x10
2377 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2378 field DATAINFIFO 0x02
2385 register CRCCONTROL {
2389 field CRCVALCHKEN 0x40
2400 field SEL_TXPLL_DEBUG 0x04
2404 * Data FIFO Queue Tag
2410 modes M_DFF0, M_DFF1
2414 * Last SCSI Control Block
2424 * SCSI I/O Cell Power-down Control
2430 field DISABLE_OE 0x80
2431 field PDN_IDIST 0x04
2432 field PDN_DIFFSENSE 0x01
2436 * Shaddow Host Address.
2442 modes M_DFF0, M_DFF1
2446 * Data Group CRC Interval.
2456 * Data Transfer Negotiation Address
2465 * Data Transfer Negotiation Data - Period Byte
2467 register NEGPERIOD {
2474 * Packetized CRC Interval
2484 * Data Transfer Negotiation Data - Offset Byte
2486 register NEGOFFSET {
2493 * Data Transfer Negotiation Data - PPR Options
2495 register NEGPPROPTS {
2499 field PPROPT_PACE 0x08
2500 field PPROPT_QAS 0x04
2501 field PPROPT_DT 0x02
2502 field PPROPT_IUT 0x01
2506 * Data Transfer Negotiation Data - Connection Options
2508 register NEGCONOPTS {
2512 field ENSNAPSHOT 0x40
2513 field RTI_WRTDIS 0x20
2514 field RTI_OVRDTRN 0x10
2515 field ENSLOWCRC 0x08
2516 field ENAUTOATNI 0x04
2517 field ENAUTOATNO 0x02
2522 * Negotiation Table Annex Column Index.
2534 field STSELSKIDDIS 0x40
2535 field CURRFIFODEF 0x20
2536 field WIDERESEN 0x10
2537 field SDONEMSKDIS 0x08
2538 field DFFACTCLR 0x04
2539 field SHVALIDSTDIS 0x02
2540 field LSTSGCLRDIS 0x01
2543 const AHD_ANNEXCOL_PER_DEV0 4
2544 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2545 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2546 const AHD_PRECOMP_MASK 0x07
2547 const AHD_PRECOMP_SHIFT 0
2548 const AHD_PRECOMP_CUTBACK_17 0x04
2549 const AHD_PRECOMP_CUTBACK_29 0x06
2550 const AHD_PRECOMP_CUTBACK_37 0x07
2551 const AHD_SLEWRATE_MASK 0x78
2552 const AHD_SLEWRATE_SHIFT 3
2554 * Rev A has only a single bit (high bit of field) of slew adjustment.
2555 * Rev B has 4 bits. The current default happens to be the same for both.
2557 const AHD_SLEWRATE_DEF_REVA 0x08
2558 const AHD_SLEWRATE_DEF_REVB 0x08
2560 /* Rev A does not have any amplitude setting. */
2561 const AHD_ANNEXCOL_AMPLITUDE 6
2562 const AHD_AMPLITUDE_MASK 0x7
2563 const AHD_AMPLITUDE_SHIFT 0
2564 const AHD_AMPLITUDE_DEF 0x7
2567 * Negotiation Table Annex Data Port.
2576 * Initiator's Own Id.
2577 * The SCSI ID to use for Selection Out and seen during a reselection..
2586 * 960MHz Phase-Locked Loop Control 0
2588 register PLL960CTL0 {
2592 field PLL_VCOSEL 0x80
2595 field PLL_ENLUD 0x08
2596 field PLL_ENLPF 0x04
2598 field PLL_ENFBM 0x01
2611 * 960MHz Phase-Locked Loop Control 1
2613 register PLL960CTL1 {
2617 field PLL_CNTEN 0x80
2618 field PLL_CNTCLR 0x40
2623 * Expander Signature
2638 modes M_DFF0, M_DFF1
2651 * 960-MHz Phase-Locked Loop Test Count
2653 register PLL960CNT0 {
2661 * 400-MHz Phase-Locked Loop Control 0
2663 register PLL400CTL0 {
2667 field PLL_VCOSEL 0x80
2670 field PLL_ENLUD 0x08
2671 field PLL_ENLPF 0x04
2673 field PLL_ENFBM 0x01
2677 * Arbitration Fairness
2687 * 400-MHz Phase-Locked Loop Control 1
2689 register PLL400CTL1 {
2693 field PLL_CNTEN 0x80
2694 field PLL_CNTCLR 0x40
2699 * Arbitration Unfairness
2701 register UNFAIRNESS {
2709 * 400-MHz Phase-Locked Loop Test Count
2711 register PLL400CNT0 {
2725 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2729 * CMC SCB Array Count
2730 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2731 * Transfers must be 8byte aligned and sized.
2733 register CCSCBACNT {
2741 * SCB-Next Address Snooping logic. When an SCB is transferred to
2742 * the card, the next SCB address to be used by the CMC array can
2743 * be autoloaded from that transfer.
2745 register SCBAUTOPTR {
2749 field AUSCBPTR_EN 0x80
2750 field SCBPTR_ADDR 0x38
2751 field SCBPTR_OFF 0x07
2755 * CMC SG Ram Address Pointer
2760 modes M_DFF0, M_DFF1
2764 * CMC SCB RAM Address Pointer
2766 register CCSCBADDR {
2773 * CMC SCB Ram Back-up Address Pointer
2774 * Indicates the true stop location of transfers halted prior
2775 * to SCBHCNT going to 0.
2777 register CCSCBADR_BK {
2789 modes M_DFF0, M_DFF1
2791 field SG_CACHE_AVAIL 0x10
2792 field CCSGENACK 0x08
2794 field SG_FETCH_REQ 0x02
2795 field CCSGRESET 0x01
2805 field CCSCBDONE 0x80
2810 field CCSCBRESET 0x01
2816 register CMC_RAMBIST {
2820 field SG_ELEMENT_SIZE 0x80
2821 field SCBRAMBIST_FAIL 0x40
2822 field SG_BIST_FAIL 0x20
2823 field SG_BIST_EN 0x10
2824 field CMC_BUFFER_BIST_FAIL 0x02
2825 field CMC_BUFFER_BIST_EN 0x01
2829 * CMC SG RAM Data Port
2834 modes M_DFF0, M_DFF1
2838 * CMC SCB RAM Data Port
2857 * Flex DMA Byte Count
2869 register FLEXDMASTAT {
2873 field FLEXDMAERR 0x02
2874 field FLEXDMADONE 0x01
2878 * Flex DMA Data Port
2902 field FLXARBACK 0x80
2903 field FLXARBREQ 0x40
2911 * Serial EEPROM Address
2920 * Serial EEPROM Data
2930 * Serial EEPROM Status
2936 field INIT_DONE 0x80
2937 field SEEOPCODE 0x70
2938 field LDALTID_L 0x08
2939 field SEEARBACK 0x04
2945 * Serial EEPROM Control
2951 field SEEOPCODE 0x70 {
2956 * The following four commands use special
2957 * addresses for differentiation.
2961 mask SEEOP_EWEN 0x40
2962 mask SEEOP_WALL 0x40
2963 mask SEEOP_EWDS 0x40
2968 const SEEOP_ERAL_ADDR 0x80
2969 const SEEOP_EWEN_ADDR 0xC0
2970 const SEEOP_WRAL_ADDR 0x40
2971 const SEEOP_EWDS_ADDR 0x00
2983 * Data FIFO Write Address
2984 * Pointer to the next QWD location to be written to the data FIFO.
2990 modes M_DFF0, M_DFF1
2994 * DSP Filter Control
2996 register DSPFLTRCTL {
3000 field FLTRDISABLE 0x20
3001 field EDGESENSE 0x10
3002 field DSPFCNTSEL 0x0F
3006 * DSP Data Channel Control
3008 register DSPDATACTL {
3012 field BYPASSENAB 0x80
3014 field RCVROFFSTDIS 0x04
3015 field XMITOFFSTDIS 0x02
3019 * Data FIFO Read Address
3020 * Pointer to the next QWD location to be read from the data FIFO.
3026 modes M_DFF0, M_DFF1
3032 register DSPREQCTL {
3036 field MANREQCTL 0xC0
3037 field MANREQDLY 0x3F
3043 register DSPACKCTL {
3047 field MANACKCTL 0xC0
3048 field MANACKDLY 0x3F
3053 * Read/Write byte port into the data FIFO. The read and write
3054 * FIFO pointers increment with each read and write respectively
3060 modes M_DFF0, M_DFF1
3064 * DSP Channel Select
3066 register DSPSELECT {
3070 field AUTOINCEN 0x80
3077 * Write Bias Control
3079 register WRTBIASCTL {
3083 field AUTOXBCDIS 0x80
3084 field XMITMANVAL 0x3F
3088 * Currently the WRTBIASCTL is the same as the default.
3090 const WRTBIASCTL_HP_DEFAULT 0x0
3093 * Receiver Bias Control
3095 register RCVRBIOSCTL {
3099 field AUTORBCDIS 0x80
3100 field RCVRMANVAL 0x3F
3104 * Write Bias Calculator
3106 register WRTBIASCALC {
3113 * Data FIFO Pointers
3114 * Contains the byte offset from DFWADDR and DWRADDR to the current
3115 * FIFO write/read locations.
3120 modes M_DFF0, M_DFF1
3124 * Receiver Bias Calculator
3126 register RCVRBIASCALC {
3133 * Data FIFO Backup Read Pointer
3134 * Contains the data FIFO address to be restored if the last
3135 * data accessed from the data FIFO was not transferred successfully.
3141 modes M_DFF0, M_DFF1
3154 * Data FIFO Debug Control
3159 modes M_DFF0, M_DFF1
3160 field DFF_CIO_WR_RDY 0x20
3161 field DFF_CIO_RD_RDY 0x10
3162 field DFF_DIR_ERR 0x08
3163 field DFF_RAMBIST_FAIL 0x04
3164 field DFF_RAMBIST_DONE 0x02
3165 field DFF_RAMBIST_EN 0x01
3169 * Data FIFO Space Count
3170 * Number of FIFO locations that are free.
3176 modes M_DFF0, M_DFF1
3180 * Data FIFO Byte Count
3181 * Number of filled FIFO locations.
3187 modes M_DFF0, M_DFF1
3191 * Sequencer Program Overlay Address.
3192 * Low address must be written prior to high address.
3202 * Sequencer Control 0
3203 * Error detection mode, speed configuration,
3204 * single step, breakpoints and program load.
3209 field PERRORDIS 0x80
3213 field BRKADRINTEN 0x08
3220 * Sequencer Control 1
3221 * Instruction RAM Diagnostics
3226 field OVRLAY_DATA_CHK 0x08
3227 field RAMBIST_DONE 0x04
3228 field RAMBIST_FAIL 0x02
3229 field RAMBIST_EN 0x01
3234 * Zero and Carry state of the ALU.
3244 * Sequencer Interrupt Control
3246 register SEQINTCTL {
3249 field INTVEC1DSL 0x80
3250 field INT1_CONTEXT 0x20
3251 field SCS_SEQ_INT1M1 0x10
3252 field SCS_SEQ_INT1M0 0x08
3259 * Sequencer RAM Data Port
3260 * Single byte window into the Sequencer Instruction Ram area starting
3261 * at the address specified by OVLYADDR. To write a full instruction word,
3262 * simply write four bytes in succession. OVLYADDR will increment after the
3263 * most significant instruction byte (the byte with the parity bit) is written.
3271 * Sequencer Program Counter
3272 * Low byte must be written prior to high byte.
3290 * Source Index Register
3291 * Incrementing index for reads of SINDIR and the destination (low byte only)
3292 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3294 * mvi 0xFF call some_routine;
3296 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3306 * Destination Index Register
3307 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3317 * Sequencer instruction breakpoint address address.
3327 field BRKDIS 0x80 /* Disable Breakpoint */
3332 * All reads to this register return the value 0xFF.
3342 * All reads to this register return the value 0.
3352 * Writes to this register have no effect.
3361 * Source Index Indirect
3362 * Reading this register is equivalent to reading (register_base + SINDEX) and
3363 * incrementing SINDEX by 1.
3371 * Destination Index Indirect
3372 * Writing this register is equivalent to writing to (register_base + DINDEX)
3373 * and incrementing DINDEX by 1.
3382 * 2's complement to bit value conversion. Write the 2's complement value
3383 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3384 * on the next read of this register.
3389 register FUNCTION1 {
3396 * Window into the stack. Each stack location is 10 bits wide reported
3397 * low byte followed by high byte. There are 8 stack locations.
3405 * Interrupt Vector 1 Address
3406 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3408 register INTVEC1_ADDR {
3417 * Address of the SEQRAM instruction currently executing instruction.
3427 * Interrupt Vector 2 Address
3428 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3430 register INTVEC2_ADDR {
3439 * Address of the SEQRAM instruction executed prior to the current instruction.
3448 register AHD_PCI_CONFIG_BASE {
3455 /* ---------------------- Scratch RAM Offsets ------------------------- */
3472 field SEGS_AVAIL 0x01
3473 field LOADING_NEEDED 0x02
3474 field FETCH_INPROG 0x04
3477 * Track whether the transfer byte count for
3478 * the current data phase is odd.
3504 * Per "other-id" execution queues. We use an array of
3505 * tail pointers into lists of SCBs sorted by "other-id".
3506 * The execution head pointer threads the head SCBs for
3519 * SCBID of the next SCB in the new SCB queue.
3521 NEXT_QUEUED_SCB_ADDR {
3525 * head of list of SCBs that have
3526 * completed but have not been
3527 * put into the qoutfifo.
3533 * The list of completed SCBs in
3536 COMPLETE_SCB_DMAINPROG_HEAD {
3540 * head of list of SCBs that have
3541 * completed but need to be uploaded
3542 * to the host prior to being completed.
3544 COMPLETE_DMA_SCB_HEAD {
3547 /* Counting semaphore to prevent new select-outs */
3552 * Mode to restore on legacy idle loop exit.
3558 * Single byte buffer used to designate the type or message
3559 * to send to a target.
3564 /* Parameters for DMA Logic */
3567 field PRELOADEN 0x80
3571 field SDMAENACK 0x10
3573 field HDMAENACK 0x08
3574 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3575 field FIFOFLUSH 0x02
3576 field FIFORESET 0x01
3580 field NOT_IDENTIFIED 0x80
3581 field NO_CDB_SENT 0x40
3582 field TARGET_CMD_IS_TAGGED 0x40
3585 field TARG_CMD_PENDING 0x10
3586 field CMDPHASE_PENDING 0x08
3587 field DPHASE_PENDING 0x04
3588 field SPHASE_PENDING 0x02
3589 field NO_DISCONNECT 0x01
3592 * Temporary storage for the
3593 * target/channel/lun of a
3594 * reconnecting target
3603 * The last bus phase as seen by the sequencer.
3610 field P_BUSFREE 0x01
3611 enum PHASE_MASK CDO|IOO|MSGO {
3614 P_DATAOUT_DT P_DATAOUT|MSGO,
3615 P_DATAIN_DT P_DATAIN|MSGO,
3619 P_MESGIN CDO|IOO|MSGO
3623 * Value to "or" into the SCBPTR[1] value to
3624 * indicate that an entry in the QINFIFO is valid.
3626 QOUTFIFO_ENTRY_VALID_TAG {
3630 * Base address of our shared data with the kernel driver in host
3631 * memory. This includes the qoutfifo and target mode
3632 * incoming command queue.
3638 * Pointer to location in host memory for next
3639 * position in the qoutfifo.
3641 QOUTFIFO_NEXT_ADDR {
3645 * Kernel and sequencer offsets into the queue of
3646 * incoming target mode command descriptors. The
3647 * queue is full when the KERNEL_TQINPOS == TQINPOS.
3658 mask SEND_SENSE 0x40
3660 mask MSGOUT_PHASEMIS 0x10
3661 mask EXIT_MSG_LOOP 0x08
3662 mask CONT_MSG_LOOP_WRITE 0x04
3663 mask CONT_MSG_LOOP_READ 0x03
3664 mask CONT_MSG_LOOP_TARG 0x02
3673 * Snapshot of MSG_OUT taken after each message is sent.
3680 * Sequences the kernel driver has okayed for us. This allows
3681 * the driver to do things like prevent initiator or target
3686 field MANUALCTL 0x40
3690 field ENAUTOATNP 0x02
3695 * The initiator specified tag for this target mode transaction.
3703 field TARGET_MSG_PENDING 0x02
3704 field SELECTOUT_QFROZEN 0x04
3712 * The maximum amount of time to wait, when interrupt coalescing
3713 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3716 INT_COALESCING_TIMER {
3721 * The maximum number of commands to coalesce into a single interrupt.
3722 * Actually the 2's complement of that value to simplify sequencer
3725 INT_COALESCING_MAXCMDS {
3730 * The minimum number of commands still outstanding required
3731 * to continue coalescing (2's complement of value).
3733 INT_COALESCING_MINCMDS {
3738 * Number of commands "in-flight".
3745 * The count of commands that have been coalesced.
3747 INT_COALESCING_CMDCOUNT {
3752 * Since the HS_MAIBOX is self clearing, copy its contents to
3753 * this position in scratch ram every time it changes.
3759 * Target-mode CDB type to CDB length table used
3760 * in non-packetized operation.
3767 /************************* Hardware SCB Definition ****************************/
3772 SCB_RESIDUAL_DATACNT {
3775 alias SCB_HOST_CDB_PTR
3777 SCB_RESIDUAL_SGPTR {
3779 field SG_ADDR_MASK 0xf8 /* In the last byte */
3780 field SG_OVERRUN_RESID 0x02 /* In the first byte */
3781 field SG_LIST_NULL 0x01 /* In the first byte */
3785 alias SCB_HOST_CDB_LEN
3790 SCB_TARGET_DATA_DIR {
3798 * Only valid if CDB length is less than 13 bytes or
3799 * we are using a CDB pointer. Otherwise contains
3800 * the last 4 bytes of embedded cdb information.
3803 alias SCB_NEXT_COMPLETE
3806 alias SCB_FIFO_USE_COUNT
3811 field TARGET_SCB 0x80
3814 field MK_MESSAGE 0x10
3815 field STATUS_RCVD 0x08
3816 field DISCONNECTED 0x04
3817 field SCB_TAG_TYPE 0x03
3828 SCB_TASK_ATTRIBUTE {
3831 * Overloaded field for non-packetized
3832 * ignore wide residue message handling.
3834 field SCB_XFERLEN_ODD 0x01
3838 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
3840 SCB_TASK_MANAGEMENT {
3848 * The last byte is really the high address bits for
3852 field SG_LAST_SEG 0x80 /* In the fourth byte */
3853 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
3857 field SG_STATUS_VALID 0x04 /* In the first byte */
3858 field SG_FULL_RESID 0x02 /* In the first byte */
3859 field SG_LIST_NULL 0x01 /* In the first byte */
3865 alias SCB_NEXT_SCB_BUSADDR
3875 SCB_DISCONNECTED_LISTS {
3880 /*********************************** Constants ********************************/
3881 const MK_MESSAGE_BIT_OFFSET 4
3883 const TARGET_CMD_CMPLT 0xfe
3884 const INVALID_ADDR 0x80
3885 #define SCB_LIST_NULL 0xff
3886 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
3888 const CCSGADDR_MAX 0x80
3889 const CCSCBADDR_MAX 0x80
3890 const CCSGRAM_MAXSEGS 16
3892 /* Selection Timeout Timer Constants */
3893 const STIMESEL_SHIFT 3
3894 const STIMESEL_MIN 0x18
3895 const STIMESEL_BUG_ADJ 0x8
3897 /* WDTR Message values */
3898 const BUS_8_BIT 0x00
3899 const BUS_16_BIT 0x01
3900 const BUS_32_BIT 0x02
3902 /* Offset maximums */
3903 const MAX_OFFSET 0xfe
3904 const MAX_OFFSET_PACED 0xfe
3905 const MAX_OFFSET_PACED_BUG 0x7f
3907 * Some 160 devices incorrectly accept 0xfe as a
3908 * sync offset, but will overrun this value. Limit
3909 * to 0x7f for speed lower than U320 which will
3910 * avoid the persistent sync offset overruns.
3912 const MAX_OFFSET_NON_PACED 0x7f
3916 * The size of our sense buffers.
3917 * Sense buffer mapping can be handled in either of two ways.
3918 * The first is to allocate a dmamap for each transaction.
3919 * Depending on the architecture, dmamaps can be costly. The
3920 * alternative is to statically map the buffers in much the same
3921 * way we handle our scatter gather lists. The driver implements
3924 const AHD_SENSE_BUFSIZE 256
3926 /* Target mode command processing constants */
3927 const CMD_GROUP_CODE_SHIFT 0x05
3929 const STATUS_BUSY 0x08
3930 const STATUS_QUEUE_FULL 0x28
3931 const STATUS_PKT_SENSE 0xFF
3932 const TARGET_DATA_IN 1
3934 const SCB_TRANSFER_SIZE_FULL_LUN 56
3935 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
3936 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
3937 const PKT_OVERRUN_BUFSIZE 512
3942 const AHD_TIMER_US_PER_TICK 25
3943 const AHD_TIMER_MAX_TICKS 0xFFFF
3944 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
3947 * Downloaded (kernel inserted) constants
3949 const SG_PREFETCH_CNT download
3950 const SG_PREFETCH_CNT_LIMIT download
3951 const SG_PREFETCH_ALIGN_MASK download
3952 const SG_PREFETCH_ADDR_MASK download
3953 const SG_SIZEOF download
3954 const PKT_OVERRUN_BUFOFFSET download
3955 const SCB_TRANSFER_SIZE download
3960 const NVRAM_SCB_OFFSET 0x2C