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.
40 * $FreeBSD: src/sys/dev/aic7xxx/aic79xx.reg,v 1.18 2004/08/04 17:55:34 gibbs Exp $
41 * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx.reg,v 1.5 2007/07/06 02:40:58 pavalos Exp $
43 VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic79xx.reg#76 $"
46 * This file is processed by the aic7xxx_asm utility for use in assembling
47 * firmware for the aic79xx family of SCSI host adapters as well as to generate
48 * a C header file for use in the kernel portion of the Aic79xx driver.
51 /* Register window Modes */
59 #define MK_MODE(src, dst) ((src) | ((dst) << M_DST_SHIFT))
60 #define SET_MODE(src, dst) \
63 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
64 mvi MK_MODE(src, dst) call set_mode_work_around; \
66 mvi MODE_PTR, MK_MODE(src, dst); \
69 #define RESTORE_MODE(mode) \
70 if ((ahd->bugs & AHD_SET_MODE_BUG) != 0) { \
71 mov mode call set_mode_work_around; \
76 #define SET_SEQINTCODE(code) \
77 if ((ahd->bugs & AHD_INTCOLLISION_BUG) != 0) { \
78 mvi code call set_seqint_work_around; \
80 mvi SEQINTCODE, code; \
85 * Controls which of the 5, 512byte, address spaces should be used
86 * as the source and destination of any register accesses in our
97 const SRC_MODE_SHIFT 0
98 const DST_MODE_SHIFT 4
101 * Host Interrupt Status
118 * Sequencer Interrupt Code
120 register SEQINTCODE {
124 NO_SEQINT, /* No seqint pending. */
125 BAD_PHASE, /* unknown scsi bus phase */
126 SEND_REJECT, /* sending a message reject */
127 PROTO_VIOLATION, /* Protocol Violation */
128 NO_MATCH, /* no cmd match for reconnect */
129 IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
131 * Returned to data phase
133 * transfer pointers to be
134 * recalculated from the
138 * The bus is ready for the
139 * host to perform another
140 * message transaction. This
141 * mechanism is used for things
142 * like sync/wide negotiation
143 * that require a kernel based
144 * message state engine.
146 BAD_STATUS, /* Bad status from target */
148 * Target attempted to write
149 * beyond the bounds of its
153 * Target completed command
154 * without honoring our ATN
155 * request to issue a message.
158 * The sequencer never saw
159 * the bus go free after
160 * either a command complete
161 * or disconnect message.
170 TASKMGMT_FUNC_COMPLETE, /*
171 * Task management function
172 * request completed with
173 * an expected busfree.
175 TASKMGMT_CMD_CMPLT_OKAY, /*
176 * A command with a non-zero
177 * task management function
178 * has completed via the normal
179 * command completion method
180 * for commands with a zero
181 * task management function.
182 * This happens when an attempt
183 * to abort a command loses
184 * the race for the command to
197 * 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.
249 field SEQ_RESET 0x80 /* Rev B or greater */
252 field SWTIMER_START_B 0x08 /* Rev B or greater */
256 field CHIPRSTACK 0x01
260 * Host New SCB Queue Offset
262 register HNSCB_QOFF {
269 * Host Empty SCB Queue Offset
271 register HESCB_QOFF {
279 register HS_MAILBOX {
282 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
283 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
287 * Sequencer Interupt Status
289 register SEQINTSTAT {
292 field SEQ_SWTMRTO 0x10
293 field SEQ_SEQINT 0x08
294 field SEQ_SCSIINT 0x04
295 field SEQ_PCIINT 0x02
296 field SEQ_SPLTINT 0x01
300 * Clear SEQ Interrupt
302 register CLRSEQINTSTAT {
305 field CLRSEQ_SWTMRTO 0x10
306 field CLRSEQ_SEQINT 0x08
307 field CLRSEQ_SCSIINT 0x04
308 field CLRSEQ_PCIINT 0x02
309 field CLRSEQ_SPLTINT 0x01
322 * SEQ New SCB Queue Offset
324 register SNSCB_QOFF {
332 * SEQ Empty SCB Queue Offset
334 register SESCB_QOFF {
341 * SEQ Done SCB Queue Offset
343 register SDSCB_QOFF {
351 * Queue Offset Control & Status
353 register QOFF_CTLSTA {
357 field EMPTY_SCB_AVAIL 0x80
358 field NEW_SCB_AVAIL 0x40
359 field SDSCB_ROLLOVR 0x20
360 field HS_MAILBOX_ACT 0x10
361 field SCB_QSIZE 0x0F {
384 field SWTMINTMASK 0x80
386 field SWTIMER_START 0x20
387 field AUTOCLRCMDINT 0x10
402 field SCSIENWRDIS 0x40 /* Rev B only. */
408 field DIRECTIONACK 0x04
410 field FIFOFLUSHACK 0x02
411 field DIRECTIONEN 0x01
415 * Device Space Command 0
417 register DSCOMMAND0 {
421 field CACHETHEN 0x80 /* Cache Threshold enable */
422 field DPARCKEN 0x40 /* Data Parity Check Enable */
423 field MPARCKEN 0x20 /* Memory Parity Check Enable */
424 field EXTREQLCK 0x10 /* External Request Lock */
425 field DISABLE_TWATE 0x02 /* Rev B or greater */
426 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
436 field PRELOAD_AVAIL 0x80
437 field PKT_PRELOAD_AVAIL 0x40
448 register SG_CACHE_PRE {
452 field SG_ADDR_MASK 0xf8
457 register SG_CACHE_SHADOW {
461 field SG_ADDR_MASK 0xf8
464 field LAST_SEG_DONE 0x01
474 field RESET_HARB 0x80
475 field RETRY_SWEN 0x08
480 * Data Channel Host Address
490 * Host Overlay DMA Address
507 field SPLIT_DROP_REQ 0x80
511 * Data Channel Host Count
521 * Host Overlay DMA Count
531 * Host Overlay DMA Enable
540 * Scatter/Gather Host Address
560 * Scatter/Gather Host Count
578 * Data FIFO Threshold
584 field WR_DFTHRSH 0x70 {
594 field RD_DFTHRSH 0x07 {
636 * Data Channel Receive Message 0
647 * CMC Recieve Message 0
658 * Overlay Recieve Message 0
660 register OVLYRXMSG0 {
669 * Relaxed Order Enable
684 * Data Channel Receive Message 1
694 * CMC Recieve Message 1
704 * Overlay Recieve Message 1
706 register OVLYRXMSG1 {
729 * Data Channel Receive Message 2
739 * CMC Recieve Message 2
749 * Overlay Recieve Message 2
751 register OVLYRXMSG2 {
759 * Outstanding Split Transactions
768 * Data Channel Receive Message 3
778 * CMC Recieve Message 3
788 * Overlay Recieve Message 3
790 register OVLYRXMSG3 {
805 field UNEXPSCIEN 0x20
806 field SPLTSMADIS 0x10
807 field SPLTSTADIS 0x08
814 * CMC Sequencer Byte Count
816 register CMCSEQBCNT {
823 * Overlay Sequencer Byte Count
825 register OVLYSEQBCNT {
832 * Data Channel Sequencer Byte Count
834 register DCHSEQBCNT {
842 * Data Channel Split Status 0
844 register DCHSPLTSTAT0 {
851 field SCDATBUCKET 0x10
852 field CNTNOTCMPLT 0x08
861 register CMCSPLTSTAT0 {
868 field SCDATBUCKET 0x10
869 field CNTNOTCMPLT 0x08
876 * Overlay Split Status 0
878 register OVLYSPLTSTAT0 {
885 field SCDATBUCKET 0x10
886 field CNTNOTCMPLT 0x08
893 * Data Channel Split Status 1
895 register DCHSPLTSTAT1 {
899 field RXDATABUCKET 0x01
905 register CMCSPLTSTAT1 {
909 field RXDATABUCKET 0x01
913 * Overlay Split Status 1
915 register OVLYSPLTSTAT1 {
919 field RXDATABUCKET 0x01
923 * S/G Receive Message 0
934 * S/G Receive Message 1
944 * S/G Receive Message 2
954 * S/G Receive Message 3
964 * Slave Split Out Address 0
966 register SLVSPLTOUTADR0 {
970 field LOWER_ADDR 0x7F
974 * Slave Split Out Address 1
976 register SLVSPLTOUTADR1 {
985 * Slave Split Out Address 2
987 register SLVSPLTOUTADR2 {
995 * Slave Split Out Address 3
997 register SLVSPLTOUTADR3 {
1006 * SG Sequencer Byte Count
1008 register SGSEQBCNT {
1011 modes M_DFF0, M_DFF1
1015 * Slave Split Out Attribute 0
1017 register SLVSPLTOUTATTR0 {
1021 field LOWER_BCNT 0xFF
1025 * Slave Split Out Attribute 1
1027 register SLVSPLTOUTATTR1 {
1031 field CMPLT_DNUM 0xF8
1032 field CMPLT_FNUM 0x07
1036 * Slave Split Out Attribute 2
1038 register SLVSPLTOUTATTR2 {
1043 field CMPLT_BNUM 0xFF
1046 * S/G Split Status 0
1048 register SGSPLTSTAT0 {
1051 modes M_DFF0, M_DFF1
1055 field SCDATBUCKET 0x10
1056 field CNTNOTCMPLT 0x08
1059 field RXSPLTRSP 0x01
1063 * S/G Split Status 1
1065 register SGSPLTSTAT1 {
1068 modes M_DFF0, M_DFF1
1069 field RXDATABUCKET 0x01
1079 field TEST_GROUP 0xF0
1084 * Data FIFO 0 PCI Status
1086 register DF0PCISTAT {
1101 * Data FIFO 1 PCI Status
1103 register DF1PCISTAT {
1120 register SGPCISTAT {
1136 register CMCPCISTAT {
1151 * Overlay PCI Status
1153 register OVLYPCISTAT {
1167 * PCI Status for MSI Master DMA Transfer
1169 register MSIPCISTAT {
1176 field CLRPENDMSI 0x08
1182 * PCI Status for Target
1184 register TARGPCISTAT {
1196 * The last LQ Packet recieved
1202 modes M_DFF0, M_DFF1, M_SCSI
1207 * SCB offset for Target Mode SCB type information
1217 * SCB offset to the Two Byte tag identifier used for target mode.
1226 * Logical Unit Number Pointer
1227 * SCB offset to the LSB (little endian) of the lun field.
1236 * Data Length Pointer
1237 * SCB offset for the 4 byte data length field in target mode.
1239 register DATALENPTR {
1246 * Status Length Pointer
1247 * SCB offset to the two byte status field in target SCBs.
1249 register STATLENPTR {
1256 * Command Length Pointer
1257 * Scb offset for the CDB length field in initiator SCBs.
1259 register CMDLENPTR {
1266 * Task Attribute Pointer
1267 * Scb offset for the byte field specifying the attribute byte
1268 * to be used in command packets.
1277 * Task Management Flags Pointer
1278 * Scb offset for the byte field specifying the attribute flags
1279 * byte to be used in command packets.
1289 * Scb offset for the first byte in the CDB for initiator SCBs.
1298 * Queue Next Pointer
1299 * Scb offset for the 2 byte "next scb link".
1309 * Scb offset to the value to place in the SCSIID register
1310 * during target mode connections.
1319 * Command Aborted Byte Pointer
1320 * Offset to the SCB flags field that includes the
1321 * "SCB aborted" status bit.
1323 register ABRTBYTEPTR {
1330 * Command Aborted Bit Pointer
1331 * Bit offset in the SCB flags field for "SCB aborted" status.
1333 register ABRTBITPTR {
1342 register MAXCMDBYTES {
1351 register MAXCMD2RCV {
1360 register SHORTTHRESH {
1367 * Logical Unit Number Length
1368 * The length, in bytes, of the SCB lun field.
1377 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1381 * The size, in bytes, of the embedded CDB field in initator SCBs.
1391 * The maximum number of commands to issue during a
1392 * single packetized connection.
1401 * Maximum Command Counter
1402 * The number of commands already sent during this connection
1404 register MAXCMDCNT {
1411 * LQ Packet Reserved Bytes
1412 * The bytes to be sent in the currently reserved fileds
1413 * of all LQ packets.
1432 * Command Reserved 0
1433 * The byte to be sent for the reserved byte 0 of
1434 * outgoing command packets.
1443 * LQ Manager Control 0
1449 field LQITARGCLT 0xC0
1450 field LQIINITGCLT 0x30
1451 field LQ0TARGCLT 0x0C
1452 field LQ0INITGCLT 0x03
1456 * LQ Manager Control 1
1461 modes M_DFF0, M_DFF1, M_SCSI
1463 field SINGLECMD 0x02
1464 field ABORTPENDING 0x01
1468 * LQ Manager Control 2
1473 modes M_DFF0, M_DFF1, M_SCSI
1475 field LQICONTINUE 0x40
1476 field LQITOIDLE 0x20
1479 field LQOCONTINUE 0x04
1480 field LQOTOIDLE 0x02
1491 field GSBISTERR 0x40
1492 field GSBISTDONE 0x20
1493 field GSBISTRUN 0x10
1494 field OSBISTERR 0x04
1495 field OSBISTDONE 0x02
1496 field OSBISTRUN 0x01
1500 * SCSI Sequence Control0
1505 modes M_DFF0, M_DFF1, M_SCSI
1509 field FORCEBUSFREE 0x10
1520 field NTBISTERR 0x04
1521 field NTBISTDONE 0x02
1522 field NTBISTRUN 0x01
1526 * SCSI Sequence Control 1
1531 modes M_DFF0, M_DFF1, M_SCSI
1532 field MANUALCTL 0x40
1536 field ENAUTOATNP 0x02
1541 * SCSI Transfer Control 0
1549 field BIOSCANCELEN 0x10
1554 * SCSI Transfer Control 1
1560 field BITBUCKET 0x80
1570 * SCSI Transfer Control 2
1576 field AUTORSTDIS 0x10
1582 * SCSI Bus Initiator IDs
1583 * Bitmask of observed initiators on the bus.
1585 register BUSINITID {
1593 * Data Length Counters
1594 * Packet byte counter.
1599 modes M_DFF0, M_DFF1
1610 field FIFO1FREE 0x20
1611 field FIFO0FREE 0x10
1613 * On the B, this enum only works
1614 * in the read direction. For writes,
1615 * you must use the B version of the
1616 * CURRFIFO_0 definition which is defined
1617 * as a constant outside of this register
1618 * definition to avoid confusing the
1619 * register pretty printing code.
1621 enum CURRFIFO 0x03 {
1628 const B_CURRFIFO_0 0x2
1631 * SCSI Bus Target IDs
1632 * Bitmask of observed targets on the bus.
1634 register BUSTARGID {
1642 * SCSI Control Signal Out
1647 modes M_DFF0, M_DFF1, M_SCSI
1657 * Possible phases to write into SCSISIG0
1659 enum PHASE_MASK CDO|IOO|MSGO {
1662 P_DATAOUT_DT P_DATAOUT|MSGO,
1663 P_DATAIN_DT P_DATAIN|MSGO,
1667 P_MESGIN CDO|IOO|MSGO
1674 modes M_DFF0, M_DFF1, M_SCSI
1684 * Possible phases in SCSISIGI
1686 enum PHASE_MASK CDO|IOO|MSGO {
1689 P_DATAOUT_DT P_DATAOUT|MSGO,
1690 P_DATAIN_DT P_DATAIN|MSGO,
1694 P_MESGIN CDO|IOO|MSGO
1699 * Multiple Target IDs
1700 * Bitmask of ids to respond as a target.
1702 register MULTARGID {
1712 register SCSIPHASE {
1715 modes M_DFF0, M_DFF1, M_SCSI
1716 field STATUS_PHASE 0x20
1717 field COMMAND_PHASE 0x10
1718 field MSG_IN_PHASE 0x08
1719 field MSG_OUT_PHASE 0x04
1720 field DATA_PHASE_MASK 0x03 {
1721 DATA_OUT_PHASE 0x01,
1729 register SCSIDAT0_IMG {
1732 modes M_DFF0, M_DFF1, M_SCSI
1741 modes M_DFF0, M_DFF1, M_SCSI
1751 modes M_DFF0, M_DFF1, M_SCSI
1761 modes M_DFF0, M_DFF1, M_SCSI
1767 * Selection/Reselection ID
1768 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1769 * device did not set its own ID.
1774 modes M_DFF0, M_DFF1, M_SCSI
1775 field SELID_MASK 0xf0
1780 * SCSI Block Control
1781 * Controls Bus type and channel selection. SELWIDE allows for the
1782 * coexistence of 8bit and 16bit devices on a wide bus.
1787 modes M_DFF0, M_DFF1, M_SCSI
1788 field DIAGLEDEN 0x80
1789 field DIAGLEDON 0x40
1790 field ENAB40 0x08 /* LVD transceiver active */
1791 field ENAB20 0x04 /* SE/HVD transceiver active */
1798 register OPTIONMODE {
1802 field BIOSCANCTL 0x80
1803 field AUTOACKEN 0x40
1804 field BIASCANCTL 0x20
1805 field BUSFREEREV 0x10
1806 field ENDGFORMCHK 0x04
1807 field AUTO_MSGOUT_DE 0x02
1808 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1817 modes M_DFF0, M_DFF1, M_SCSI
1818 field TARGET 0x80 /* Board acting as target */
1819 field SELDO 0x40 /* Selection Done */
1820 field SELDI 0x20 /* Board has been selected */
1821 field SELINGO 0x10 /* Selection In Progress */
1822 field IOERR 0x08 /* LVD Tranceiver mode changed */
1823 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1824 field SPIORDY 0x02 /* SCSI PIO Ready */
1825 field ARBDO 0x01 /* Arbitration Done Out */
1829 * Clear SCSI Interrupt 0
1830 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1835 modes M_DFF0, M_DFF1, M_SCSI
1838 field CLRSELINGO 0x10
1840 field CLROVERRUN 0x04
1841 field CLRSPIORDY 0x02
1846 * SCSI Interrupt Mode 0
1847 * Setting any bit will enable the corresponding function
1848 * in SIMODE0 to interrupt via the IRQ pin.
1856 field ENSELINGO 0x10
1858 field ENOVERRUN 0x04
1859 field ENSPIORDY 0x02
1869 modes M_DFF0, M_DFF1, M_SCSI
1876 field STRB2FAST 0x02
1881 * Clear SCSI Interrupt 1
1882 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1887 modes M_DFF0, M_DFF1, M_SCSI
1888 field CLRSELTIMEO 0x80
1890 field CLRSCSIRSTI 0x20
1891 field CLRBUSFREE 0x08
1892 field CLRSCSIPERR 0x04
1893 field CLRSTRB2FAST 0x02
1894 field CLRREQINIT 0x01
1903 modes M_DFF0, M_DFF1, M_SCSI
1904 field BUSFREETIME 0xc0 {
1909 field NONPACKREQ 0x20
1910 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
1911 field BSYX 0x08 /* Busy Expander */
1912 field WIDE_RES 0x04 /* Modes 0 and 1 only */
1913 field SDONE 0x02 /* Modes 0 and 1 only */
1914 field DMADONE 0x01 /* Modes 0 and 1 only */
1918 * Clear SCSI Interrupt 2
1923 modes M_DFF0, M_DFF1, M_SCSI
1924 field CLRNONPACKREQ 0x20
1925 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
1926 field CLRSDONE 0x02 /* Modes 0 and 1 only */
1927 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
1931 * SCSI Interrupt Mode 2
1937 field ENWIDE_RES 0x04
1939 field ENDMADONE 0x01
1943 * Physical Error Diagnosis
1948 modes M_DFF0, M_DFF1, M_SCSI
1951 field PREVPHASE 0x20
1952 field PARITYERR 0x10
1955 field DGFORMERR 0x02
1960 * LQI Manager Current State
1974 modes M_DFF0, M_DFF1, M_SCSI
1978 * LQO Manager Current State
1987 * LQI Manager Status
1992 modes M_DFF0, M_DFF1, M_SCSI
1993 field LQIATNQAS 0x20
1996 field LQIBADLQT 0x04
1998 field LQIATNCMD 0x01
2002 * Clear LQI Interrupts 0
2004 register CLRLQIINT0 {
2007 modes M_DFF0, M_DFF1, M_SCSI
2008 field CLRLQIATNQAS 0x20
2009 field CLRLQICRCT1 0x10
2010 field CLRLQICRCT2 0x08
2011 field CLRLQIBADLQT 0x04
2012 field CLRLQIATNLQ 0x02
2013 field CLRLQIATNCMD 0x01
2017 * LQI Manager Interrupt Mode 0
2023 field ENLQIATNQASK 0x20
2024 field ENLQICRCT1 0x10
2025 field ENLQICRCT2 0x08
2026 field ENLQIBADLQT 0x04
2027 field ENLQIATNLQ 0x02
2028 field ENLQIATNCMD 0x01
2032 * LQI Manager Status 1
2037 modes M_DFF0, M_DFF1, M_SCSI
2038 field LQIPHASE_LQ 0x80
2039 field LQIPHASE_NLQ 0x40
2041 field LQICRCI_LQ 0x10
2042 field LQICRCI_NLQ 0x08
2043 field LQIBADLQI 0x04
2044 field LQIOVERI_LQ 0x02
2045 field LQIOVERI_NLQ 0x01
2049 * Clear LQI Manager Interrupts1
2051 register CLRLQIINT1 {
2054 modes M_DFF0, M_DFF1, M_SCSI
2055 field CLRLQIPHASE_LQ 0x80
2056 field CLRLQIPHASE_NLQ 0x40
2057 field CLRLIQABORT 0x20
2058 field CLRLQICRCI_LQ 0x10
2059 field CLRLQICRCI_NLQ 0x08
2060 field CLRLQIBADLQI 0x04
2061 field CLRLQIOVERI_LQ 0x02
2062 field CLRLQIOVERI_NLQ 0x01
2066 * LQI Manager Interrupt Mode 1
2072 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2073 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2074 field ENLIQABORT 0x20
2075 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2076 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2077 field ENLQIBADLQI 0x04
2078 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2079 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2083 * LQI Manager Status 2
2088 modes M_DFF0, M_DFF1, M_SCSI
2089 field PACKETIZED 0x80
2090 field LQIPHASE_OUTPKT 0x40
2091 field LQIWORKONLQ 0x20
2092 field LQIWAITFIFO 0x10
2093 field LQISTOPPKT 0x08
2094 field LQISTOPLQ 0x04
2095 field LQISTOPCMD 0x02
2096 field LQIGSAVAIL 0x01
2105 modes M_DFF0, M_DFF1, M_SCSI
2106 field NTRAMPERR 0x02
2107 field OSRAMPERR 0x01
2111 * Clear SCSI Status 3
2116 modes M_DFF0, M_DFF1, M_SCSI
2117 field CLRNTRAMPERR 0x02
2118 field CLROSRAMPERR 0x01
2122 * SCSI Interrupt Mode 3
2128 field ENNTRAMPERR 0x02
2129 field ENOSRAMPERR 0x01
2133 * LQO Manager Status 0
2138 modes M_DFF0, M_DFF1, M_SCSI
2139 field LQOTARGSCBPERR 0x10
2140 field LQOSTOPT2 0x08
2142 field LQOATNPKT 0x02
2147 * Clear LQO Manager interrupt 0
2149 register CLRLQOINT0 {
2152 modes M_DFF0, M_DFF1, M_SCSI
2153 field CLRLQOTARGSCBPERR 0x10
2154 field CLRLQOSTOPT2 0x08
2155 field CLRLQOATNLQ 0x04
2156 field CLRLQOATNPKT 0x02
2157 field CLRLQOTCRC 0x01
2161 * LQO Manager Interrupt Mode 0
2167 field ENLQOTARGSCBPERR 0x10
2168 field ENLQOSTOPT2 0x08
2169 field ENLQOATNLQ 0x04
2170 field ENLQOATNPKT 0x02
2171 field ENLQOTCRC 0x01
2175 * LQO Manager Status 1
2180 modes M_DFF0, M_DFF1, M_SCSI
2181 field LQOINITSCBPERR 0x10
2182 field LQOSTOPI2 0x08
2183 field LQOBADQAS 0x04
2184 field LQOBUSFREE 0x02
2185 field LQOPHACHGINPKT 0x01
2189 * Clear LOQ Interrupt 1
2191 register CLRLQOINT1 {
2194 modes M_DFF0, M_DFF1, M_SCSI
2195 field CLRLQOINITSCBPERR 0x10
2196 field CLRLQOSTOPI2 0x08
2197 field CLRLQOBADQAS 0x04
2198 field CLRLQOBUSFREE 0x02
2199 field CLRLQOPHACHGINPKT 0x01
2203 * LQO Manager Interrupt Mode 1
2209 field ENLQOINITSCBPERR 0x10
2210 field ENLQOSTOPI2 0x08
2211 field ENLQOBADQAS 0x04
2212 field ENLQOBUSFREE 0x02
2213 field ENLQOPHACHGINPKT 0x01
2217 * LQO Manager Status 2
2222 modes M_DFF0, M_DFF1, M_SCSI
2224 field LQOWAITFIFO 0x10
2225 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2226 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2230 * Output Synchronizer Space Count
2232 register OS_SPACE_CNT {
2239 * SCSI Interrupt Mode 1
2240 * Setting any bit will enable the corresponding function
2241 * in SIMODE1 to interrupt via the IRQ pin.
2246 modes M_DFF0, M_DFF1, M_SCSI
2247 field ENSELTIMO 0x80
2248 field ENATNTARG 0x40
2249 field ENSCSIRST 0x20
2250 field ENPHASEMIS 0x10
2251 field ENBUSFREE 0x08
2252 field ENSCSIPERR 0x04
2253 field ENSTRB2FAST 0x02
2254 field ENREQINIT 0x01
2264 modes M_DFF0, M_DFF1, M_SCSI
2268 * Data FIFO SCSI Transfer Control
2270 register DFFSXFRCTL {
2273 modes M_DFF0, M_DFF1
2274 field DFFBITBUCKET 0x08
2281 * Next SCSI Control Block
2291 register LQOSCSCTL {
2296 field LQOH2A_VERSION 0x80
2297 field LQONOCHKOVER 0x01
2303 register SEQINTSRC {
2306 modes M_DFF0, M_DFF1
2310 field CFG4ISTAT 0x08
2311 field CFG4TSTAT 0x04
2317 * Clear Arp Interrupts
2319 register CLRSEQINTSRC {
2322 modes M_DFF0, M_DFF1
2323 field CLRCTXTDONE 0x40
2324 field CLRSAVEPTRS 0x20
2325 field CLRCFG4DATA 0x10
2326 field CLRCFG4ISTAT 0x08
2327 field CLRCFG4TSTAT 0x04
2328 field CLRCFG4ICMD 0x02
2329 field CLRCFG4TCMD 0x01
2333 * SEQ Interrupt Enabled (Shared)
2338 modes M_DFF0, M_DFF1
2339 field ENCTXTDONE 0x40
2340 field ENSAVEPTRS 0x20
2341 field ENCFG4DATA 0x10
2342 field ENCFG4ISTAT 0x08
2343 field ENCFG4TSTAT 0x04
2344 field ENCFG4ICMD 0x02
2345 field ENCFG4TCMD 0x01
2349 * Current SCSI Control Block
2364 modes M_DFF0, M_DFF1
2365 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2366 field SHCNTMINUS1 0x20 /* Rev B or higher */
2367 field LASTSDONE 0x10
2369 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2370 field DATAINFIFO 0x02
2377 register CRCCONTROL {
2381 field CRCVALCHKEN 0x40
2392 field SEL_TXPLL_DEBUG 0x04
2396 * Data FIFO Queue Tag
2402 modes M_DFF0, M_DFF1
2406 * Last SCSI Control Block
2416 * SCSI I/O Cell Power-down Control
2422 field DISABLE_OE 0x80
2423 field PDN_IDIST 0x04
2424 field PDN_DIFFSENSE 0x01
2428 * Shaddow Host Address.
2434 modes M_DFF0, M_DFF1
2438 * Data Group CRC Interval.
2448 * Data Transfer Negotiation Address
2457 * Data Transfer Negotiation Data - Period Byte
2459 register NEGPERIOD {
2466 * Packetized CRC Interval
2476 * Data Transfer Negotiation Data - Offset Byte
2478 register NEGOFFSET {
2485 * Data Transfer Negotiation Data - PPR Options
2487 register NEGPPROPTS {
2491 field PPROPT_PACE 0x08
2492 field PPROPT_QAS 0x04
2493 field PPROPT_DT 0x02
2494 field PPROPT_IUT 0x01
2498 * Data Transfer Negotiation Data - Connection Options
2500 register NEGCONOPTS {
2504 field ENSNAPSHOT 0x40
2505 field RTI_WRTDIS 0x20
2506 field RTI_OVRDTRN 0x10
2507 field ENSLOWCRC 0x08
2508 field ENAUTOATNI 0x04
2509 field ENAUTOATNO 0x02
2514 * Negotiation Table Annex Column Index.
2526 field STSELSKIDDIS 0x40
2527 field CURRFIFODEF 0x20
2528 field WIDERESEN 0x10
2529 field SDONEMSKDIS 0x08
2530 field DFFACTCLR 0x04
2531 field SHVALIDSTDIS 0x02
2532 field LSTSGCLRDIS 0x01
2535 const AHD_ANNEXCOL_PER_DEV0 4
2536 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2537 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2538 const AHD_PRECOMP_MASK 0x07
2539 const AHD_PRECOMP_SHIFT 0
2540 const AHD_PRECOMP_CUTBACK_17 0x04
2541 const AHD_PRECOMP_CUTBACK_29 0x06
2542 const AHD_PRECOMP_CUTBACK_37 0x07
2543 const AHD_SLEWRATE_MASK 0x78
2544 const AHD_SLEWRATE_SHIFT 3
2546 * Rev A has only a single bit (high bit of field) of slew adjustment.
2547 * Rev B has 4 bits. The current default happens to be the same for both.
2549 const AHD_SLEWRATE_DEF_REVA 0x08
2550 const AHD_SLEWRATE_DEF_REVB 0x08
2552 /* Rev A does not have any amplitude setting. */
2553 const AHD_ANNEXCOL_AMPLITUDE 6
2554 const AHD_AMPLITUDE_MASK 0x7
2555 const AHD_AMPLITUDE_SHIFT 0
2556 const AHD_AMPLITUDE_DEF 0x7
2559 * Negotiation Table Annex Data Port.
2568 * Initiator's Own Id.
2569 * The SCSI ID to use for Selection Out and seen during a reselection..
2578 * 960MHz Phase-Locked Loop Control 0
2580 register PLL960CTL0 {
2584 field PLL_VCOSEL 0x80
2587 field PLL_ENLUD 0x08
2588 field PLL_ENLPF 0x04
2590 field PLL_ENFBM 0x01
2603 * 960MHz Phase-Locked Loop Control 1
2605 register PLL960CTL1 {
2609 field PLL_CNTEN 0x80
2610 field PLL_CNTCLR 0x40
2615 * Expander Signature
2630 modes M_DFF0, M_DFF1
2643 * 960-MHz Phase-Locked Loop Test Count
2645 register PLL960CNT0 {
2653 * 400-MHz Phase-Locked Loop Control 0
2655 register PLL400CTL0 {
2659 field PLL_VCOSEL 0x80
2662 field PLL_ENLUD 0x08
2663 field PLL_ENLPF 0x04
2665 field PLL_ENFBM 0x01
2669 * Arbitration Fairness
2679 * 400-MHz Phase-Locked Loop Control 1
2681 register PLL400CTL1 {
2685 field PLL_CNTEN 0x80
2686 field PLL_CNTCLR 0x40
2691 * Arbitration Unfairness
2693 register UNFAIRNESS {
2701 * 400-MHz Phase-Locked Loop Test Count
2703 register PLL400CNT0 {
2717 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2721 * CMC SCB Array Count
2722 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2723 * Transfers must be 8byte aligned and sized.
2725 register CCSCBACNT {
2733 * SCB-Next Address Snooping logic. When an SCB is transferred to
2734 * the card, the next SCB address to be used by the CMC array can
2735 * be autoloaded from that transfer.
2737 register SCBAUTOPTR {
2741 field AUSCBPTR_EN 0x80
2742 field SCBPTR_ADDR 0x38
2743 field SCBPTR_OFF 0x07
2747 * CMC SG Ram Address Pointer
2752 modes M_DFF0, M_DFF1
2756 * CMC SCB RAM Address Pointer
2758 register CCSCBADDR {
2765 * CMC SCB Ram Back-up Address Pointer
2766 * Indicates the true stop location of transfers halted prior
2767 * to SCBHCNT going to 0.
2769 register CCSCBADR_BK {
2781 modes M_DFF0, M_DFF1
2783 field SG_CACHE_AVAIL 0x10
2784 field CCSGENACK 0x08
2786 field SG_FETCH_REQ 0x02
2787 field CCSGRESET 0x01
2797 field CCSCBDONE 0x80
2802 field CCSCBRESET 0x01
2808 register CMC_RAMBIST {
2812 field SG_ELEMENT_SIZE 0x80
2813 field SCBRAMBIST_FAIL 0x40
2814 field SG_BIST_FAIL 0x20
2815 field SG_BIST_EN 0x10
2816 field CMC_BUFFER_BIST_FAIL 0x02
2817 field CMC_BUFFER_BIST_EN 0x01
2821 * CMC SG RAM Data Port
2826 modes M_DFF0, M_DFF1
2830 * CMC SCB RAM Data Port
2849 * Flex DMA Byte Count
2861 register FLEXDMASTAT {
2865 field FLEXDMAERR 0x02
2866 field FLEXDMADONE 0x01
2870 * Flex DMA Data Port
2894 field FLXARBACK 0x80
2895 field FLXARBREQ 0x40
2903 * Serial EEPROM Address
2912 * Serial EEPROM Data
2922 * Serial EEPROM Status
2928 field INIT_DONE 0x80
2929 field SEEOPCODE 0x70
2930 field LDALTID_L 0x08
2931 field SEEARBACK 0x04
2937 * Serial EEPROM Control
2943 field SEEOPCODE 0x70 {
2948 * The following four commands use special
2949 * addresses for differentiation.
2953 mask SEEOP_EWEN 0x40
2954 mask SEEOP_WALL 0x40
2955 mask SEEOP_EWDS 0x40
2960 const SEEOP_ERAL_ADDR 0x80
2961 const SEEOP_EWEN_ADDR 0xC0
2962 const SEEOP_WRAL_ADDR 0x40
2963 const SEEOP_EWDS_ADDR 0x00
2975 * Data FIFO Write Address
2976 * Pointer to the next QWD location to be written to the data FIFO.
2982 modes M_DFF0, M_DFF1
2986 * DSP Filter Control
2988 register DSPFLTRCTL {
2992 field FLTRDISABLE 0x20
2993 field EDGESENSE 0x10
2994 field DSPFCNTSEL 0x0F
2998 * DSP Data Channel Control
3000 register DSPDATACTL {
3004 field BYPASSENAB 0x80
3006 field RCVROFFSTDIS 0x04
3007 field XMITOFFSTDIS 0x02
3011 * Data FIFO Read Address
3012 * Pointer to the next QWD location to be read from the data FIFO.
3018 modes M_DFF0, M_DFF1
3024 register DSPREQCTL {
3028 field MANREQCTL 0xC0
3029 field MANREQDLY 0x3F
3035 register DSPACKCTL {
3039 field MANACKCTL 0xC0
3040 field MANACKDLY 0x3F
3045 * Read/Write byte port into the data FIFO. The read and write
3046 * FIFO pointers increment with each read and write respectively
3052 modes M_DFF0, M_DFF1
3056 * DSP Channel Select
3058 register DSPSELECT {
3062 field AUTOINCEN 0x80
3069 * Write Bias Control
3071 register WRTBIASCTL {
3075 field AUTOXBCDIS 0x80
3076 field XMITMANVAL 0x3F
3080 * Currently the WRTBIASCTL is the same as the default.
3082 const WRTBIASCTL_HP_DEFAULT 0x0
3085 * Receiver Bias Control
3087 register RCVRBIOSCTL {
3091 field AUTORBCDIS 0x80
3092 field RCVRMANVAL 0x3F
3096 * Write Bias Calculator
3098 register WRTBIASCALC {
3105 * Data FIFO Pointers
3106 * Contains the byte offset from DFWADDR and DWRADDR to the current
3107 * FIFO write/read locations.
3112 modes M_DFF0, M_DFF1
3116 * Receiver Bias Calculator
3118 register RCVRBIASCALC {
3125 * Data FIFO Backup Read Pointer
3126 * Contains the data FIFO address to be restored if the last
3127 * data accessed from the data FIFO was not transferred successfully.
3133 modes M_DFF0, M_DFF1
3146 * Data FIFO Debug Control
3151 modes M_DFF0, M_DFF1
3152 field DFF_CIO_WR_RDY 0x20
3153 field DFF_CIO_RD_RDY 0x10
3154 field DFF_DIR_ERR 0x08
3155 field DFF_RAMBIST_FAIL 0x04
3156 field DFF_RAMBIST_DONE 0x02
3157 field DFF_RAMBIST_EN 0x01
3161 * Data FIFO Space Count
3162 * Number of FIFO locations that are free.
3168 modes M_DFF0, M_DFF1
3172 * Data FIFO Byte Count
3173 * Number of filled FIFO locations.
3179 modes M_DFF0, M_DFF1
3183 * Sequencer Program Overlay Address.
3184 * Low address must be written prior to high address.
3194 * Sequencer Control 0
3195 * Error detection mode, speed configuration,
3196 * single step, breakpoints and program load.
3201 field PERRORDIS 0x80
3205 field BRKADRINTEN 0x08
3212 * Sequencer Control 1
3213 * Instruction RAM Diagnostics
3218 field OVRLAY_DATA_CHK 0x08
3219 field RAMBIST_DONE 0x04
3220 field RAMBIST_FAIL 0x02
3221 field RAMBIST_EN 0x01
3226 * Zero and Carry state of the ALU.
3236 * Sequencer Interrupt Control
3238 register SEQINTCTL {
3241 field INTVEC1DSL 0x80
3242 field INT1_CONTEXT 0x20
3243 field SCS_SEQ_INT1M1 0x10
3244 field SCS_SEQ_INT1M0 0x08
3251 * Sequencer RAM Data Port
3252 * Single byte window into the Sequencer Instruction Ram area starting
3253 * at the address specified by OVLYADDR. To write a full instruction word,
3254 * simply write four bytes in succession. OVLYADDR will increment after the
3255 * most significant instrution byte (the byte with the parity bit) is written.
3263 * Sequencer Program Counter
3264 * Low byte must be written prior to high byte.
3282 * Source Index Register
3283 * Incrementing index for reads of SINDIR and the destination (low byte only)
3284 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3286 * mvi 0xFF call some_routine;
3288 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3298 * Destination Index Register
3299 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3309 * Sequencer instruction breakpoint address address.
3319 field BRKDIS 0x80 /* Disable Breakpoint */
3324 * All reads to this register return the value 0xFF.
3334 * All reads to this register return the value 0.
3344 * Writes to this register have no effect.
3353 * Source Index Indirect
3354 * Reading this register is equivalent to reading (register_base + SINDEX) and
3355 * incrementing SINDEX by 1.
3363 * Destination Index Indirect
3364 * Writing this register is equivalent to writing to (register_base + DINDEX)
3365 * and incrementing DINDEX by 1.
3374 * 2's complement to bit value conversion. Write the 2's complement value
3375 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3376 * on the next read of this register.
3381 register FUNCTION1 {
3388 * Window into the stack. Each stack location is 10 bits wide reported
3389 * low byte followed by high byte. There are 8 stack locations.
3397 * Interrupt Vector 1 Address
3398 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3400 register INTVEC1_ADDR {
3409 * Address of the SEQRAM instruction currently executing instruction.
3419 * Interrupt Vector 2 Address
3420 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3422 register INTVEC2_ADDR {
3431 * Address of the SEQRAM instruction executed prior to the current instruction.
3440 register AHD_PCI_CONFIG_BASE {
3447 /* ---------------------- Scratch RAM Offsets ------------------------- */
3464 field SEGS_AVAIL 0x01
3465 field LOADING_NEEDED 0x02
3466 field FETCH_INPROG 0x04
3469 * Track whether the transfer byte count for
3470 * the current data phase is odd.
3496 * Per "other-id" execution queues. We use an array of
3497 * tail pointers into lists of SCBs sorted by "other-id".
3498 * The execution head pointer threads the head SCBs for
3511 * SCBID of the next SCB in the new SCB queue.
3513 NEXT_QUEUED_SCB_ADDR {
3517 * head of list of SCBs that have
3518 * completed but have not been
3519 * put into the qoutfifo.
3525 * The list of completed SCBs in
3528 COMPLETE_SCB_DMAINPROG_HEAD {
3532 * head of list of SCBs that have
3533 * completed but need to be uploaded
3534 * to the host prior to being completed.
3536 COMPLETE_DMA_SCB_HEAD {
3540 * tail 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_TAIL {
3548 * head of list of SCBs that have
3549 * been uploaded to the host, but cannot
3550 * be completed until the QFREEZE is in
3551 * full effect (i.e. no selections pending).
3553 COMPLETE_ON_QFREEZE_HEAD {
3557 * Counting semaphore to prevent new select-outs
3558 * The queue is frozen so long as the sequencer
3559 * and kernel freeze counts differ.
3564 KERNEL_QFREEZE_COUNT {
3568 * Mode to restore on legacy idle loop exit.
3574 * Single byte buffer used to designate the type or message
3575 * to send to a target.
3580 /* Parameters for DMA Logic */
3583 field PRELOADEN 0x80
3587 field SDMAENACK 0x10
3589 field HDMAENACK 0x08
3590 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3591 field FIFOFLUSH 0x02
3592 field FIFORESET 0x01
3596 field NOT_IDENTIFIED 0x80
3597 field NO_CDB_SENT 0x40
3598 field TARGET_CMD_IS_TAGGED 0x40
3601 field TARG_CMD_PENDING 0x10
3602 field CMDPHASE_PENDING 0x08
3603 field DPHASE_PENDING 0x04
3604 field SPHASE_PENDING 0x02
3605 field NO_DISCONNECT 0x01
3608 * Temporary storage for the
3609 * target/channel/lun of a
3610 * reconnecting target
3619 * The last bus phase as seen by the sequencer.
3626 field P_BUSFREE 0x01
3627 enum PHASE_MASK CDO|IOO|MSGO {
3630 P_DATAOUT_DT P_DATAOUT|MSGO,
3631 P_DATAIN_DT P_DATAIN|MSGO,
3635 P_MESGIN CDO|IOO|MSGO
3639 * Value to "or" into the SCBPTR[1] value to
3640 * indicate that an entry in the QINFIFO is valid.
3642 QOUTFIFO_ENTRY_VALID_TAG {
3646 * Kernel and sequencer offsets into the queue of
3647 * incoming target mode command descriptors. The
3648 * queue is full when the KERNEL_TQINPOS == TQINPOS.
3657 * Base address of our shared data with the kernel driver in host
3658 * memory. This includes the qoutfifo and target mode
3659 * incoming command queue.
3665 * Pointer to location in host memory for next
3666 * position in the qoutfifo.
3668 QOUTFIFO_NEXT_ADDR {
3674 mask SEND_SENSE 0x40
3676 mask MSGOUT_PHASEMIS 0x10
3677 mask EXIT_MSG_LOOP 0x08
3678 mask CONT_MSG_LOOP_WRITE 0x04
3679 mask CONT_MSG_LOOP_READ 0x03
3680 mask CONT_MSG_LOOP_TARG 0x02
3689 * Snapshot of MSG_OUT taken after each message is sent.
3696 * Sequences the kernel driver has okayed for us. This allows
3697 * the driver to do things like prevent initiator or target
3702 field MANUALCTL 0x40
3706 field ENAUTOATNP 0x02
3711 * The initiator specified tag for this target mode transaction.
3719 field PENDING_MK_MESSAGE 0x01
3720 field TARGET_MSG_PENDING 0x02
3721 field SELECTOUT_QFROZEN 0x04
3729 * The maximum amount of time to wait, when interrupt coalescing
3730 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3733 INT_COALESCING_TIMER {
3738 * The maximum number of commands to coalesce into a single interrupt.
3739 * Actually the 2's complement of that value to simplify sequencer
3742 INT_COALESCING_MAXCMDS {
3747 * The minimum number of commands still outstanding required
3748 * to continue coalescing (2's complement of value).
3750 INT_COALESCING_MINCMDS {
3755 * Number of commands "in-flight".
3762 * The count of commands that have been coalesced.
3764 INT_COALESCING_CMDCOUNT {
3769 * Since the HS_MAIBOX is self clearing, copy its contents to
3770 * this position in scratch ram every time it changes.
3776 * Target-mode CDB type to CDB length table used
3777 * in non-packetized operation.
3783 * When an SCB with the MK_MESSAGE flag is
3784 * queued to the controller, it cannot enter
3785 * the waiting for selection list until the
3786 * selections for any previously queued
3787 * commands to that target complete. During
3788 * the wait, the MK_MESSAGE SCB is queued
3795 * Saved SCSIID of MK_MESSAGE_SCB to avoid
3796 * an extra SCBPTR operation when deciding
3797 * if the MK_MESSAGE_SCB can be run.
3804 /************************* Hardware SCB Definition ****************************/
3809 SCB_RESIDUAL_DATACNT {
3812 alias SCB_HOST_CDB_PTR
3814 SCB_RESIDUAL_SGPTR {
3816 field SG_ADDR_MASK 0xf8 /* In the last byte */
3817 field SG_OVERRUN_RESID 0x02 /* In the first byte */
3818 field SG_LIST_NULL 0x01 /* In the first byte */
3822 alias SCB_HOST_CDB_LEN
3827 SCB_TARGET_DATA_DIR {
3835 * Only valid if CDB length is less than 13 bytes or
3836 * we are using a CDB pointer. Otherwise contains
3837 * the last 4 bytes of embedded cdb information.
3840 alias SCB_NEXT_COMPLETE
3843 alias SCB_FIFO_USE_COUNT
3848 field TARGET_SCB 0x80
3851 field MK_MESSAGE 0x10
3852 field STATUS_RCVD 0x08
3853 field DISCONNECTED 0x04
3854 field SCB_TAG_TYPE 0x03
3865 SCB_TASK_ATTRIBUTE {
3868 * Overloaded field for non-packetized
3869 * ignore wide residue message handling.
3871 field SCB_XFERLEN_ODD 0x01
3875 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
3877 SCB_TASK_MANAGEMENT {
3885 * The last byte is really the high address bits for
3889 field SG_LAST_SEG 0x80 /* In the fourth byte */
3890 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
3894 field SG_STATUS_VALID 0x04 /* In the first byte */
3895 field SG_FULL_RESID 0x02 /* In the first byte */
3896 field SG_LIST_NULL 0x01 /* In the first byte */
3902 alias SCB_NEXT_SCB_BUSADDR
3912 SCB_DISCONNECTED_LISTS {
3917 /*********************************** Constants ********************************/
3918 const MK_MESSAGE_BIT_OFFSET 4
3920 const TARGET_CMD_CMPLT 0xfe
3921 const INVALID_ADDR 0x80
3922 #define SCB_LIST_NULL 0xff
3923 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
3925 const CCSGADDR_MAX 0x80
3926 const CCSCBADDR_MAX 0x80
3927 const CCSGRAM_MAXSEGS 16
3929 /* Selection Timeout Timer Constants */
3930 const STIMESEL_SHIFT 3
3931 const STIMESEL_MIN 0x18
3932 const STIMESEL_BUG_ADJ 0x8
3934 /* WDTR Message values */
3935 const BUS_8_BIT 0x00
3936 const BUS_16_BIT 0x01
3937 const BUS_32_BIT 0x02
3939 /* Offset maximums */
3940 const MAX_OFFSET 0xfe
3941 const MAX_OFFSET_PACED 0xfe
3942 const MAX_OFFSET_PACED_BUG 0x7f
3944 * Some 160 devices incorrectly accept 0xfe as a
3945 * sync offset, but will overrun this value. Limit
3946 * to 0x7f for speed lower than U320 which will
3947 * avoid the persistent sync offset overruns.
3949 const MAX_OFFSET_NON_PACED 0x7f
3953 * The size of our sense buffers.
3954 * Sense buffer mapping can be handled in either of two ways.
3955 * The first is to allocate a dmamap for each transaction.
3956 * Depending on the architecture, dmamaps can be costly. The
3957 * alternative is to statically map the buffers in much the same
3958 * way we handle our scatter gather lists. The driver implements
3961 const AHD_SENSE_BUFSIZE 256
3963 /* Target mode command processing constants */
3964 const CMD_GROUP_CODE_SHIFT 0x05
3966 const STATUS_BUSY 0x08
3967 const STATUS_QUEUE_FULL 0x28
3968 const STATUS_PKT_SENSE 0xFF
3969 const TARGET_DATA_IN 1
3971 const SCB_TRANSFER_SIZE_FULL_LUN 56
3972 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
3973 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
3974 const PKT_OVERRUN_BUFSIZE 512
3979 const AHD_TIMER_US_PER_TICK 25
3980 const AHD_TIMER_MAX_TICKS 0xFFFF
3981 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
3984 * Downloaded (kernel inserted) constants
3986 const SG_PREFETCH_CNT download
3987 const SG_PREFETCH_CNT_LIMIT download
3988 const SG_PREFETCH_ALIGN_MASK download
3989 const SG_PREFETCH_ADDR_MASK download
3990 const SG_SIZEOF download
3991 const PKT_OVERRUN_BUFOFFSET download
3992 const SCB_TRANSFER_SIZE download
3993 const CACHELINE_MASK download
3998 const NVRAM_SCB_OFFSET 0x2C