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
201 field CLRHWERRINT 0x80 /* Rev B or greater */
202 field CLRBRKADRINT 0x40
203 field CLRSWTMINT 0x20
205 field CLRSCSIINT 0x08
208 field CLRSPLTINT 0x01
218 field CIOACCESFAIL 0x40 /* Rev B or greater */
232 field CLRCIOPARERR 0x80
233 field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
234 field CLRMPARERR 0x20
235 field CLRDPARERR 0x10
236 field CLRSQPARERR 0x08
237 field CLRILLOPCODE 0x04
238 field CLRDSCTMOUT 0x02
242 * Host Control Register
243 * Overall host control of the device.
248 field SEQ_RESET 0x80 /* Rev B or greater */
251 field SWTIMER_START_B 0x08 /* Rev B or greater */
255 field CHIPRSTACK 0x01
259 * Host New SCB Queue Offset
261 register HNSCB_QOFF {
268 * Host Empty SCB Queue Offset
270 register HESCB_QOFF {
278 register HS_MAILBOX {
281 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
282 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
286 * Sequencer Interupt Status
288 register SEQINTSTAT {
291 field SEQ_SWTMRTO 0x10
292 field SEQ_SEQINT 0x08
293 field SEQ_SCSIINT 0x04
294 field SEQ_PCIINT 0x02
295 field SEQ_SPLTINT 0x01
299 * Clear SEQ Interrupt
301 register CLRSEQINTSTAT {
304 field CLRSEQ_SWTMRTO 0x10
305 field CLRSEQ_SEQINT 0x08
306 field CLRSEQ_SCSIINT 0x04
307 field CLRSEQ_PCIINT 0x02
308 field CLRSEQ_SPLTINT 0x01
321 * SEQ New SCB Queue Offset
323 register SNSCB_QOFF {
331 * SEQ Empty SCB Queue Offset
333 register SESCB_QOFF {
340 * SEQ Done SCB Queue Offset
342 register SDSCB_QOFF {
350 * Queue Offset Control & Status
352 register QOFF_CTLSTA {
356 field EMPTY_SCB_AVAIL 0x80
357 field NEW_SCB_AVAIL 0x40
358 field SDSCB_ROLLOVR 0x20
359 field HS_MAILBOX_ACT 0x10
360 field SCB_QSIZE 0x0F {
383 field SWTMINTMASK 0x80
385 field SWTIMER_START 0x20
386 field AUTOCLRCMDINT 0x10
401 field SCSIENWRDIS 0x40 /* Rev B only. */
407 field DIRECTIONACK 0x04
409 field FIFOFLUSHACK 0x02
410 field DIRECTIONEN 0x01
414 * Device Space Command 0
416 register DSCOMMAND0 {
420 field CACHETHEN 0x80 /* Cache Threshold enable */
421 field DPARCKEN 0x40 /* Data Parity Check Enable */
422 field MPARCKEN 0x20 /* Memory Parity Check Enable */
423 field EXTREQLCK 0x10 /* External Request Lock */
424 field DISABLE_TWATE 0x02 /* Rev B or greater */
425 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
435 field PRELOAD_AVAIL 0x80
436 field PKT_PRELOAD_AVAIL 0x40
447 register SG_CACHE_PRE {
451 field SG_ADDR_MASK 0xf8
456 register SG_CACHE_SHADOW {
460 field SG_ADDR_MASK 0xf8
463 field LAST_SEG_DONE 0x01
473 field RESET_HARB 0x80
474 field RETRY_SWEN 0x08
479 * Data Channel Host Address
489 * Host Overlay DMA Address
506 field SPLIT_DROP_REQ 0x80
510 * Data Channel Host Count
520 * Host Overlay DMA Count
530 * Host Overlay DMA Enable
539 * Scatter/Gather Host Address
559 * Scatter/Gather Host Count
577 * Data FIFO Threshold
583 field WR_DFTHRSH 0x70 {
593 field RD_DFTHRSH 0x07 {
635 * Data Channel Receive Message 0
646 * CMC Recieve Message 0
657 * Overlay Recieve Message 0
659 register OVLYRXMSG0 {
668 * Relaxed Order Enable
683 * Data Channel Receive Message 1
693 * CMC Recieve Message 1
703 * Overlay Recieve Message 1
705 register OVLYRXMSG1 {
728 * Data Channel Receive Message 2
738 * CMC Recieve Message 2
748 * Overlay Recieve Message 2
750 register OVLYRXMSG2 {
758 * Outstanding Split Transactions
767 * Data Channel Receive Message 3
777 * CMC Recieve Message 3
787 * Overlay Recieve Message 3
789 register OVLYRXMSG3 {
804 field UNEXPSCIEN 0x20
805 field SPLTSMADIS 0x10
806 field SPLTSTADIS 0x08
813 * CMC Sequencer Byte Count
815 register CMCSEQBCNT {
822 * Overlay Sequencer Byte Count
824 register OVLYSEQBCNT {
831 * Data Channel Sequencer Byte Count
833 register DCHSEQBCNT {
841 * Data Channel Split Status 0
843 register DCHSPLTSTAT0 {
850 field SCDATBUCKET 0x10
851 field CNTNOTCMPLT 0x08
860 register CMCSPLTSTAT0 {
867 field SCDATBUCKET 0x10
868 field CNTNOTCMPLT 0x08
875 * Overlay Split Status 0
877 register OVLYSPLTSTAT0 {
884 field SCDATBUCKET 0x10
885 field CNTNOTCMPLT 0x08
892 * Data Channel Split Status 1
894 register DCHSPLTSTAT1 {
898 field RXDATABUCKET 0x01
904 register CMCSPLTSTAT1 {
908 field RXDATABUCKET 0x01
912 * Overlay Split Status 1
914 register OVLYSPLTSTAT1 {
918 field RXDATABUCKET 0x01
922 * S/G Receive Message 0
933 * S/G Receive Message 1
943 * S/G Receive Message 2
953 * S/G Receive Message 3
963 * Slave Split Out Address 0
965 register SLVSPLTOUTADR0 {
969 field LOWER_ADDR 0x7F
973 * Slave Split Out Address 1
975 register SLVSPLTOUTADR1 {
984 * Slave Split Out Address 2
986 register SLVSPLTOUTADR2 {
994 * Slave Split Out Address 3
996 register SLVSPLTOUTADR3 {
1005 * SG Sequencer Byte Count
1007 register SGSEQBCNT {
1010 modes M_DFF0, M_DFF1
1014 * Slave Split Out Attribute 0
1016 register SLVSPLTOUTATTR0 {
1020 field LOWER_BCNT 0xFF
1024 * Slave Split Out Attribute 1
1026 register SLVSPLTOUTATTR1 {
1030 field CMPLT_DNUM 0xF8
1031 field CMPLT_FNUM 0x07
1035 * Slave Split Out Attribute 2
1037 register SLVSPLTOUTATTR2 {
1042 field CMPLT_BNUM 0xFF
1045 * S/G Split Status 0
1047 register SGSPLTSTAT0 {
1050 modes M_DFF0, M_DFF1
1054 field SCDATBUCKET 0x10
1055 field CNTNOTCMPLT 0x08
1058 field RXSPLTRSP 0x01
1062 * S/G Split Status 1
1064 register SGSPLTSTAT1 {
1067 modes M_DFF0, M_DFF1
1068 field RXDATABUCKET 0x01
1078 field TEST_GROUP 0xF0
1083 * Data FIFO 0 PCI Status
1085 register DF0PCISTAT {
1100 * Data FIFO 1 PCI Status
1102 register DF1PCISTAT {
1119 register SGPCISTAT {
1135 register CMCPCISTAT {
1150 * Overlay PCI Status
1152 register OVLYPCISTAT {
1166 * PCI Status for MSI Master DMA Transfer
1168 register MSIPCISTAT {
1175 field CLRPENDMSI 0x08
1181 * PCI Status for Target
1183 register TARGPCISTAT {
1195 * The last LQ Packet recieved
1201 modes M_DFF0, M_DFF1, M_SCSI
1206 * SCB offset for Target Mode SCB type information
1216 * SCB offset to the Two Byte tag identifier used for target mode.
1225 * Logical Unit Number Pointer
1226 * SCB offset to the LSB (little endian) of the lun field.
1235 * Data Length Pointer
1236 * SCB offset for the 4 byte data length field in target mode.
1238 register DATALENPTR {
1245 * Status Length Pointer
1246 * SCB offset to the two byte status field in target SCBs.
1248 register STATLENPTR {
1255 * Command Length Pointer
1256 * Scb offset for the CDB length field in initiator SCBs.
1258 register CMDLENPTR {
1265 * Task Attribute Pointer
1266 * Scb offset for the byte field specifying the attribute byte
1267 * to be used in command packets.
1276 * Task Management Flags Pointer
1277 * Scb offset for the byte field specifying the attribute flags
1278 * byte to be used in command packets.
1288 * Scb offset for the first byte in the CDB for initiator SCBs.
1297 * Queue Next Pointer
1298 * Scb offset for the 2 byte "next scb link".
1308 * Scb offset to the value to place in the SCSIID register
1309 * during target mode connections.
1318 * Command Aborted Byte Pointer
1319 * Offset to the SCB flags field that includes the
1320 * "SCB aborted" status bit.
1322 register ABRTBYTEPTR {
1329 * Command Aborted Bit Pointer
1330 * Bit offset in the SCB flags field for "SCB aborted" status.
1332 register ABRTBITPTR {
1341 register MAXCMDBYTES {
1350 register MAXCMD2RCV {
1359 register SHORTTHRESH {
1366 * Logical Unit Number Length
1367 * The length, in bytes, of the SCB lun field.
1376 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1380 * The size, in bytes, of the embedded CDB field in initator SCBs.
1390 * The maximum number of commands to issue during a
1391 * single packetized connection.
1400 * Maximum Command Counter
1401 * The number of commands already sent during this connection
1403 register MAXCMDCNT {
1410 * LQ Packet Reserved Bytes
1411 * The bytes to be sent in the currently reserved fileds
1412 * of all LQ packets.
1431 * Command Reserved 0
1432 * The byte to be sent for the reserved byte 0 of
1433 * outgoing command packets.
1442 * LQ Manager Control 0
1448 field LQITARGCLT 0xC0
1449 field LQIINITGCLT 0x30
1450 field LQ0TARGCLT 0x0C
1451 field LQ0INITGCLT 0x03
1455 * LQ Manager Control 1
1460 modes M_DFF0, M_DFF1, M_SCSI
1462 field SINGLECMD 0x02
1463 field ABORTPENDING 0x01
1467 * LQ Manager Control 2
1472 modes M_DFF0, M_DFF1, M_SCSI
1474 field LQICONTINUE 0x40
1475 field LQITOIDLE 0x20
1478 field LQOCONTINUE 0x04
1479 field LQOTOIDLE 0x02
1490 field GSBISTERR 0x40
1491 field GSBISTDONE 0x20
1492 field GSBISTRUN 0x10
1493 field OSBISTERR 0x04
1494 field OSBISTDONE 0x02
1495 field OSBISTRUN 0x01
1499 * SCSI Sequence Control0
1504 modes M_DFF0, M_DFF1, M_SCSI
1508 field FORCEBUSFREE 0x10
1519 field NTBISTERR 0x04
1520 field NTBISTDONE 0x02
1521 field NTBISTRUN 0x01
1525 * SCSI Sequence Control 1
1530 modes M_DFF0, M_DFF1, M_SCSI
1531 field MANUALCTL 0x40
1535 field ENAUTOATNP 0x02
1540 * SCSI Transfer Control 0
1548 field BIOSCANCELEN 0x10
1553 * SCSI Transfer Control 1
1559 field BITBUCKET 0x80
1569 * SCSI Transfer Control 2
1575 field AUTORSTDIS 0x10
1581 * SCSI Bus Initiator IDs
1582 * Bitmask of observed initiators on the bus.
1584 register BUSINITID {
1592 * Data Length Counters
1593 * Packet byte counter.
1598 modes M_DFF0, M_DFF1
1609 field FIFO1FREE 0x20
1610 field FIFO0FREE 0x10
1612 * On the B, this enum only works
1613 * in the read direction. For writes,
1614 * you must use the B version of the
1615 * CURRFIFO_0 definition which is defined
1616 * as a constant outside of this register
1617 * definition to avoid confusing the
1618 * register pretty printing code.
1620 enum CURRFIFO 0x03 {
1627 const B_CURRFIFO_0 0x2
1630 * SCSI Bus Target IDs
1631 * Bitmask of observed targets on the bus.
1633 register BUSTARGID {
1641 * SCSI Control Signal Out
1646 modes M_DFF0, M_DFF1, M_SCSI
1656 * Possible phases to write into SCSISIG0
1658 enum PHASE_MASK CDO|IOO|MSGO {
1661 P_DATAOUT_DT P_DATAOUT|MSGO,
1662 P_DATAIN_DT P_DATAIN|MSGO,
1666 P_MESGIN CDO|IOO|MSGO
1673 modes M_DFF0, M_DFF1, M_SCSI
1683 * Possible phases in SCSISIGI
1685 enum PHASE_MASK CDO|IOO|MSGO {
1688 P_DATAOUT_DT P_DATAOUT|MSGO,
1689 P_DATAIN_DT P_DATAIN|MSGO,
1693 P_MESGIN CDO|IOO|MSGO
1698 * Multiple Target IDs
1699 * Bitmask of ids to respond as a target.
1701 register MULTARGID {
1711 register SCSIPHASE {
1714 modes M_DFF0, M_DFF1, M_SCSI
1715 field STATUS_PHASE 0x20
1716 field COMMAND_PHASE 0x10
1717 field MSG_IN_PHASE 0x08
1718 field MSG_OUT_PHASE 0x04
1719 field DATA_PHASE_MASK 0x03 {
1720 DATA_OUT_PHASE 0x01,
1728 register SCSIDAT0_IMG {
1731 modes M_DFF0, M_DFF1, M_SCSI
1740 modes M_DFF0, M_DFF1, M_SCSI
1750 modes M_DFF0, M_DFF1, M_SCSI
1760 modes M_DFF0, M_DFF1, M_SCSI
1766 * Selection/Reselection ID
1767 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1768 * device did not set its own ID.
1773 modes M_DFF0, M_DFF1, M_SCSI
1774 field SELID_MASK 0xf0
1779 * SCSI Block Control
1780 * Controls Bus type and channel selection. SELWIDE allows for the
1781 * coexistence of 8bit and 16bit devices on a wide bus.
1786 modes M_DFF0, M_DFF1, M_SCSI
1787 field DIAGLEDEN 0x80
1788 field DIAGLEDON 0x40
1789 field ENAB40 0x08 /* LVD transceiver active */
1790 field ENAB20 0x04 /* SE/HVD transceiver active */
1797 register OPTIONMODE {
1801 field BIOSCANCTL 0x80
1802 field AUTOACKEN 0x40
1803 field BIASCANCTL 0x20
1804 field BUSFREEREV 0x10
1805 field ENDGFORMCHK 0x04
1806 field AUTO_MSGOUT_DE 0x02
1807 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1816 modes M_DFF0, M_DFF1, M_SCSI
1817 field TARGET 0x80 /* Board acting as target */
1818 field SELDO 0x40 /* Selection Done */
1819 field SELDI 0x20 /* Board has been selected */
1820 field SELINGO 0x10 /* Selection In Progress */
1821 field IOERR 0x08 /* LVD Tranceiver mode changed */
1822 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1823 field SPIORDY 0x02 /* SCSI PIO Ready */
1824 field ARBDO 0x01 /* Arbitration Done Out */
1828 * Clear SCSI Interrupt 0
1829 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1834 modes M_DFF0, M_DFF1, M_SCSI
1837 field CLRSELINGO 0x10
1839 field CLROVERRUN 0x04
1840 field CLRSPIORDY 0x02
1845 * SCSI Interrupt Mode 0
1846 * Setting any bit will enable the corresponding function
1847 * in SIMODE0 to interrupt via the IRQ pin.
1855 field ENSELINGO 0x10
1857 field ENOVERRUN 0x04
1858 field ENSPIORDY 0x02
1868 modes M_DFF0, M_DFF1, M_SCSI
1875 field STRB2FAST 0x02
1880 * Clear SCSI Interrupt 1
1881 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1886 modes M_DFF0, M_DFF1, M_SCSI
1887 field CLRSELTIMEO 0x80
1889 field CLRSCSIRSTI 0x20
1890 field CLRBUSFREE 0x08
1891 field CLRSCSIPERR 0x04
1892 field CLRSTRB2FAST 0x02
1893 field CLRREQINIT 0x01
1902 modes M_DFF0, M_DFF1, M_SCSI
1903 field BUSFREETIME 0xc0 {
1908 field NONPACKREQ 0x20
1909 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
1910 field BSYX 0x08 /* Busy Expander */
1911 field WIDE_RES 0x04 /* Modes 0 and 1 only */
1912 field SDONE 0x02 /* Modes 0 and 1 only */
1913 field DMADONE 0x01 /* Modes 0 and 1 only */
1917 * Clear SCSI Interrupt 2
1922 modes M_DFF0, M_DFF1, M_SCSI
1923 field CLRNONPACKREQ 0x20
1924 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
1925 field CLRSDONE 0x02 /* Modes 0 and 1 only */
1926 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
1930 * SCSI Interrupt Mode 2
1936 field ENWIDE_RES 0x04
1938 field ENDMADONE 0x01
1942 * Physical Error Diagnosis
1947 modes M_DFF0, M_DFF1, M_SCSI
1950 field PREVPHASE 0x20
1951 field PARITYERR 0x10
1954 field DGFORMERR 0x02
1959 * LQI Manager Current State
1973 modes M_DFF0, M_DFF1, M_SCSI
1977 * LQO Manager Current State
1986 * LQI Manager Status
1991 modes M_DFF0, M_DFF1, M_SCSI
1992 field LQIATNQAS 0x20
1995 field LQIBADLQT 0x04
1997 field LQIATNCMD 0x01
2001 * Clear LQI Interrupts 0
2003 register CLRLQIINT0 {
2006 modes M_DFF0, M_DFF1, M_SCSI
2007 field CLRLQIATNQAS 0x20
2008 field CLRLQICRCT1 0x10
2009 field CLRLQICRCT2 0x08
2010 field CLRLQIBADLQT 0x04
2011 field CLRLQIATNLQ 0x02
2012 field CLRLQIATNCMD 0x01
2016 * LQI Manager Interrupt Mode 0
2022 field ENLQIATNQASK 0x20
2023 field ENLQICRCT1 0x10
2024 field ENLQICRCT2 0x08
2025 field ENLQIBADLQT 0x04
2026 field ENLQIATNLQ 0x02
2027 field ENLQIATNCMD 0x01
2031 * LQI Manager Status 1
2036 modes M_DFF0, M_DFF1, M_SCSI
2037 field LQIPHASE_LQ 0x80
2038 field LQIPHASE_NLQ 0x40
2040 field LQICRCI_LQ 0x10
2041 field LQICRCI_NLQ 0x08
2042 field LQIBADLQI 0x04
2043 field LQIOVERI_LQ 0x02
2044 field LQIOVERI_NLQ 0x01
2048 * Clear LQI Manager Interrupts1
2050 register CLRLQIINT1 {
2053 modes M_DFF0, M_DFF1, M_SCSI
2054 field CLRLQIPHASE_LQ 0x80
2055 field CLRLQIPHASE_NLQ 0x40
2056 field CLRLIQABORT 0x20
2057 field CLRLQICRCI_LQ 0x10
2058 field CLRLQICRCI_NLQ 0x08
2059 field CLRLQIBADLQI 0x04
2060 field CLRLQIOVERI_LQ 0x02
2061 field CLRLQIOVERI_NLQ 0x01
2065 * LQI Manager Interrupt Mode 1
2071 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2072 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2073 field ENLIQABORT 0x20
2074 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2075 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2076 field ENLQIBADLQI 0x04
2077 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2078 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2082 * LQI Manager Status 2
2087 modes M_DFF0, M_DFF1, M_SCSI
2088 field PACKETIZED 0x80
2089 field LQIPHASE_OUTPKT 0x40
2090 field LQIWORKONLQ 0x20
2091 field LQIWAITFIFO 0x10
2092 field LQISTOPPKT 0x08
2093 field LQISTOPLQ 0x04
2094 field LQISTOPCMD 0x02
2095 field LQIGSAVAIL 0x01
2104 modes M_DFF0, M_DFF1, M_SCSI
2105 field NTRAMPERR 0x02
2106 field OSRAMPERR 0x01
2110 * Clear SCSI Status 3
2115 modes M_DFF0, M_DFF1, M_SCSI
2116 field CLRNTRAMPERR 0x02
2117 field CLROSRAMPERR 0x01
2121 * SCSI Interrupt Mode 3
2127 field ENNTRAMPERR 0x02
2128 field ENOSRAMPERR 0x01
2132 * LQO Manager Status 0
2137 modes M_DFF0, M_DFF1, M_SCSI
2138 field LQOTARGSCBPERR 0x10
2139 field LQOSTOPT2 0x08
2141 field LQOATNPKT 0x02
2146 * Clear LQO Manager interrupt 0
2148 register CLRLQOINT0 {
2151 modes M_DFF0, M_DFF1, M_SCSI
2152 field CLRLQOTARGSCBPERR 0x10
2153 field CLRLQOSTOPT2 0x08
2154 field CLRLQOATNLQ 0x04
2155 field CLRLQOATNPKT 0x02
2156 field CLRLQOTCRC 0x01
2160 * LQO Manager Interrupt Mode 0
2166 field ENLQOTARGSCBPERR 0x10
2167 field ENLQOSTOPT2 0x08
2168 field ENLQOATNLQ 0x04
2169 field ENLQOATNPKT 0x02
2170 field ENLQOTCRC 0x01
2174 * LQO Manager Status 1
2179 modes M_DFF0, M_DFF1, M_SCSI
2180 field LQOINITSCBPERR 0x10
2181 field LQOSTOPI2 0x08
2182 field LQOBADQAS 0x04
2183 field LQOBUSFREE 0x02
2184 field LQOPHACHGINPKT 0x01
2188 * Clear LOQ Interrupt 1
2190 register CLRLQOINT1 {
2193 modes M_DFF0, M_DFF1, M_SCSI
2194 field CLRLQOINITSCBPERR 0x10
2195 field CLRLQOSTOPI2 0x08
2196 field CLRLQOBADQAS 0x04
2197 field CLRLQOBUSFREE 0x02
2198 field CLRLQOPHACHGINPKT 0x01
2202 * LQO Manager Interrupt Mode 1
2208 field ENLQOINITSCBPERR 0x10
2209 field ENLQOSTOPI2 0x08
2210 field ENLQOBADQAS 0x04
2211 field ENLQOBUSFREE 0x02
2212 field ENLQOPHACHGINPKT 0x01
2216 * LQO Manager Status 2
2221 modes M_DFF0, M_DFF1, M_SCSI
2223 field LQOWAITFIFO 0x10
2224 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2225 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2229 * Output Synchronizer Space Count
2231 register OS_SPACE_CNT {
2238 * SCSI Interrupt Mode 1
2239 * Setting any bit will enable the corresponding function
2240 * in SIMODE1 to interrupt via the IRQ pin.
2245 modes M_DFF0, M_DFF1, M_SCSI
2246 field ENSELTIMO 0x80
2247 field ENATNTARG 0x40
2248 field ENSCSIRST 0x20
2249 field ENPHASEMIS 0x10
2250 field ENBUSFREE 0x08
2251 field ENSCSIPERR 0x04
2252 field ENSTRB2FAST 0x02
2253 field ENREQINIT 0x01
2263 modes M_DFF0, M_DFF1, M_SCSI
2267 * Data FIFO SCSI Transfer Control
2269 register DFFSXFRCTL {
2272 modes M_DFF0, M_DFF1
2273 field DFFBITBUCKET 0x08
2280 * Next SCSI Control Block
2290 register LQOSCSCTL {
2295 field LQOH2A_VERSION 0x80
2296 field LQONOCHKOVER 0x01
2302 register SEQINTSRC {
2305 modes M_DFF0, M_DFF1
2309 field CFG4ISTAT 0x08
2310 field CFG4TSTAT 0x04
2316 * Clear Arp Interrupts
2318 register CLRSEQINTSRC {
2321 modes M_DFF0, M_DFF1
2322 field CLRCTXTDONE 0x40
2323 field CLRSAVEPTRS 0x20
2324 field CLRCFG4DATA 0x10
2325 field CLRCFG4ISTAT 0x08
2326 field CLRCFG4TSTAT 0x04
2327 field CLRCFG4ICMD 0x02
2328 field CLRCFG4TCMD 0x01
2332 * SEQ Interrupt Enabled (Shared)
2337 modes M_DFF0, M_DFF1
2338 field ENCTXTDONE 0x40
2339 field ENSAVEPTRS 0x20
2340 field ENCFG4DATA 0x10
2341 field ENCFG4ISTAT 0x08
2342 field ENCFG4TSTAT 0x04
2343 field ENCFG4ICMD 0x02
2344 field ENCFG4TCMD 0x01
2348 * Current SCSI Control Block
2363 modes M_DFF0, M_DFF1
2364 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2365 field SHCNTMINUS1 0x20 /* Rev B or higher */
2366 field LASTSDONE 0x10
2368 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2369 field DATAINFIFO 0x02
2376 register CRCCONTROL {
2380 field CRCVALCHKEN 0x40
2391 field SEL_TXPLL_DEBUG 0x04
2395 * Data FIFO Queue Tag
2401 modes M_DFF0, M_DFF1
2405 * Last SCSI Control Block
2415 * SCSI I/O Cell Power-down Control
2421 field DISABLE_OE 0x80
2422 field PDN_IDIST 0x04
2423 field PDN_DIFFSENSE 0x01
2427 * Shaddow Host Address.
2433 modes M_DFF0, M_DFF1
2437 * Data Group CRC Interval.
2447 * Data Transfer Negotiation Address
2456 * Data Transfer Negotiation Data - Period Byte
2458 register NEGPERIOD {
2465 * Packetized CRC Interval
2475 * Data Transfer Negotiation Data - Offset Byte
2477 register NEGOFFSET {
2484 * Data Transfer Negotiation Data - PPR Options
2486 register NEGPPROPTS {
2490 field PPROPT_PACE 0x08
2491 field PPROPT_QAS 0x04
2492 field PPROPT_DT 0x02
2493 field PPROPT_IUT 0x01
2497 * Data Transfer Negotiation Data - Connection Options
2499 register NEGCONOPTS {
2503 field ENSNAPSHOT 0x40
2504 field RTI_WRTDIS 0x20
2505 field RTI_OVRDTRN 0x10
2506 field ENSLOWCRC 0x08
2507 field ENAUTOATNI 0x04
2508 field ENAUTOATNO 0x02
2513 * Negotiation Table Annex Column Index.
2525 field STSELSKIDDIS 0x40
2526 field CURRFIFODEF 0x20
2527 field WIDERESEN 0x10
2528 field SDONEMSKDIS 0x08
2529 field DFFACTCLR 0x04
2530 field SHVALIDSTDIS 0x02
2531 field LSTSGCLRDIS 0x01
2534 const AHD_ANNEXCOL_PER_DEV0 4
2535 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2536 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2537 const AHD_PRECOMP_MASK 0x07
2538 const AHD_PRECOMP_SHIFT 0
2539 const AHD_PRECOMP_CUTBACK_17 0x04
2540 const AHD_PRECOMP_CUTBACK_29 0x06
2541 const AHD_PRECOMP_CUTBACK_37 0x07
2542 const AHD_SLEWRATE_MASK 0x78
2543 const AHD_SLEWRATE_SHIFT 3
2545 * Rev A has only a single bit (high bit of field) of slew adjustment.
2546 * Rev B has 4 bits. The current default happens to be the same for both.
2548 const AHD_SLEWRATE_DEF_REVA 0x08
2549 const AHD_SLEWRATE_DEF_REVB 0x08
2551 /* Rev A does not have any amplitude setting. */
2552 const AHD_ANNEXCOL_AMPLITUDE 6
2553 const AHD_AMPLITUDE_MASK 0x7
2554 const AHD_AMPLITUDE_SHIFT 0
2555 const AHD_AMPLITUDE_DEF 0x7
2558 * Negotiation Table Annex Data Port.
2567 * Initiator's Own Id.
2568 * The SCSI ID to use for Selection Out and seen during a reselection..
2577 * 960MHz Phase-Locked Loop Control 0
2579 register PLL960CTL0 {
2583 field PLL_VCOSEL 0x80
2586 field PLL_ENLUD 0x08
2587 field PLL_ENLPF 0x04
2589 field PLL_ENFBM 0x01
2602 * 960MHz Phase-Locked Loop Control 1
2604 register PLL960CTL1 {
2608 field PLL_CNTEN 0x80
2609 field PLL_CNTCLR 0x40
2614 * Expander Signature
2629 modes M_DFF0, M_DFF1
2642 * 960-MHz Phase-Locked Loop Test Count
2644 register PLL960CNT0 {
2652 * 400-MHz Phase-Locked Loop Control 0
2654 register PLL400CTL0 {
2658 field PLL_VCOSEL 0x80
2661 field PLL_ENLUD 0x08
2662 field PLL_ENLPF 0x04
2664 field PLL_ENFBM 0x01
2668 * Arbitration Fairness
2678 * 400-MHz Phase-Locked Loop Control 1
2680 register PLL400CTL1 {
2684 field PLL_CNTEN 0x80
2685 field PLL_CNTCLR 0x40
2690 * Arbitration Unfairness
2692 register UNFAIRNESS {
2700 * 400-MHz Phase-Locked Loop Test Count
2702 register PLL400CNT0 {
2716 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2720 * CMC SCB Array Count
2721 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2722 * Transfers must be 8byte aligned and sized.
2724 register CCSCBACNT {
2732 * SCB-Next Address Snooping logic. When an SCB is transferred to
2733 * the card, the next SCB address to be used by the CMC array can
2734 * be autoloaded from that transfer.
2736 register SCBAUTOPTR {
2740 field AUSCBPTR_EN 0x80
2741 field SCBPTR_ADDR 0x38
2742 field SCBPTR_OFF 0x07
2746 * CMC SG Ram Address Pointer
2751 modes M_DFF0, M_DFF1
2755 * CMC SCB RAM Address Pointer
2757 register CCSCBADDR {
2764 * CMC SCB Ram Back-up Address Pointer
2765 * Indicates the true stop location of transfers halted prior
2766 * to SCBHCNT going to 0.
2768 register CCSCBADR_BK {
2780 modes M_DFF0, M_DFF1
2782 field SG_CACHE_AVAIL 0x10
2783 field CCSGENACK 0x08
2785 field SG_FETCH_REQ 0x02
2786 field CCSGRESET 0x01
2796 field CCSCBDONE 0x80
2801 field CCSCBRESET 0x01
2807 register CMC_RAMBIST {
2811 field SG_ELEMENT_SIZE 0x80
2812 field SCBRAMBIST_FAIL 0x40
2813 field SG_BIST_FAIL 0x20
2814 field SG_BIST_EN 0x10
2815 field CMC_BUFFER_BIST_FAIL 0x02
2816 field CMC_BUFFER_BIST_EN 0x01
2820 * CMC SG RAM Data Port
2825 modes M_DFF0, M_DFF1
2829 * CMC SCB RAM Data Port
2848 * Flex DMA Byte Count
2860 register FLEXDMASTAT {
2864 field FLEXDMAERR 0x02
2865 field FLEXDMADONE 0x01
2869 * Flex DMA Data Port
2893 field FLXARBACK 0x80
2894 field FLXARBREQ 0x40
2902 * Serial EEPROM Address
2911 * Serial EEPROM Data
2921 * Serial EEPROM Status
2927 field INIT_DONE 0x80
2928 field SEEOPCODE 0x70
2929 field LDALTID_L 0x08
2930 field SEEARBACK 0x04
2936 * Serial EEPROM Control
2942 field SEEOPCODE 0x70 {
2947 * The following four commands use special
2948 * addresses for differentiation.
2952 mask SEEOP_EWEN 0x40
2953 mask SEEOP_WALL 0x40
2954 mask SEEOP_EWDS 0x40
2959 const SEEOP_ERAL_ADDR 0x80
2960 const SEEOP_EWEN_ADDR 0xC0
2961 const SEEOP_WRAL_ADDR 0x40
2962 const SEEOP_EWDS_ADDR 0x00
2974 * Data FIFO Write Address
2975 * Pointer to the next QWD location to be written to the data FIFO.
2981 modes M_DFF0, M_DFF1
2985 * DSP Filter Control
2987 register DSPFLTRCTL {
2991 field FLTRDISABLE 0x20
2992 field EDGESENSE 0x10
2993 field DSPFCNTSEL 0x0F
2997 * DSP Data Channel Control
2999 register DSPDATACTL {
3003 field BYPASSENAB 0x80
3005 field RCVROFFSTDIS 0x04
3006 field XMITOFFSTDIS 0x02
3010 * Data FIFO Read Address
3011 * Pointer to the next QWD location to be read from the data FIFO.
3017 modes M_DFF0, M_DFF1
3023 register DSPREQCTL {
3027 field MANREQCTL 0xC0
3028 field MANREQDLY 0x3F
3034 register DSPACKCTL {
3038 field MANACKCTL 0xC0
3039 field MANACKDLY 0x3F
3044 * Read/Write byte port into the data FIFO. The read and write
3045 * FIFO pointers increment with each read and write respectively
3051 modes M_DFF0, M_DFF1
3055 * DSP Channel Select
3057 register DSPSELECT {
3061 field AUTOINCEN 0x80
3068 * Write Bias Control
3070 register WRTBIASCTL {
3074 field AUTOXBCDIS 0x80
3075 field XMITMANVAL 0x3F
3079 * Currently the WRTBIASCTL is the same as the default.
3081 const WRTBIASCTL_HP_DEFAULT 0x0
3084 * Receiver Bias Control
3086 register RCVRBIOSCTL {
3090 field AUTORBCDIS 0x80
3091 field RCVRMANVAL 0x3F
3095 * Write Bias Calculator
3097 register WRTBIASCALC {
3104 * Data FIFO Pointers
3105 * Contains the byte offset from DFWADDR and DWRADDR to the current
3106 * FIFO write/read locations.
3111 modes M_DFF0, M_DFF1
3115 * Receiver Bias Calculator
3117 register RCVRBIASCALC {
3124 * Data FIFO Backup Read Pointer
3125 * Contains the data FIFO address to be restored if the last
3126 * data accessed from the data FIFO was not transferred successfully.
3132 modes M_DFF0, M_DFF1
3145 * Data FIFO Debug Control
3150 modes M_DFF0, M_DFF1
3151 field DFF_CIO_WR_RDY 0x20
3152 field DFF_CIO_RD_RDY 0x10
3153 field DFF_DIR_ERR 0x08
3154 field DFF_RAMBIST_FAIL 0x04
3155 field DFF_RAMBIST_DONE 0x02
3156 field DFF_RAMBIST_EN 0x01
3160 * Data FIFO Space Count
3161 * Number of FIFO locations that are free.
3167 modes M_DFF0, M_DFF1
3171 * Data FIFO Byte Count
3172 * Number of filled FIFO locations.
3178 modes M_DFF0, M_DFF1
3182 * Sequencer Program Overlay Address.
3183 * Low address must be written prior to high address.
3193 * Sequencer Control 0
3194 * Error detection mode, speed configuration,
3195 * single step, breakpoints and program load.
3200 field PERRORDIS 0x80
3204 field BRKADRINTEN 0x08
3211 * Sequencer Control 1
3212 * Instruction RAM Diagnostics
3217 field OVRLAY_DATA_CHK 0x08
3218 field RAMBIST_DONE 0x04
3219 field RAMBIST_FAIL 0x02
3220 field RAMBIST_EN 0x01
3225 * Zero and Carry state of the ALU.
3235 * Sequencer Interrupt Control
3237 register SEQINTCTL {
3240 field INTVEC1DSL 0x80
3241 field INT1_CONTEXT 0x20
3242 field SCS_SEQ_INT1M1 0x10
3243 field SCS_SEQ_INT1M0 0x08
3250 * Sequencer RAM Data Port
3251 * Single byte window into the Sequencer Instruction Ram area starting
3252 * at the address specified by OVLYADDR. To write a full instruction word,
3253 * simply write four bytes in succession. OVLYADDR will increment after the
3254 * most significant instrution byte (the byte with the parity bit) is written.
3262 * Sequencer Program Counter
3263 * Low byte must be written prior to high byte.
3281 * Source Index Register
3282 * Incrementing index for reads of SINDIR and the destination (low byte only)
3283 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3285 * mvi 0xFF call some_routine;
3287 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3297 * Destination Index Register
3298 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3308 * Sequencer instruction breakpoint address address.
3318 field BRKDIS 0x80 /* Disable Breakpoint */
3323 * All reads to this register return the value 0xFF.
3333 * All reads to this register return the value 0.
3343 * Writes to this register have no effect.
3352 * Source Index Indirect
3353 * Reading this register is equivalent to reading (register_base + SINDEX) and
3354 * incrementing SINDEX by 1.
3362 * Destination Index Indirect
3363 * Writing this register is equivalent to writing to (register_base + DINDEX)
3364 * and incrementing DINDEX by 1.
3373 * 2's complement to bit value conversion. Write the 2's complement value
3374 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3375 * on the next read of this register.
3380 register FUNCTION1 {
3387 * Window into the stack. Each stack location is 10 bits wide reported
3388 * low byte followed by high byte. There are 8 stack locations.
3396 * Interrupt Vector 1 Address
3397 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3399 register INTVEC1_ADDR {
3408 * Address of the SEQRAM instruction currently executing instruction.
3418 * Interrupt Vector 2 Address
3419 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3421 register INTVEC2_ADDR {
3430 * Address of the SEQRAM instruction executed prior to the current instruction.
3439 register AHD_PCI_CONFIG_BASE {
3446 /* ---------------------- Scratch RAM Offsets ------------------------- */
3463 field SEGS_AVAIL 0x01
3464 field LOADING_NEEDED 0x02
3465 field FETCH_INPROG 0x04
3468 * Track whether the transfer byte count for
3469 * the current data phase is odd.
3495 * Per "other-id" execution queues. We use an array of
3496 * tail pointers into lists of SCBs sorted by "other-id".
3497 * The execution head pointer threads the head SCBs for
3510 * SCBID of the next SCB in the new SCB queue.
3512 NEXT_QUEUED_SCB_ADDR {
3516 * head of list of SCBs that have
3517 * completed but have not been
3518 * put into the qoutfifo.
3524 * The list of completed SCBs in
3527 COMPLETE_SCB_DMAINPROG_HEAD {
3531 * head of list of SCBs that have
3532 * completed but need to be uploaded
3533 * to the host prior to being completed.
3535 COMPLETE_DMA_SCB_HEAD {
3539 * tail of list of SCBs that have
3540 * completed but need to be uploaded
3541 * to the host prior to being completed.
3543 COMPLETE_DMA_SCB_TAIL {
3547 * head of list of SCBs that have
3548 * been uploaded to the host, but cannot
3549 * be completed until the QFREEZE is in
3550 * full effect (i.e. no selections pending).
3552 COMPLETE_ON_QFREEZE_HEAD {
3556 * Counting semaphore to prevent new select-outs
3557 * The queue is frozen so long as the sequencer
3558 * and kernel freeze counts differ.
3563 KERNEL_QFREEZE_COUNT {
3567 * Mode to restore on legacy idle loop exit.
3573 * Single byte buffer used to designate the type or message
3574 * to send to a target.
3579 /* Parameters for DMA Logic */
3582 field PRELOADEN 0x80
3586 field SDMAENACK 0x10
3588 field HDMAENACK 0x08
3589 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3590 field FIFOFLUSH 0x02
3591 field FIFORESET 0x01
3595 field NOT_IDENTIFIED 0x80
3596 field NO_CDB_SENT 0x40
3597 field TARGET_CMD_IS_TAGGED 0x40
3600 field TARG_CMD_PENDING 0x10
3601 field CMDPHASE_PENDING 0x08
3602 field DPHASE_PENDING 0x04
3603 field SPHASE_PENDING 0x02
3604 field NO_DISCONNECT 0x01
3607 * Temporary storage for the
3608 * target/channel/lun of a
3609 * reconnecting target
3618 * The last bus phase as seen by the sequencer.
3625 field P_BUSFREE 0x01
3626 enum PHASE_MASK CDO|IOO|MSGO {
3629 P_DATAOUT_DT P_DATAOUT|MSGO,
3630 P_DATAIN_DT P_DATAIN|MSGO,
3634 P_MESGIN CDO|IOO|MSGO
3638 * Value to "or" into the SCBPTR[1] value to
3639 * indicate that an entry in the QINFIFO is valid.
3641 QOUTFIFO_ENTRY_VALID_TAG {
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.
3656 * Base address of our shared data with the kernel driver in host
3657 * memory. This includes the qoutfifo and target mode
3658 * incoming command queue.
3664 * Pointer to location in host memory for next
3665 * position in the qoutfifo.
3667 QOUTFIFO_NEXT_ADDR {
3673 mask SEND_SENSE 0x40
3675 mask MSGOUT_PHASEMIS 0x10
3676 mask EXIT_MSG_LOOP 0x08
3677 mask CONT_MSG_LOOP_WRITE 0x04
3678 mask CONT_MSG_LOOP_READ 0x03
3679 mask CONT_MSG_LOOP_TARG 0x02
3688 * Snapshot of MSG_OUT taken after each message is sent.
3695 * Sequences the kernel driver has okayed for us. This allows
3696 * the driver to do things like prevent initiator or target
3701 field MANUALCTL 0x40
3705 field ENAUTOATNP 0x02
3710 * The initiator specified tag for this target mode transaction.
3718 field PENDING_MK_MESSAGE 0x01
3719 field TARGET_MSG_PENDING 0x02
3720 field SELECTOUT_QFROZEN 0x04
3728 * The maximum amount of time to wait, when interrupt coalescing
3729 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3732 INT_COALESCING_TIMER {
3737 * The maximum number of commands to coalesce into a single interrupt.
3738 * Actually the 2's complement of that value to simplify sequencer
3741 INT_COALESCING_MAXCMDS {
3746 * The minimum number of commands still outstanding required
3747 * to continue coalescing (2's complement of value).
3749 INT_COALESCING_MINCMDS {
3754 * Number of commands "in-flight".
3761 * The count of commands that have been coalesced.
3763 INT_COALESCING_CMDCOUNT {
3768 * Since the HS_MAIBOX is self clearing, copy its contents to
3769 * this position in scratch ram every time it changes.
3775 * Target-mode CDB type to CDB length table used
3776 * in non-packetized operation.
3782 * When an SCB with the MK_MESSAGE flag is
3783 * queued to the controller, it cannot enter
3784 * the waiting for selection list until the
3785 * selections for any previously queued
3786 * commands to that target complete. During
3787 * the wait, the MK_MESSAGE SCB is queued
3794 * Saved SCSIID of MK_MESSAGE_SCB to avoid
3795 * an extra SCBPTR operation when deciding
3796 * if the MK_MESSAGE_SCB can be run.
3803 /************************* Hardware SCB Definition ****************************/
3808 SCB_RESIDUAL_DATACNT {
3811 alias SCB_HOST_CDB_PTR
3813 SCB_RESIDUAL_SGPTR {
3815 field SG_ADDR_MASK 0xf8 /* In the last byte */
3816 field SG_OVERRUN_RESID 0x02 /* In the first byte */
3817 field SG_LIST_NULL 0x01 /* In the first byte */
3821 alias SCB_HOST_CDB_LEN
3826 SCB_TARGET_DATA_DIR {
3834 * Only valid if CDB length is less than 13 bytes or
3835 * we are using a CDB pointer. Otherwise contains
3836 * the last 4 bytes of embedded cdb information.
3839 alias SCB_NEXT_COMPLETE
3842 alias SCB_FIFO_USE_COUNT
3847 field TARGET_SCB 0x80
3850 field MK_MESSAGE 0x10
3851 field STATUS_RCVD 0x08
3852 field DISCONNECTED 0x04
3853 field SCB_TAG_TYPE 0x03
3864 SCB_TASK_ATTRIBUTE {
3867 * Overloaded field for non-packetized
3868 * ignore wide residue message handling.
3870 field SCB_XFERLEN_ODD 0x01
3874 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
3876 SCB_TASK_MANAGEMENT {
3884 * The last byte is really the high address bits for
3888 field SG_LAST_SEG 0x80 /* In the fourth byte */
3889 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
3893 field SG_STATUS_VALID 0x04 /* In the first byte */
3894 field SG_FULL_RESID 0x02 /* In the first byte */
3895 field SG_LIST_NULL 0x01 /* In the first byte */
3901 alias SCB_NEXT_SCB_BUSADDR
3911 SCB_DISCONNECTED_LISTS {
3916 /*********************************** Constants ********************************/
3917 const MK_MESSAGE_BIT_OFFSET 4
3919 const TARGET_CMD_CMPLT 0xfe
3920 const INVALID_ADDR 0x80
3921 #define SCB_LIST_NULL 0xff
3922 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
3924 const CCSGADDR_MAX 0x80
3925 const CCSCBADDR_MAX 0x80
3926 const CCSGRAM_MAXSEGS 16
3928 /* Selection Timeout Timer Constants */
3929 const STIMESEL_SHIFT 3
3930 const STIMESEL_MIN 0x18
3931 const STIMESEL_BUG_ADJ 0x8
3933 /* WDTR Message values */
3934 const BUS_8_BIT 0x00
3935 const BUS_16_BIT 0x01
3936 const BUS_32_BIT 0x02
3938 /* Offset maximums */
3939 const MAX_OFFSET 0xfe
3940 const MAX_OFFSET_PACED 0xfe
3941 const MAX_OFFSET_PACED_BUG 0x7f
3943 * Some 160 devices incorrectly accept 0xfe as a
3944 * sync offset, but will overrun this value. Limit
3945 * to 0x7f for speed lower than U320 which will
3946 * avoid the persistent sync offset overruns.
3948 const MAX_OFFSET_NON_PACED 0x7f
3952 * The size of our sense buffers.
3953 * Sense buffer mapping can be handled in either of two ways.
3954 * The first is to allocate a dmamap for each transaction.
3955 * Depending on the architecture, dmamaps can be costly. The
3956 * alternative is to statically map the buffers in much the same
3957 * way we handle our scatter gather lists. The driver implements
3960 const AHD_SENSE_BUFSIZE 256
3962 /* Target mode command processing constants */
3963 const CMD_GROUP_CODE_SHIFT 0x05
3965 const STATUS_BUSY 0x08
3966 const STATUS_QUEUE_FULL 0x28
3967 const STATUS_PKT_SENSE 0xFF
3968 const TARGET_DATA_IN 1
3970 const SCB_TRANSFER_SIZE_FULL_LUN 56
3971 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
3972 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
3973 const PKT_OVERRUN_BUFSIZE 512
3978 const AHD_TIMER_US_PER_TICK 25
3979 const AHD_TIMER_MAX_TICKS 0xFFFF
3980 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
3983 * Downloaded (kernel inserted) constants
3985 const SG_PREFETCH_CNT download
3986 const SG_PREFETCH_CNT_LIMIT download
3987 const SG_PREFETCH_ALIGN_MASK download
3988 const SG_PREFETCH_ADDR_MASK download
3989 const SG_SIZEOF download
3990 const PKT_OVERRUN_BUFOFFSET download
3991 const SCB_TRANSFER_SIZE download
3992 const CACHELINE_MASK download
3997 const NVRAM_SCB_OFFSET 0x2C