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; \
83 * Registers marked "dont_generate_debug_code" are not (yet) referenced
84 * from the driver code, and this keyword inhibit generation
85 * of debug code for them.
87 * REG_PRETTY_PRINT config will complain if dont_generate_debug_code
88 * is added to the register which is referenced in the driver.
89 * Unreferenced register with no dont_generate_debug_code will result
90 * in dead code. No warning is issued.
95 * Controls which of the 5, 512byte, address spaces should be used
96 * as the source and destination of any register accesses in our
105 dont_generate_debug_code
108 const SRC_MODE_SHIFT 0
109 const DST_MODE_SHIFT 4
112 * Host Interrupt Status
129 * Sequencer Interrupt Code
131 register SEQINTCODE {
135 NO_SEQINT, /* No seqint pending. */
136 BAD_PHASE, /* unknown scsi bus phase */
137 SEND_REJECT, /* sending a message reject */
138 PROTO_VIOLATION, /* Protocol Violation */
139 NO_MATCH, /* no cmd match for reconnect */
140 IGN_WIDE_RES, /* Complex IGN Wide Res Msg */
142 * Returned to data phase
144 * transfer pointers to be
145 * recalculated from the
149 * The bus is ready for the
150 * host to perform another
151 * message transaction. This
152 * mechanism is used for things
153 * like sync/wide negotiation
154 * that require a kernel based
155 * message state engine.
157 BAD_STATUS, /* Bad status from target */
159 * Target attempted to write
160 * beyond the bounds of its
164 * Target completed command
165 * without honoring our ATN
166 * request to issue a message.
169 * The sequencer never saw
170 * the bus go free after
171 * either a command complete
172 * or disconnect message.
181 TASKMGMT_FUNC_COMPLETE, /*
182 * Task management function
183 * request completed with
184 * an expected busfree.
186 TASKMGMT_CMD_CMPLT_OKAY, /*
187 * A command with a non-zero
188 * task management function
189 * has completed via the normal
190 * command completion method
191 * for commands with a zero
192 * task management function.
193 * This happens when an attempt
194 * to abort a command loses
195 * the race for the command to
205 dont_generate_debug_code
209 * Clear Host Interrupt
215 field CLRHWERRINT 0x80 /* Rev B or greater */
216 field CLRBRKADRINT 0x40
217 field CLRSWTMINT 0x20
219 field CLRSCSIINT 0x08
222 field CLRSPLTINT 0x01
223 dont_generate_debug_code
233 field CIOACCESFAIL 0x40 /* Rev B or greater */
239 dont_generate_debug_code
248 field CLRCIOPARERR 0x80
249 field CLRCIOACCESFAIL 0x40 /* Rev B or greater */
250 field CLRMPARERR 0x20
251 field CLRDPARERR 0x10
252 field CLRSQPARERR 0x08
253 field CLRILLOPCODE 0x04
254 field CLRDSCTMOUT 0x02
258 * Host Control Register
259 * Overall host control of the device.
265 field SEQ_RESET 0x80 /* Rev B or greater */
268 field SWTIMER_START_B 0x08 /* Rev B or greater */
272 field CHIPRSTACK 0x01
273 dont_generate_debug_code
277 * Host New SCB Queue Offset
279 register HNSCB_QOFF {
284 dont_generate_debug_code
288 * Host Empty SCB Queue Offset
290 register HESCB_QOFF {
294 dont_generate_debug_code
300 register HS_MAILBOX {
303 mask HOST_TQINPOS 0x80 /* Boundary at either 0 or 128 */
304 mask ENINT_COALESCE 0x40 /* Perform interrupt coalescing */
308 * Sequencer Interupt Status
310 register SEQINTSTAT {
314 field SEQ_SWTMRTO 0x10
315 field SEQ_SEQINT 0x08
316 field SEQ_SCSIINT 0x04
317 field SEQ_PCIINT 0x02
318 field SEQ_SPLTINT 0x01
322 * Clear SEQ Interrupt
324 register CLRSEQINTSTAT {
327 field CLRSEQ_SWTMRTO 0x10
328 field CLRSEQ_SEQINT 0x08
329 field CLRSEQ_SCSIINT 0x04
330 field CLRSEQ_PCIINT 0x02
331 field CLRSEQ_SPLTINT 0x01
332 dont_generate_debug_code
342 dont_generate_debug_code
346 * SEQ New SCB Queue Offset
348 register SNSCB_QOFF {
353 dont_generate_debug_code
357 * SEQ Empty SCB Queue Offset
359 register SESCB_QOFF {
364 dont_generate_debug_code
368 * SEQ Done SCB Queue Offset
370 register SDSCB_QOFF {
375 dont_generate_debug_code
379 * Queue Offset Control & Status
381 register QOFF_CTLSTA {
385 field EMPTY_SCB_AVAIL 0x80
386 field NEW_SCB_AVAIL 0x40
387 field SDSCB_ROLLOVR 0x20
388 field HS_MAILBOX_ACT 0x10
389 field SCB_QSIZE 0x0F {
404 dont_generate_debug_code
413 field SWTMINTMASK 0x80
415 field SWTIMER_START 0x20
416 field AUTOCLRCMDINT 0x10
432 field SCSIENWRDIS 0x40 /* Rev B only. */
438 field DIRECTIONACK 0x04
440 field FIFOFLUSHACK 0x02
441 field DIRECTIONEN 0x01
445 * Device Space Command 0
447 register DSCOMMAND0 {
452 field CACHETHEN 0x80 /* Cache Threshold enable */
453 field DPARCKEN 0x40 /* Data Parity Check Enable */
454 field MPARCKEN 0x20 /* Memory Parity Check Enable */
455 field EXTREQLCK 0x10 /* External Request Lock */
456 field DISABLE_TWATE 0x02 /* Rev B or greater */
457 field CIOPARCKEN 0x01 /* Internal bus parity error enable */
458 dont_generate_debug_code
468 field PRELOAD_AVAIL 0x80
469 field PKT_PRELOAD_AVAIL 0x40
480 register SG_CACHE_PRE {
484 field SG_ADDR_MASK 0xf8
487 dont_generate_debug_code
490 register SG_CACHE_SHADOW {
494 field SG_ADDR_MASK 0xf8
497 field LAST_SEG_DONE 0x01
507 field RESET_HARB 0x80
508 field RETRY_SWEN 0x08
513 * Data Channel Host Address
520 dont_generate_debug_code
524 * Host Overlay DMA Address
541 field SPLIT_DROP_REQ 0x80
545 * Data Channel Host Count
552 dont_generate_debug_code
556 * Host Overlay DMA Count
566 * Host Overlay DMA Enable
575 * Scatter/Gather Host Address
582 dont_generate_debug_code
593 dont_generate_debug_code
597 * Scatter/Gather Host Count
603 dont_generate_debug_code
613 dont_generate_debug_code
617 * Data FIFO Threshold
624 field WR_DFTHRSH 0x70 {
634 field RD_DFTHRSH 0x07 {
644 dont_generate_debug_code
677 * Data Channel Receive Message 0
688 * CMC Recieve Message 0
699 * Overlay Recieve Message 0
701 register OVLYRXMSG0 {
710 * Relaxed Order Enable
725 * Data Channel Receive Message 1
735 * CMC Recieve Message 1
745 * Overlay Recieve Message 1
747 register OVLYRXMSG1 {
770 * Data Channel Receive Message 2
780 * CMC Recieve Message 2
790 * Overlay Recieve Message 2
792 register OVLYRXMSG2 {
800 * Outstanding Split Transactions
809 * Data Channel Receive Message 3
819 * CMC Recieve Message 3
829 * Overlay Recieve Message 3
831 register OVLYRXMSG3 {
847 field UNEXPSCIEN 0x20
848 field SPLTSMADIS 0x10
849 field SPLTSTADIS 0x08
853 dont_generate_debug_code
857 * CMC Sequencer Byte Count
859 register CMCSEQBCNT {
866 * Overlay Sequencer Byte Count
868 register OVLYSEQBCNT {
875 * Data Channel Sequencer Byte Count
877 register DCHSEQBCNT {
885 * Data Channel Split Status 0
887 register DCHSPLTSTAT0 {
895 field SCDATBUCKET 0x10
896 field CNTNOTCMPLT 0x08
900 dont_generate_debug_code
906 register CMCSPLTSTAT0 {
913 field SCDATBUCKET 0x10
914 field CNTNOTCMPLT 0x08
921 * Overlay Split Status 0
923 register OVLYSPLTSTAT0 {
930 field SCDATBUCKET 0x10
931 field CNTNOTCMPLT 0x08
938 * Data Channel Split Status 1
940 register DCHSPLTSTAT1 {
945 field RXDATABUCKET 0x01
946 dont_generate_debug_code
952 register CMCSPLTSTAT1 {
956 field RXDATABUCKET 0x01
960 * Overlay Split Status 1
962 register OVLYSPLTSTAT1 {
966 field RXDATABUCKET 0x01
970 * S/G Receive Message 0
981 * S/G Receive Message 1
991 * S/G Receive Message 2
1001 * S/G Receive Message 3
1006 modes M_DFF0, M_DFF1
1011 * Slave Split Out Address 0
1013 register SLVSPLTOUTADR0 {
1017 field LOWER_ADDR 0x7F
1021 * Slave Split Out Address 1
1023 register SLVSPLTOUTADR1 {
1032 * Slave Split Out Address 2
1034 register SLVSPLTOUTADR2 {
1042 * Slave Split Out Address 3
1044 register SLVSPLTOUTADR3 {
1053 * SG Sequencer Byte Count
1055 register SGSEQBCNT {
1058 modes M_DFF0, M_DFF1
1062 * Slave Split Out Attribute 0
1064 register SLVSPLTOUTATTR0 {
1068 field LOWER_BCNT 0xFF
1072 * Slave Split Out Attribute 1
1074 register SLVSPLTOUTATTR1 {
1078 field CMPLT_DNUM 0xF8
1079 field CMPLT_FNUM 0x07
1083 * Slave Split Out Attribute 2
1085 register SLVSPLTOUTATTR2 {
1090 field CMPLT_BNUM 0xFF
1093 * S/G Split Status 0
1095 register SGSPLTSTAT0 {
1098 modes M_DFF0, M_DFF1
1103 field SCDATBUCKET 0x10
1104 field CNTNOTCMPLT 0x08
1107 field RXSPLTRSP 0x01
1108 dont_generate_debug_code
1112 * S/G Split Status 1
1114 register SGSPLTSTAT1 {
1117 modes M_DFF0, M_DFF1
1119 field RXDATABUCKET 0x01
1120 dont_generate_debug_code
1130 field TEST_GROUP 0xF0
1132 dont_generate_debug_code
1136 * Data FIFO 0 PCI Status
1138 register DF0PCISTAT {
1151 dont_generate_debug_code
1155 * Data FIFO 1 PCI Status
1157 register DF1PCISTAT {
1174 register SGPCISTAT {
1190 register CMCPCISTAT {
1205 * Overlay PCI Status
1207 register OVLYPCISTAT {
1221 * PCI Status for MSI Master DMA Transfer
1223 register MSIPCISTAT {
1230 field CLRPENDMSI 0x08
1236 * PCI Status for Target
1238 register TARGPCISTAT {
1247 dont_generate_debug_code
1252 * The last LQ Packet recieved
1259 modes M_DFF0, M_DFF1, M_SCSI
1260 dont_generate_debug_code
1265 * SCB offset for Target Mode SCB type information
1275 * SCB offset to the Two Byte tag identifier used for target mode.
1284 * Logical Unit Number Pointer
1285 * SCB offset to the LSB (little endian) of the lun field.
1292 dont_generate_debug_code
1296 * Data Length Pointer
1297 * SCB offset for the 4 byte data length field in target mode.
1299 register DATALENPTR {
1306 * Status Length Pointer
1307 * SCB offset to the two byte status field in target SCBs.
1309 register STATLENPTR {
1316 * Command Length Pointer
1317 * Scb offset for the CDB length field in initiator SCBs.
1319 register CMDLENPTR {
1324 dont_generate_debug_code
1328 * Task Attribute Pointer
1329 * Scb offset for the byte field specifying the attribute byte
1330 * to be used in command packets.
1337 dont_generate_debug_code
1341 * Task Management Flags Pointer
1342 * Scb offset for the byte field specifying the attribute flags
1343 * byte to be used in command packets.
1350 dont_generate_debug_code
1355 * Scb offset for the first byte in the CDB for initiator SCBs.
1362 dont_generate_debug_code
1366 * Queue Next Pointer
1367 * Scb offset for the 2 byte "next scb link".
1374 dont_generate_debug_code
1379 * Scb offset to the value to place in the SCSIID register
1380 * during target mode connections.
1389 * Command Aborted Byte Pointer
1390 * Offset to the SCB flags field that includes the
1391 * "SCB aborted" status bit.
1393 register ABRTBYTEPTR {
1398 dont_generate_debug_code
1402 * Command Aborted Bit Pointer
1403 * Bit offset in the SCB flags field for "SCB aborted" status.
1405 register ABRTBITPTR {
1410 dont_generate_debug_code
1416 register MAXCMDBYTES {
1425 register MAXCMD2RCV {
1434 register SHORTTHRESH {
1441 * Logical Unit Number Length
1442 * The length, in bytes, of the SCB lun field.
1451 dont_generate_debug_code
1453 const LUNLEN_SINGLE_LEVEL_LUN 0xF
1457 * The size, in bytes, of the embedded CDB field in initator SCBs.
1464 dont_generate_debug_code
1469 * The maximum number of commands to issue during a
1470 * single packetized connection.
1477 dont_generate_debug_code
1481 * Maximum Command Counter
1482 * The number of commands already sent during this connection
1484 register MAXCMDCNT {
1488 dont_generate_debug_code
1492 * LQ Packet Reserved Bytes
1493 * The bytes to be sent in the currently reserved fileds
1494 * of all LQ packets.
1513 * Command Reserved 0
1514 * The byte to be sent for the reserved byte 0 of
1515 * outgoing command packets.
1524 * LQ Manager Control 0
1530 field LQITARGCLT 0xC0
1531 field LQIINITGCLT 0x30
1532 field LQ0TARGCLT 0x0C
1533 field LQ0INITGCLT 0x03
1537 * LQ Manager Control 1
1542 modes M_DFF0, M_DFF1, M_SCSI
1545 field SINGLECMD 0x02
1546 field ABORTPENDING 0x01
1547 dont_generate_debug_code
1551 * LQ Manager Control 2
1556 modes M_DFF0, M_DFF1, M_SCSI
1559 field LQICONTINUE 0x40
1560 field LQITOIDLE 0x20
1563 field LQOCONTINUE 0x04
1564 field LQOTOIDLE 0x02
1566 dont_generate_debug_code
1576 field GSBISTERR 0x40
1577 field GSBISTDONE 0x20
1578 field GSBISTRUN 0x10
1579 field OSBISTERR 0x04
1580 field OSBISTDONE 0x02
1581 field OSBISTRUN 0x01
1585 * SCSI Sequence Control0
1590 modes M_DFF0, M_DFF1, M_SCSI
1594 field FORCEBUSFREE 0x10
1605 field NTBISTERR 0x04
1606 field NTBISTDONE 0x02
1607 field NTBISTRUN 0x01
1611 * SCSI Sequence Control 1
1616 modes M_DFF0, M_DFF1, M_SCSI
1618 field MANUALCTL 0x40
1622 field ENAUTOATNP 0x02
1627 * SCSI Transfer Control 0
1635 field BIOSCANCELEN 0x10
1637 dont_generate_debug_code
1641 * SCSI Transfer Control 1
1647 field BITBUCKET 0x80
1654 dont_generate_debug_code
1658 * SCSI Transfer Control 2
1664 field AUTORSTDIS 0x10
1670 * SCSI Bus Initiator IDs
1671 * Bitmask of observed initiators on the bus.
1673 register BUSINITID {
1681 * Data Length Counters
1682 * Packet byte counter.
1687 modes M_DFF0, M_DFF1
1698 field FIFO1FREE 0x20
1699 field FIFO0FREE 0x10
1701 * On the B, this enum only works
1702 * in the read direction. For writes,
1703 * you must use the B version of the
1704 * CURRFIFO_0 definition which is defined
1705 * as a constant outside of this register
1706 * definition to avoid confusing the
1707 * register pretty printing code.
1709 enum CURRFIFO 0x03 {
1716 const B_CURRFIFO_0 0x2
1719 * SCSI Bus Target IDs
1720 * Bitmask of observed targets on the bus.
1722 register BUSTARGID {
1730 * SCSI Control Signal Out
1735 modes M_DFF0, M_DFF1, M_SCSI
1745 * Possible phases to write into SCSISIG0
1747 enum PHASE_MASK CDO|IOO|MSGO {
1750 P_DATAOUT_DT P_DATAOUT|MSGO,
1751 P_DATAIN_DT P_DATAIN|MSGO,
1755 P_MESGIN CDO|IOO|MSGO
1757 dont_generate_debug_code
1761 * SCSI Control Signal In
1766 modes M_DFF0, M_DFF1, M_SCSI
1776 * Possible phases in SCSISIGI
1778 enum PHASE_MASK CDO|IOO|MSGO {
1781 P_DATAOUT_DT P_DATAOUT|MSGO,
1782 P_DATAIN_DT P_DATAIN|MSGO,
1786 P_MESGIN CDO|IOO|MSGO
1791 * Multiple Target IDs
1792 * Bitmask of ids to respond as a target.
1794 register MULTARGID {
1800 dont_generate_debug_code
1806 register SCSIPHASE {
1809 modes M_DFF0, M_DFF1, M_SCSI
1810 field STATUS_PHASE 0x20
1811 field COMMAND_PHASE 0x10
1812 field MSG_IN_PHASE 0x08
1813 field MSG_OUT_PHASE 0x04
1814 field DATA_PHASE_MASK 0x03 {
1815 DATA_OUT_PHASE 0x01,
1823 register SCSIDAT0_IMG {
1826 modes M_DFF0, M_DFF1, M_SCSI
1835 modes M_DFF0, M_DFF1, M_SCSI
1837 dont_generate_debug_code
1846 modes M_DFF0, M_DFF1, M_SCSI
1856 modes M_DFF0, M_DFF1, M_SCSI
1860 dont_generate_debug_code
1864 * Selection/Reselection ID
1865 * Upper four bits are the device id. The ONEBIT is set when the re/selecting
1866 * device did not set its own ID.
1871 modes M_DFF0, M_DFF1, M_SCSI
1872 field SELID_MASK 0xf0
1877 * SCSI Block Control
1878 * Controls Bus type and channel selection. SELWIDE allows for the
1879 * coexistence of 8bit and 16bit devices on a wide bus.
1884 modes M_DFF0, M_DFF1, M_SCSI
1885 field DIAGLEDEN 0x80
1886 field DIAGLEDON 0x40
1887 field ENAB40 0x08 /* LVD transceiver active */
1888 field ENAB20 0x04 /* SE/HVD transceiver active */
1890 dont_generate_debug_code
1896 register OPTIONMODE {
1901 field BIOSCANCTL 0x80
1902 field AUTOACKEN 0x40
1903 field BIASCANCTL 0x20
1904 field BUSFREEREV 0x10
1905 field ENDGFORMCHK 0x04
1906 field AUTO_MSGOUT_DE 0x02
1907 mask OPTIONMODE_DEFAULTS AUTO_MSGOUT_DE
1908 dont_generate_debug_code
1917 modes M_DFF0, M_DFF1, M_SCSI
1918 field TARGET 0x80 /* Board acting as target */
1919 field SELDO 0x40 /* Selection Done */
1920 field SELDI 0x20 /* Board has been selected */
1921 field SELINGO 0x10 /* Selection In Progress */
1922 field IOERR 0x08 /* LVD Tranceiver mode changed */
1923 field OVERRUN 0x04 /* SCSI Offset overrun detected */
1924 field SPIORDY 0x02 /* SCSI PIO Ready */
1925 field ARBDO 0x01 /* Arbitration Done Out */
1929 * Clear SCSI Interrupt 0
1930 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
1935 modes M_DFF0, M_DFF1, M_SCSI
1938 field CLRSELINGO 0x10
1940 field CLROVERRUN 0x04
1941 field CLRSPIORDY 0x02
1943 dont_generate_debug_code
1947 * SCSI Interrupt Mode 0
1948 * Setting any bit will enable the corresponding function
1949 * in SIMODE0 to interrupt via the IRQ pin.
1958 field ENSELINGO 0x10
1960 field ENOVERRUN 0x04
1961 field ENSPIORDY 0x02
1971 modes M_DFF0, M_DFF1, M_SCSI
1978 field STRB2FAST 0x02
1983 * Clear SCSI Interrupt 1
1984 * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
1989 modes M_DFF0, M_DFF1, M_SCSI
1990 field CLRSELTIMEO 0x80
1992 field CLRSCSIRSTI 0x20
1993 field CLRBUSFREE 0x08
1994 field CLRSCSIPERR 0x04
1995 field CLRSTRB2FAST 0x02
1996 field CLRREQINIT 0x01
1997 dont_generate_debug_code
2006 modes M_DFF0, M_DFF1, M_SCSI
2007 field BUSFREETIME 0xc0 {
2012 field NONPACKREQ 0x20
2013 field EXP_ACTIVE 0x10 /* SCSI Expander Active */
2014 field BSYX 0x08 /* Busy Expander */
2015 field WIDE_RES 0x04 /* Modes 0 and 1 only */
2016 field SDONE 0x02 /* Modes 0 and 1 only */
2017 field DMADONE 0x01 /* Modes 0 and 1 only */
2021 * Clear SCSI Interrupt 2
2026 modes M_DFF0, M_DFF1, M_SCSI
2027 field CLRNONPACKREQ 0x20
2028 field CLRWIDE_RES 0x04 /* Modes 0 and 1 only */
2029 field CLRSDONE 0x02 /* Modes 0 and 1 only */
2030 field CLRDMADONE 0x01 /* Modes 0 and 1 only */
2031 dont_generate_debug_code
2035 * SCSI Interrupt Mode 2
2041 field ENWIDE_RES 0x04
2043 field ENDMADONE 0x01
2047 * Physical Error Diagnosis
2052 modes M_DFF0, M_DFF1, M_SCSI
2056 field PREVPHASE 0x20
2057 field PARITYERR 0x10
2060 field DGFORMERR 0x02
2065 * LQI Manager Current State
2072 dont_generate_debug_code
2081 modes M_DFF0, M_DFF1, M_SCSI
2086 * LQO Manager Current State
2093 dont_generate_debug_code
2097 * LQI Manager Status
2102 modes M_DFF0, M_DFF1, M_SCSI
2104 field LQIATNQAS 0x20
2107 field LQIBADLQT 0x04
2109 field LQIATNCMD 0x01
2113 * Clear LQI Interrupts 0
2115 register CLRLQIINT0 {
2118 modes M_DFF0, M_DFF1, M_SCSI
2120 field CLRLQIATNQAS 0x20
2121 field CLRLQICRCT1 0x10
2122 field CLRLQICRCT2 0x08
2123 field CLRLQIBADLQT 0x04
2124 field CLRLQIATNLQ 0x02
2125 field CLRLQIATNCMD 0x01
2126 dont_generate_debug_code
2130 * LQI Manager Interrupt Mode 0
2137 field ENLQIATNQASK 0x20
2138 field ENLQICRCT1 0x10
2139 field ENLQICRCT2 0x08
2140 field ENLQIBADLQT 0x04
2141 field ENLQIATNLQ 0x02
2142 field ENLQIATNCMD 0x01
2143 dont_generate_debug_code
2147 * LQI Manager Status 1
2152 modes M_DFF0, M_DFF1, M_SCSI
2154 field LQIPHASE_LQ 0x80
2155 field LQIPHASE_NLQ 0x40
2157 field LQICRCI_LQ 0x10
2158 field LQICRCI_NLQ 0x08
2159 field LQIBADLQI 0x04
2160 field LQIOVERI_LQ 0x02
2161 field LQIOVERI_NLQ 0x01
2165 * Clear LQI Manager Interrupts1
2167 register CLRLQIINT1 {
2170 modes M_DFF0, M_DFF1, M_SCSI
2172 field CLRLQIPHASE_LQ 0x80
2173 field CLRLQIPHASE_NLQ 0x40
2174 field CLRLIQABORT 0x20
2175 field CLRLQICRCI_LQ 0x10
2176 field CLRLQICRCI_NLQ 0x08
2177 field CLRLQIBADLQI 0x04
2178 field CLRLQIOVERI_LQ 0x02
2179 field CLRLQIOVERI_NLQ 0x01
2180 dont_generate_debug_code
2184 * LQI Manager Interrupt Mode 1
2191 field ENLQIPHASE_LQ 0x80 /* LQIPHASE1 */
2192 field ENLQIPHASE_NLQ 0x40 /* LQIPHASE2 */
2193 field ENLIQABORT 0x20
2194 field ENLQICRCI_LQ 0x10 /* LQICRCI1 */
2195 field ENLQICRCI_NLQ 0x08 /* LQICRCI2 */
2196 field ENLQIBADLQI 0x04
2197 field ENLQIOVERI_LQ 0x02 /* LQIOVERI1 */
2198 field ENLQIOVERI_NLQ 0x01 /* LQIOVERI2 */
2199 dont_generate_debug_code
2203 * LQI Manager Status 2
2208 modes M_DFF0, M_DFF1, M_SCSI
2209 field PACKETIZED 0x80
2210 field LQIPHASE_OUTPKT 0x40
2211 field LQIWORKONLQ 0x20
2212 field LQIWAITFIFO 0x10
2213 field LQISTOPPKT 0x08
2214 field LQISTOPLQ 0x04
2215 field LQISTOPCMD 0x02
2216 field LQIGSAVAIL 0x01
2225 modes M_DFF0, M_DFF1, M_SCSI
2227 field NTRAMPERR 0x02
2228 field OSRAMPERR 0x01
2232 * Clear SCSI Status 3
2237 modes M_DFF0, M_DFF1, M_SCSI
2239 field CLRNTRAMPERR 0x02
2240 field CLROSRAMPERR 0x01
2241 dont_generate_debug_code
2245 * SCSI Interrupt Mode 3
2252 field ENNTRAMPERR 0x02
2253 field ENOSRAMPERR 0x01
2254 dont_generate_debug_code
2258 * LQO Manager Status 0
2263 modes M_DFF0, M_DFF1, M_SCSI
2265 field LQOTARGSCBPERR 0x10
2266 field LQOSTOPT2 0x08
2268 field LQOATNPKT 0x02
2273 * Clear LQO Manager interrupt 0
2275 register CLRLQOINT0 {
2278 modes M_DFF0, M_DFF1, M_SCSI
2280 field CLRLQOTARGSCBPERR 0x10
2281 field CLRLQOSTOPT2 0x08
2282 field CLRLQOATNLQ 0x04
2283 field CLRLQOATNPKT 0x02
2284 field CLRLQOTCRC 0x01
2285 dont_generate_debug_code
2289 * LQO Manager Interrupt Mode 0
2296 field ENLQOTARGSCBPERR 0x10
2297 field ENLQOSTOPT2 0x08
2298 field ENLQOATNLQ 0x04
2299 field ENLQOATNPKT 0x02
2300 field ENLQOTCRC 0x01
2301 dont_generate_debug_code
2305 * LQO Manager Status 1
2310 modes M_DFF0, M_DFF1, M_SCSI
2311 field LQOINITSCBPERR 0x10
2312 field LQOSTOPI2 0x08
2313 field LQOBADQAS 0x04
2314 field LQOBUSFREE 0x02
2315 field LQOPHACHGINPKT 0x01
2319 * Clear LOQ Interrupt 1
2321 register CLRLQOINT1 {
2324 modes M_DFF0, M_DFF1, M_SCSI
2326 field CLRLQOINITSCBPERR 0x10
2327 field CLRLQOSTOPI2 0x08
2328 field CLRLQOBADQAS 0x04
2329 field CLRLQOBUSFREE 0x02
2330 field CLRLQOPHACHGINPKT 0x01
2331 dont_generate_debug_code
2335 * LQO Manager Interrupt Mode 1
2342 field ENLQOINITSCBPERR 0x10
2343 field ENLQOSTOPI2 0x08
2344 field ENLQOBADQAS 0x04
2345 field ENLQOBUSFREE 0x02
2346 field ENLQOPHACHGINPKT 0x01
2347 dont_generate_debug_code
2351 * LQO Manager Status 2
2356 modes M_DFF0, M_DFF1, M_SCSI
2358 field LQOWAITFIFO 0x10
2359 field LQOPHACHGOUTPKT 0x02 /* outside of packet boundaries. */
2360 field LQOSTOP0 0x01 /* Stopped after sending all packets */
2364 * Output Synchronizer Space Count
2366 register OS_SPACE_CNT {
2371 dont_generate_debug_code
2375 * SCSI Interrupt Mode 1
2376 * Setting any bit will enable the corresponding function
2377 * in SIMODE1 to interrupt via the IRQ pin.
2382 modes M_DFF0, M_DFF1, M_SCSI
2383 field ENSELTIMO 0x80
2384 field ENATNTARG 0x40
2385 field ENSCSIRST 0x20
2386 field ENPHASEMIS 0x10
2387 field ENBUSFREE 0x08
2388 field ENSCSIPERR 0x04
2389 field ENSTRB2FAST 0x02
2390 field ENREQINIT 0x01
2400 modes M_DFF0, M_DFF1, M_SCSI
2401 dont_generate_debug_code
2405 * Data FIFO SCSI Transfer Control
2407 register DFFSXFRCTL {
2410 modes M_DFF0, M_DFF1
2411 field DFFBITBUCKET 0x08
2418 * Next SCSI Control Block
2425 dont_generate_debug_code
2432 register LQOSCSCTL {
2438 field LQOH2A_VERSION 0x80
2439 field LQOBUSETDLY 0x40
2440 field LQONOHOLDLACK 0x02
2441 field LQONOCHKOVER 0x01
2442 dont_generate_debug_code
2448 register SEQINTSRC {
2451 modes M_DFF0, M_DFF1
2455 field CFG4ISTAT 0x08
2456 field CFG4TSTAT 0x04
2462 * Clear Arp Interrupts
2464 register CLRSEQINTSRC {
2467 modes M_DFF0, M_DFF1
2468 field CLRCTXTDONE 0x40
2469 field CLRSAVEPTRS 0x20
2470 field CLRCFG4DATA 0x10
2471 field CLRCFG4ISTAT 0x08
2472 field CLRCFG4TSTAT 0x04
2473 field CLRCFG4ICMD 0x02
2474 field CLRCFG4TCMD 0x01
2475 dont_generate_debug_code
2479 * SEQ Interrupt Enabled (Shared)
2484 modes M_DFF0, M_DFF1
2485 field ENCTXTDONE 0x40
2486 field ENSAVEPTRS 0x20
2487 field ENCFG4DATA 0x10
2488 field ENCFG4ISTAT 0x08
2489 field ENCFG4TSTAT 0x04
2490 field ENCFG4ICMD 0x02
2491 field ENCFG4TCMD 0x01
2495 * Current SCSI Control Block
2502 dont_generate_debug_code
2511 modes M_DFF0, M_DFF1
2512 field SHCNTNEGATIVE 0x40 /* Rev B or higher */
2513 field SHCNTMINUS1 0x20 /* Rev B or higher */
2514 field LASTSDONE 0x10
2516 field DLZERO 0x04 /* FIFO data ends on packet boundary. */
2517 field DATAINFIFO 0x02
2524 register CRCCONTROL {
2528 field CRCVALCHKEN 0x40
2539 field SEL_TXPLL_DEBUG 0x04
2543 * Data FIFO Queue Tag
2549 modes M_DFF0, M_DFF1
2553 * Last SCSI Control Block
2560 dont_generate_debug_code
2564 * SCSI I/O Cell Power-down Control
2570 field DISABLE_OE 0x80
2571 field PDN_IDIST 0x04
2572 field PDN_DIFFSENSE 0x01
2576 * Shaddow Host Address.
2582 modes M_DFF0, M_DFF1
2583 dont_generate_debug_code
2587 * Data Group CRC Interval.
2597 * Data Transfer Negotiation Address
2603 dont_generate_debug_code
2607 * Data Transfer Negotiation Data - Period Byte
2609 register NEGPERIOD {
2614 dont_generate_debug_code
2618 * Packetized CRC Interval
2628 * Data Transfer Negotiation Data - Offset Byte
2630 register NEGOFFSET {
2635 dont_generate_debug_code
2639 * Data Transfer Negotiation Data - PPR Options
2641 register NEGPPROPTS {
2646 field PPROPT_PACE 0x08
2647 field PPROPT_QAS 0x04
2648 field PPROPT_DT 0x02
2649 field PPROPT_IUT 0x01
2650 dont_generate_debug_code
2654 * Data Transfer Negotiation Data - Connection Options
2656 register NEGCONOPTS {
2660 field ENSNAPSHOT 0x40
2661 field RTI_WRTDIS 0x20
2662 field RTI_OVRDTRN 0x10
2663 field ENSLOWCRC 0x08
2664 field ENAUTOATNI 0x04
2665 field ENAUTOATNO 0x02
2667 dont_generate_debug_code
2671 * Negotiation Table Annex Column Index.
2678 dont_generate_debug_code
2690 field BIDICHKDIS 0x80
2691 field STSELSKIDDIS 0x40
2692 field CURRFIFODEF 0x20
2693 field WIDERESEN 0x10
2694 field SDONEMSKDIS 0x08
2695 field DFFACTCLR 0x04
2696 field SHVALIDSTDIS 0x02
2697 field LSTSGCLRDIS 0x01
2698 dont_generate_debug_code
2701 const AHD_ANNEXCOL_PER_DEV0 4
2702 const AHD_NUM_PER_DEV_ANNEXCOLS 4
2703 const AHD_ANNEXCOL_PRECOMP_SLEW 4
2704 const AHD_PRECOMP_MASK 0x07
2705 const AHD_PRECOMP_SHIFT 0
2706 const AHD_PRECOMP_CUTBACK_17 0x04
2707 const AHD_PRECOMP_CUTBACK_29 0x06
2708 const AHD_PRECOMP_CUTBACK_37 0x07
2709 const AHD_SLEWRATE_MASK 0x78
2710 const AHD_SLEWRATE_SHIFT 3
2712 * Rev A has only a single bit (high bit of field) of slew adjustment.
2713 * Rev B has 4 bits. The current default happens to be the same for both.
2715 const AHD_SLEWRATE_DEF_REVA 0x08
2716 const AHD_SLEWRATE_DEF_REVB 0x08
2718 /* Rev A does not have any amplitude setting. */
2719 const AHD_ANNEXCOL_AMPLITUDE 6
2720 const AHD_AMPLITUDE_MASK 0x7
2721 const AHD_AMPLITUDE_SHIFT 0
2722 const AHD_AMPLITUDE_DEF 0x7
2725 * Negotiation Table Annex Data Port.
2732 dont_generate_debug_code
2736 * Initiator's Own Id.
2737 * The SCSI ID to use for Selection Out and seen during a reselection..
2743 dont_generate_debug_code
2747 * 960MHz Phase-Locked Loop Control 0
2749 register PLL960CTL0 {
2753 field PLL_VCOSEL 0x80
2756 field PLL_ENLUD 0x08
2757 field PLL_ENLPF 0x04
2759 field PLL_ENFBM 0x01
2770 dont_generate_debug_code
2774 * 960MHz Phase-Locked Loop Control 1
2776 register PLL960CTL1 {
2780 field PLL_CNTEN 0x80
2781 field PLL_CNTCLR 0x40
2786 * Expander Signature
2801 modes M_DFF0, M_DFF1
2802 dont_generate_debug_code
2815 * 960-MHz Phase-Locked Loop Test Count
2817 register PLL960CNT0 {
2825 * 400-MHz Phase-Locked Loop Control 0
2827 register PLL400CTL0 {
2831 field PLL_VCOSEL 0x80
2834 field PLL_ENLUD 0x08
2835 field PLL_ENLPF 0x04
2837 field PLL_ENFBM 0x01
2841 * Arbitration Fairness
2851 * 400-MHz Phase-Locked Loop Control 1
2853 register PLL400CTL1 {
2857 field PLL_CNTEN 0x80
2858 field PLL_CNTCLR 0x40
2863 * Arbitration Unfairness
2865 register UNFAIRNESS {
2873 * 400-MHz Phase-Locked Loop Test Count
2875 register PLL400CNT0 {
2889 modes M_DFF0, M_DFF1, M_CCHAN, M_SCSI
2890 dont_generate_debug_code
2894 * CMC SCB Array Count
2895 * Number of bytes to transfer between CMC SCB memory and SCBRAM.
2896 * Transfers must be 8byte aligned and sized.
2898 register CCSCBACNT {
2906 * SCB-Next Address Snooping logic. When an SCB is transferred to
2907 * the card, the next SCB address to be used by the CMC array can
2908 * be autoloaded from that transfer.
2910 register SCBAUTOPTR {
2915 field AUSCBPTR_EN 0x80
2916 field SCBPTR_ADDR 0x38
2917 field SCBPTR_OFF 0x07
2918 dont_generate_debug_code
2922 * CMC SG Ram Address Pointer
2927 modes M_DFF0, M_DFF1
2928 dont_generate_debug_code
2932 * CMC SCB RAM Address Pointer
2934 register CCSCBADDR {
2938 dont_generate_debug_code
2942 * CMC SCB Ram Back-up Address Pointer
2943 * Indicates the true stop location of transfers halted prior
2944 * to SCBHCNT going to 0.
2946 register CCSCBADR_BK {
2958 modes M_DFF0, M_DFF1
2960 field SG_CACHE_AVAIL 0x10
2961 field CCSGENACK 0x08
2963 field SG_FETCH_REQ 0x02
2964 field CCSGRESET 0x01
2974 field CCSCBDONE 0x80
2979 field CCSCBRESET 0x01
2985 register CMC_RAMBIST {
2989 field SG_ELEMENT_SIZE 0x80
2990 field SCBRAMBIST_FAIL 0x40
2991 field SG_BIST_FAIL 0x20
2992 field SG_BIST_EN 0x10
2993 field CMC_BUFFER_BIST_FAIL 0x02
2994 field CMC_BUFFER_BIST_EN 0x01
2998 * CMC SG RAM Data Port
3003 modes M_DFF0, M_DFF1
3004 dont_generate_debug_code
3008 * CMC SCB RAM Data Port
3014 dont_generate_debug_code
3028 * Flex DMA Byte Count
3040 register FLEXDMASTAT {
3044 field FLEXDMAERR 0x02
3045 field FLEXDMADONE 0x01
3049 * Flex DMA Data Port
3065 dont_generate_debug_code
3076 field FLXARBACK 0x80
3077 field FLXARBREQ 0x40
3082 dont_generate_debug_code
3086 * Serial EEPROM Address
3093 dont_generate_debug_code
3097 * Serial EEPROM Data
3105 dont_generate_debug_code
3109 * Serial EEPROM Status
3116 field INIT_DONE 0x80
3117 field SEEOPCODE 0x70
3118 field LDALTID_L 0x08
3119 field SEEARBACK 0x04
3122 dont_generate_debug_code
3126 * Serial EEPROM Control
3133 field SEEOPCODE 0x70 {
3138 * The following four commands use special
3139 * addresses for differentiation.
3143 mask SEEOP_EWEN 0x40
3144 mask SEEOP_WALL 0x40
3145 mask SEEOP_EWDS 0x40
3148 dont_generate_debug_code
3151 const SEEOP_ERAL_ADDR 0x80
3152 const SEEOP_EWEN_ADDR 0xC0
3153 const SEEOP_WRAL_ADDR 0x40
3154 const SEEOP_EWDS_ADDR 0x00
3163 dont_generate_debug_code
3167 * Data FIFO Write Address
3168 * Pointer to the next QWD location to be written to the data FIFO.
3174 modes M_DFF0, M_DFF1
3175 dont_generate_debug_code
3179 * DSP Filter Control
3181 register DSPFLTRCTL {
3185 field FLTRDISABLE 0x20
3186 field EDGESENSE 0x10
3187 field DSPFCNTSEL 0x0F
3191 * DSP Data Channel Control
3193 register DSPDATACTL {
3198 field BYPASSENAB 0x80
3200 field RCVROFFSTDIS 0x04
3201 field XMITOFFSTDIS 0x02
3202 dont_generate_debug_code
3206 * Data FIFO Read Address
3207 * Pointer to the next QWD location to be read from the data FIFO.
3213 modes M_DFF0, M_DFF1
3219 register DSPREQCTL {
3223 field MANREQCTL 0xC0
3224 field MANREQDLY 0x3F
3230 register DSPACKCTL {
3234 field MANACKCTL 0xC0
3235 field MANACKDLY 0x3F
3240 * Read/Write byte port into the data FIFO. The read and write
3241 * FIFO pointers increment with each read and write respectively
3247 modes M_DFF0, M_DFF1
3248 dont_generate_debug_code
3252 * DSP Channel Select
3254 register DSPSELECT {
3259 field AUTOINCEN 0x80
3261 dont_generate_debug_code
3267 * Write Bias Control
3269 register WRTBIASCTL {
3274 field AUTOXBCDIS 0x80
3275 field XMITMANVAL 0x3F
3276 dont_generate_debug_code
3280 * Currently the WRTBIASCTL is the same as the default.
3282 const WRTBIASCTL_HP_DEFAULT 0x0
3285 * Receiver Bias Control
3287 register RCVRBIOSCTL {
3291 field AUTORBCDIS 0x80
3292 field RCVRMANVAL 0x3F
3296 * Write Bias Calculator
3298 register WRTBIASCALC {
3305 * Data FIFO Pointers
3306 * Contains the byte offset from DFWADDR and DWRADDR to the current
3307 * FIFO write/read locations.
3312 modes M_DFF0, M_DFF1
3316 * Receiver Bias Calculator
3318 register RCVRBIASCALC {
3325 * Data FIFO Backup Read Pointer
3326 * Contains the data FIFO address to be restored if the last
3327 * data accessed from the data FIFO was not transferred successfully.
3333 modes M_DFF0, M_DFF1
3346 * Data FIFO Debug Control
3351 modes M_DFF0, M_DFF1
3352 field DFF_CIO_WR_RDY 0x20
3353 field DFF_CIO_RD_RDY 0x10
3354 field DFF_DIR_ERR 0x08
3355 field DFF_RAMBIST_FAIL 0x04
3356 field DFF_RAMBIST_DONE 0x02
3357 field DFF_RAMBIST_EN 0x01
3361 * Data FIFO Space Count
3362 * Number of FIFO locations that are free.
3368 modes M_DFF0, M_DFF1
3372 * Data FIFO Byte Count
3373 * Number of filled FIFO locations.
3379 modes M_DFF0, M_DFF1
3383 * Sequencer Program Overlay Address.
3384 * Low address must be written prior to high address.
3394 * Sequencer Control 0
3395 * Error detection mode, speed configuration,
3396 * single step, breakpoints and program load.
3402 field PERRORDIS 0x80
3406 field BRKADRINTEN 0x08
3413 * Sequencer Control 1
3414 * Instruction RAM Diagnostics
3419 field OVRLAY_DATA_CHK 0x08
3420 field RAMBIST_DONE 0x04
3421 field RAMBIST_FAIL 0x02
3422 field RAMBIST_EN 0x01
3427 * Zero and Carry state of the ALU.
3435 dont_generate_debug_code
3439 * Sequencer Interrupt Control
3441 register SEQINTCTL {
3444 field INTVEC1DSL 0x80
3445 field INT1_CONTEXT 0x20
3446 field SCS_SEQ_INT1M1 0x10
3447 field SCS_SEQ_INT1M0 0x08
3454 * Sequencer RAM Data Port
3455 * Single byte window into the Sequencer Instruction Ram area starting
3456 * at the address specified by OVLYADDR. To write a full instruction word,
3457 * simply write four bytes in succession. OVLYADDR will increment after the
3458 * most significant instrution byte (the byte with the parity bit) is written.
3464 dont_generate_debug_code
3468 * Sequencer Program Counter
3469 * Low byte must be written prior to high byte.
3476 dont_generate_debug_code
3486 dont_generate_debug_code
3490 * Source Index Register
3491 * Incrementing index for reads of SINDIR and the destination (low byte only)
3492 * for any immediate operands passed in jmp, jc, jnc, call instructions.
3494 * mvi 0xFF call some_routine;
3496 * Will set SINDEX[0] to 0xFF and call the routine "some_routine.
3503 dont_generate_debug_code
3507 * Destination Index Register
3508 * Incrementing index for writes to DINDIR. Can be used as a scratch register.
3514 dont_generate_debug_code
3519 * Sequencer instruction breakpoint address address.
3529 field BRKDIS 0x80 /* Disable Breakpoint */
3534 * All reads to this register return the value 0xFF.
3540 dont_generate_debug_code
3545 * All reads to this register return the value 0.
3551 dont_generate_debug_code
3556 * Writes to this register have no effect.
3562 dont_generate_debug_code
3566 * Source Index Indirect
3567 * Reading this register is equivalent to reading (register_base + SINDEX) and
3568 * incrementing SINDEX by 1.
3573 dont_generate_debug_code
3577 * Destination Index Indirect
3578 * Writing this register is equivalent to writing to (register_base + DINDEX)
3579 * and incrementing DINDEX by 1.
3584 dont_generate_debug_code
3589 * 2's complement to bit value conversion. Write the 2's complement value
3590 * (0-7 only) to the top nibble and retrieve the bit indexed by that value
3591 * on the next read of this register.
3596 register FUNCTION1 {
3603 * Window into the stack. Each stack location is 10 bits wide reported
3604 * low byte followed by high byte. There are 8 stack locations.
3609 dont_generate_debug_code
3613 * Interrupt Vector 1 Address
3614 * Interrupt branch address for SCS SEQ_INT1 mode 0 and 1 interrupts.
3616 register INTVEC1_ADDR {
3622 dont_generate_debug_code
3627 * Address of the SEQRAM instruction currently executing instruction.
3635 dont_generate_debug_code
3639 * Interrupt Vector 2 Address
3640 * Interrupt branch address for HST_SEQ_INT2 interrupts.
3642 register INTVEC2_ADDR {
3648 dont_generate_debug_code
3653 * Address of the SEQRAM instruction executed prior to the current instruction.
3662 register AHD_PCI_CONFIG_BASE {
3669 /* ---------------------- Scratch RAM Offsets ------------------------- */
3677 dont_generate_debug_code
3684 dont_generate_debug_code
3688 field SEGS_AVAIL 0x01
3689 field LOADING_NEEDED 0x02
3690 field FETCH_INPROG 0x04
3693 * Track whether the transfer byte count for
3694 * the current data phase is odd.
3708 dont_generate_debug_code
3712 dont_generate_debug_code
3722 * Per "other-id" execution queues. We use an array of
3723 * tail pointers into lists of SCBs sorted by "other-id".
3724 * The execution head pointer threads the head SCBs for
3729 dont_generate_debug_code
3733 dont_generate_debug_code
3737 dont_generate_debug_code
3740 * SCBID of the next SCB in the new SCB queue.
3742 NEXT_QUEUED_SCB_ADDR {
3744 dont_generate_debug_code
3747 * head of list of SCBs that have
3748 * completed but have not been
3749 * put into the qoutfifo.
3753 dont_generate_debug_code
3756 * The list of completed SCBs in
3759 COMPLETE_SCB_DMAINPROG_HEAD {
3761 dont_generate_debug_code
3764 * head of list of SCBs that have
3765 * completed but need to be uploaded
3766 * to the host prior to being completed.
3768 COMPLETE_DMA_SCB_HEAD {
3770 dont_generate_debug_code
3773 * tail of list of SCBs that have
3774 * completed but need to be uploaded
3775 * to the host prior to being completed.
3777 COMPLETE_DMA_SCB_TAIL {
3779 dont_generate_debug_code
3782 * head of list of SCBs that have
3783 * been uploaded to the host, but cannot
3784 * be completed until the QFREEZE is in
3785 * full effect (i.e. no selections pending).
3787 COMPLETE_ON_QFREEZE_HEAD {
3789 dont_generate_debug_code
3792 * Counting semaphore to prevent new select-outs
3793 * The queue is frozen so long as the sequencer
3794 * and kernel freeze counts differ.
3799 KERNEL_QFREEZE_COUNT {
3803 * Mode to restore on legacy idle loop exit.
3809 * Single byte buffer used to designate the type or message
3810 * to send to a target.
3814 dont_generate_debug_code
3816 /* Parameters for DMA Logic */
3820 field PRELOADEN 0x80
3824 field SDMAENACK 0x10
3826 field HDMAENACK 0x08
3827 field DIRECTION 0x04 /* Set indicates PCI->SCSI */
3828 field FIFOFLUSH 0x02
3829 field FIFORESET 0x01
3830 dont_generate_debug_code
3834 field NOT_IDENTIFIED 0x80
3835 field NO_CDB_SENT 0x40
3836 field TARGET_CMD_IS_TAGGED 0x40
3839 field TARG_CMD_PENDING 0x10
3840 field CMDPHASE_PENDING 0x08
3841 field DPHASE_PENDING 0x04
3842 field SPHASE_PENDING 0x02
3843 field NO_DISCONNECT 0x01
3846 * Temporary storage for the
3847 * target/channel/lun of a
3848 * reconnecting target
3852 dont_generate_debug_code
3856 dont_generate_debug_code
3859 * The last bus phase as seen by the sequencer.
3866 field P_BUSFREE 0x01
3867 enum PHASE_MASK CDO|IOO|MSGO {
3870 P_DATAOUT_DT P_DATAOUT|MSGO,
3871 P_DATAIN_DT P_DATAIN|MSGO,
3875 P_MESGIN CDO|IOO|MSGO
3879 * Value to "or" into the SCBPTR[1] value to
3880 * indicate that an entry in the QINFIFO is valid.
3882 QOUTFIFO_ENTRY_VALID_TAG {
3884 dont_generate_debug_code
3887 * Kernel and sequencer offsets into the queue of
3888 * incoming target mode command descriptors. The
3889 * queue is full when the KERNEL_TQINPOS == TQINPOS.
3894 dont_generate_debug_code
3899 dont_generate_debug_code
3902 * Base address of our shared data with the kernel driver in host
3903 * memory. This includes the qoutfifo and target mode
3904 * incoming command queue.
3908 dont_generate_debug_code
3911 * Pointer to location in host memory for next
3912 * position in the qoutfifo.
3914 QOUTFIFO_NEXT_ADDR {
3916 dont_generate_debug_code
3921 mask SEND_SENSE 0x40
3923 mask MSGOUT_PHASEMIS 0x10
3924 mask EXIT_MSG_LOOP 0x08
3925 mask CONT_MSG_LOOP_WRITE 0x04
3926 mask CONT_MSG_LOOP_READ 0x03
3927 mask CONT_MSG_LOOP_TARG 0x02
3929 dont_generate_debug_code
3935 dont_generate_debug_code
3939 * Snapshot of MSG_OUT taken after each message is sent.
3943 dont_generate_debug_code
3947 * Sequences the kernel driver has okayed for us. This allows
3948 * the driver to do things like prevent initiator or target
3954 field MANUALCTL 0x40
3958 field ENAUTOATNP 0x02
3960 dont_generate_debug_code
3964 * The initiator specified tag for this target mode transaction.
3969 dont_generate_debug_code
3974 field PENDING_MK_MESSAGE 0x01
3975 field TARGET_MSG_PENDING 0x02
3976 field SELECTOUT_QFROZEN 0x04
3981 dont_generate_debug_code
3985 * The maximum amount of time to wait, when interrupt coalescing
3986 * is enabled, before issueing a CMDCMPLT interrupt for a completed
3989 INT_COALESCING_TIMER {
3991 dont_generate_debug_code
3995 * The maximum number of commands to coalesce into a single interrupt.
3996 * Actually the 2's complement of that value to simplify sequencer
3999 INT_COALESCING_MAXCMDS {
4001 dont_generate_debug_code
4005 * The minimum number of commands still outstanding required
4006 * to continue coalescing (2's complement of value).
4008 INT_COALESCING_MINCMDS {
4010 dont_generate_debug_code
4014 * Number of commands "in-flight".
4018 dont_generate_debug_code
4022 * The count of commands that have been coalesced.
4024 INT_COALESCING_CMDCOUNT {
4026 dont_generate_debug_code
4030 * Since the HS_MAIBOX is self clearing, copy its contents to
4031 * this position in scratch ram every time it changes.
4035 dont_generate_debug_code
4038 * Target-mode CDB type to CDB length table used
4039 * in non-packetized operation.
4044 dont_generate_debug_code
4047 * When an SCB with the MK_MESSAGE flag is
4048 * queued to the controller, it cannot enter
4049 * the waiting for selection list until the
4050 * selections for any previously queued
4051 * commands to that target complete. During
4052 * the wait, the MK_MESSAGE SCB is queued
4059 * Saved SCSIID of MK_MESSAGE_SCB to avoid
4060 * an extra SCBPTR operation when deciding
4061 * if the MK_MESSAGE_SCB can be run.
4068 /************************* Hardware SCB Definition ****************************/
4073 SCB_RESIDUAL_DATACNT {
4076 alias SCB_HOST_CDB_PTR
4077 dont_generate_debug_code
4079 SCB_RESIDUAL_SGPTR {
4081 field SG_ADDR_MASK 0xf8 /* In the last byte */
4082 field SG_OVERRUN_RESID 0x02 /* In the first byte */
4083 field SG_LIST_NULL 0x01 /* In the first byte */
4084 dont_generate_debug_code
4088 alias SCB_HOST_CDB_LEN
4089 dont_generate_debug_code
4093 dont_generate_debug_code
4095 SCB_TARGET_DATA_DIR {
4097 dont_generate_debug_code
4101 dont_generate_debug_code
4105 * Only valid if CDB length is less than 13 bytes or
4106 * we are using a CDB pointer. Otherwise contains
4107 * the last 4 bytes of embedded cdb information.
4110 alias SCB_NEXT_COMPLETE
4111 dont_generate_debug_code
4114 alias SCB_FIFO_USE_COUNT
4116 dont_generate_debug_code
4120 field TARGET_SCB 0x80
4123 field MK_MESSAGE 0x10
4124 field STATUS_RCVD 0x08
4125 field DISCONNECTED 0x04
4126 field SCB_TAG_TYPE 0x03
4136 dont_generate_debug_code
4138 SCB_TASK_ATTRIBUTE {
4141 * Overloaded field for non-packetized
4142 * ignore wide residue message handling.
4144 field SCB_XFERLEN_ODD 0x01
4145 dont_generate_debug_code
4149 field SCB_CDB_LEN_PTR 0x80 /* CDB in host memory */
4150 dont_generate_debug_code
4152 SCB_TASK_MANAGEMENT {
4154 dont_generate_debug_code
4158 dont_generate_debug_code
4162 * The last byte is really the high address bits for
4166 field SG_LAST_SEG 0x80 /* In the fourth byte */
4167 field SG_HIGH_ADDR_BITS 0x7F /* In the fourth byte */
4168 dont_generate_debug_code
4172 field SG_STATUS_VALID 0x04 /* In the first byte */
4173 field SG_FULL_RESID 0x02 /* In the first byte */
4174 field SG_LIST_NULL 0x01 /* In the first byte */
4175 dont_generate_debug_code
4179 dont_generate_debug_code
4182 alias SCB_NEXT_SCB_BUSADDR
4184 dont_generate_debug_code
4188 dont_generate_debug_code
4194 SCB_DISCONNECTED_LISTS {
4196 dont_generate_debug_code
4200 /*********************************** Constants ********************************/
4201 const MK_MESSAGE_BIT_OFFSET 4
4203 const TARGET_CMD_CMPLT 0xfe
4204 const INVALID_ADDR 0x80
4205 #define SCB_LIST_NULL 0xff
4206 #define QOUTFIFO_ENTRY_VALID_TOGGLE 0x80
4208 const CCSGADDR_MAX 0x80
4209 const CCSCBADDR_MAX 0x80
4210 const CCSGRAM_MAXSEGS 16
4212 /* Selection Timeout Timer Constants */
4213 const STIMESEL_SHIFT 3
4214 const STIMESEL_MIN 0x18
4215 const STIMESEL_BUG_ADJ 0x8
4217 /* WDTR Message values */
4218 const BUS_8_BIT 0x00
4219 const BUS_16_BIT 0x01
4220 const BUS_32_BIT 0x02
4222 /* Offset maximums */
4223 const MAX_OFFSET 0xfe
4224 const MAX_OFFSET_PACED 0xfe
4225 const MAX_OFFSET_PACED_BUG 0x7f
4227 * Some 160 devices incorrectly accept 0xfe as a
4228 * sync offset, but will overrun this value. Limit
4229 * to 0x7f for speed lower than U320 which will
4230 * avoid the persistent sync offset overruns.
4232 const MAX_OFFSET_NON_PACED 0x7f
4236 * The size of our sense buffers.
4237 * Sense buffer mapping can be handled in either of two ways.
4238 * The first is to allocate a dmamap for each transaction.
4239 * Depending on the architecture, dmamaps can be costly. The
4240 * alternative is to statically map the buffers in much the same
4241 * way we handle our scatter gather lists. The driver implements
4244 const AHD_SENSE_BUFSIZE 256
4246 /* Target mode command processing constants */
4247 const CMD_GROUP_CODE_SHIFT 0x05
4249 const STATUS_BUSY 0x08
4250 const STATUS_QUEUE_FULL 0x28
4251 const STATUS_PKT_SENSE 0xFF
4252 const TARGET_DATA_IN 1
4254 const SCB_TRANSFER_SIZE_FULL_LUN 56
4255 const SCB_TRANSFER_SIZE_1BYTE_LUN 48
4256 /* PKT_OVERRUN_BUFSIZE must be a multiple of 256 less than 64K */
4257 const PKT_OVERRUN_BUFSIZE 512
4262 const AHD_TIMER_US_PER_TICK 25
4263 const AHD_TIMER_MAX_TICKS 0xFFFF
4264 const AHD_TIMER_MAX_US (AHD_TIMER_MAX_TICKS * AHD_TIMER_US_PER_TICK)
4267 * Downloaded (kernel inserted) constants
4269 const SG_PREFETCH_CNT download
4270 const SG_PREFETCH_CNT_LIMIT download
4271 const SG_PREFETCH_ALIGN_MASK download
4272 const SG_PREFETCH_ADDR_MASK download
4273 const SG_SIZEOF download
4274 const PKT_OVERRUN_BUFOFFSET download
4275 const SCB_TRANSFER_SIZE download
4276 const CACHELINE_MASK download
4281 const NVRAM_SCB_OFFSET 0x2C