Home | History | Annotate | Line # | Download | only in aic7xxx
aic7xxx.reg revision 1.8
      1  1.1    fvdl /*
      2  1.1    fvdl  * Aic7xxx register and scratch ram definitions.
      3  1.1    fvdl  *
      4  1.2    fvdl  * Copyright (c) 1994-2001 Justin T. Gibbs.
      5  1.2    fvdl  * Copyright (c) 2000-2001 Adaptec Inc.
      6  1.1    fvdl  * All rights reserved.
      7  1.1    fvdl  *
      8  1.1    fvdl  * Redistribution and use in source and binary forms, with or without
      9  1.1    fvdl  * modification, are permitted provided that the following conditions
     10  1.1    fvdl  * are met:
     11  1.1    fvdl  * 1. Redistributions of source code must retain the above copyright
     12  1.1    fvdl  *    notice, this list of conditions, and the following disclaimer,
     13  1.1    fvdl  *    without modification.
     14  1.2    fvdl  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     15  1.2    fvdl  *    substantially similar to the "NO WARRANTY" disclaimer below
     16  1.2    fvdl  *    ("Disclaimer") and any redistribution must be conditioned upon
     17  1.2    fvdl  *    including a substantially similar Disclaimer requirement for further
     18  1.2    fvdl  *    binary redistribution.
     19  1.2    fvdl  * 3. Neither the names of the above-listed copyright holders nor the names
     20  1.2    fvdl  *    of any contributors may be used to endorse or promote products derived
     21  1.2    fvdl  *    from this software without specific prior written permission.
     22  1.1    fvdl  *
     23  1.1    fvdl  * Alternatively, this software may be distributed under the terms of the
     24  1.2    fvdl  * GNU General Public License ("GPL") version 2 as published by the Free
     25  1.2    fvdl  * Software Foundation.
     26  1.1    fvdl  *
     27  1.2    fvdl  * NO WARRANTY
     28  1.2    fvdl  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     29  1.2    fvdl  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     30  1.2    fvdl  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     31  1.2    fvdl  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     32  1.2    fvdl  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     33  1.1    fvdl  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     34  1.1    fvdl  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     35  1.2    fvdl  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     36  1.2    fvdl  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     37  1.2    fvdl  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     38  1.2    fvdl  * POSSIBILITY OF SUCH DAMAGES.
     39  1.1    fvdl  *
     40  1.2    fvdl  * $FreeBSD: /repoman/r/ncvs/src/sys/dev/aic7xxx/aic7xxx.reg,v 1.43 2003/01/20 20:44:55 gibbs Exp $
     41  1.1    fvdl  */
     42  1.8  andvar VERSION = "$NetBSD: aic7xxx.reg,v 1.8 2025/08/18 20:59:56 andvar Exp $"
     43  1.1    fvdl 
     44  1.1    fvdl /*
     45  1.1    fvdl  * This file is processed by the aic7xxx_asm utility for use in assembling
     46  1.1    fvdl  * firmware for the aic7xxx family of SCSI host adapters as well as to generate
     47  1.1    fvdl  * a C header file for use in the kernel portion of the Aic7xxx driver.
     48  1.1    fvdl  *
     49  1.1    fvdl  * All page numbers refer to the Adaptec AIC-7770 Data Book available from
     50  1.1    fvdl  * Adaptec's Technical Documents Department 1-800-934-2766
     51  1.1    fvdl  */
     52  1.1    fvdl 
     53  1.1    fvdl /*
     54  1.1    fvdl  * SCSI Sequence Control (p. 3-11).
     55  1.1    fvdl  * Each bit, when set starts a specific SCSI sequence on the bus
     56  1.1    fvdl  */
     57  1.1    fvdl register SCSISEQ {
     58  1.1    fvdl 	address			0x000
     59  1.1    fvdl 	access_mode RW
     60  1.2    fvdl 	field	TEMODE		0x80
     61  1.2    fvdl 	field	ENSELO		0x40
     62  1.2    fvdl 	field	ENSELI		0x20
     63  1.2    fvdl 	field	ENRSELI		0x10
     64  1.2    fvdl 	field	ENAUTOATNO	0x08
     65  1.2    fvdl 	field	ENAUTOATNI	0x04
     66  1.2    fvdl 	field	ENAUTOATNP	0x02
     67  1.2    fvdl 	field	SCSIRSTO	0x01
     68  1.1    fvdl }
     69  1.1    fvdl 
     70  1.1    fvdl /*
     71  1.1    fvdl  * SCSI Transfer Control 0 Register (pp. 3-13).
     72  1.1    fvdl  * Controls the SCSI module data path.
     73  1.1    fvdl  */
     74  1.1    fvdl register SXFRCTL0 {
     75  1.1    fvdl 	address			0x001
     76  1.1    fvdl 	access_mode RW
     77  1.2    fvdl 	field	DFON		0x80
     78  1.2    fvdl 	field	DFPEXP		0x40
     79  1.2    fvdl 	field	FAST20		0x20
     80  1.2    fvdl 	field	CLRSTCNT	0x10
     81  1.2    fvdl 	field	SPIOEN		0x08
     82  1.2    fvdl 	field	SCAMEN		0x04
     83  1.2    fvdl 	field	CLRCHN		0x02
     84  1.1    fvdl }
     85  1.1    fvdl 
     86  1.1    fvdl /*
     87  1.1    fvdl  * SCSI Transfer Control 1 Register (pp. 3-14,15).
     88  1.1    fvdl  * Controls the SCSI module data path.
     89  1.1    fvdl  */
     90  1.1    fvdl register SXFRCTL1 {
     91  1.1    fvdl 	address			0x002
     92  1.1    fvdl 	access_mode RW
     93  1.2    fvdl 	field	BITBUCKET	0x80
     94  1.2    fvdl 	field	SWRAPEN		0x40
     95  1.2    fvdl 	field	ENSPCHK		0x20
     96  1.1    fvdl 	mask	STIMESEL	0x18
     97  1.2    fvdl 	field	ENSTIMER	0x04
     98  1.2    fvdl 	field	ACTNEGEN	0x02
     99  1.2    fvdl 	field	STPWEN		0x01	/* Powered Termination */
    100  1.1    fvdl }
    101  1.1    fvdl 
    102  1.1    fvdl /*
    103  1.1    fvdl  * SCSI Control Signal Read Register (p. 3-15).
    104  1.1    fvdl  * Reads the actual state of the SCSI bus pins
    105  1.1    fvdl  */
    106  1.1    fvdl register SCSISIGI {
    107  1.1    fvdl 	address			0x003
    108  1.1    fvdl 	access_mode RO
    109  1.2    fvdl 	field	CDI		0x80
    110  1.2    fvdl 	field	IOI		0x40
    111  1.2    fvdl 	field	MSGI		0x20
    112  1.2    fvdl 	field	ATNI		0x10
    113  1.2    fvdl 	field	SELI		0x08
    114  1.2    fvdl 	field	BSYI		0x04
    115  1.2    fvdl 	field	REQI		0x02
    116  1.2    fvdl 	field	ACKI		0x01
    117  1.1    fvdl /*
    118  1.1    fvdl  * Possible phases in SCSISIGI
    119  1.1    fvdl  */
    120  1.1    fvdl 	mask	PHASE_MASK	CDI|IOI|MSGI
    121  1.1    fvdl 	mask	P_DATAOUT	0x00
    122  1.1    fvdl 	mask	P_DATAIN	IOI
    123  1.2    fvdl 	mask	P_DATAOUT_DT	P_DATAOUT|MSGI
    124  1.2    fvdl 	mask	P_DATAIN_DT	P_DATAIN|MSGI
    125  1.1    fvdl 	mask	P_COMMAND	CDI
    126  1.1    fvdl 	mask	P_MESGOUT	CDI|MSGI
    127  1.1    fvdl 	mask	P_STATUS	CDI|IOI
    128  1.1    fvdl 	mask	P_MESGIN	CDI|IOI|MSGI
    129  1.1    fvdl }
    130  1.1    fvdl 
    131  1.1    fvdl /*
    132  1.1    fvdl  * SCSI Control Signal Write Register (p. 3-16).
    133  1.1    fvdl  * Writing to this register modifies the control signals on the bus.  Only
    134  1.1    fvdl  * those signals that are allowed in the current mode (Initiator/Target) are
    135  1.1    fvdl  * asserted.
    136  1.1    fvdl  */
    137  1.1    fvdl register SCSISIGO {
    138  1.1    fvdl 	address			0x003
    139  1.1    fvdl 	access_mode WO
    140  1.2    fvdl 	field	CDO		0x80
    141  1.2    fvdl 	field	IOO		0x40
    142  1.2    fvdl 	field	MSGO		0x20
    143  1.2    fvdl 	field	ATNO		0x10
    144  1.2    fvdl 	field	SELO		0x08
    145  1.2    fvdl 	field	BSYO		0x04
    146  1.2    fvdl 	field	REQO		0x02
    147  1.2    fvdl 	field	ACKO		0x01
    148  1.1    fvdl /*
    149  1.1    fvdl  * Possible phases to write into SCSISIG0
    150  1.1    fvdl  */
    151  1.1    fvdl 	mask	PHASE_MASK	CDI|IOI|MSGI
    152  1.1    fvdl 	mask	P_DATAOUT	0x00
    153  1.1    fvdl 	mask	P_DATAIN	IOI
    154  1.1    fvdl 	mask	P_COMMAND	CDI
    155  1.1    fvdl 	mask	P_MESGOUT	CDI|MSGI
    156  1.1    fvdl 	mask	P_STATUS	CDI|IOI
    157  1.1    fvdl 	mask	P_MESGIN	CDI|IOI|MSGI
    158  1.1    fvdl }
    159  1.1    fvdl 
    160  1.3   perry /*
    161  1.1    fvdl  * SCSI Rate Control (p. 3-17).
    162  1.1    fvdl  * Contents of this register determine the Synchronous SCSI data transfer
    163  1.1    fvdl  * rate and the maximum synchronous Req/Ack offset.  An offset of 0 in the
    164  1.1    fvdl  * SOFS (3:0) bits disables synchronous data transfers.  Any offset value
    165  1.1    fvdl  * greater than 0 enables synchronous transfers.
    166  1.1    fvdl  */
    167  1.1    fvdl register SCSIRATE {
    168  1.1    fvdl 	address			0x004
    169  1.1    fvdl 	access_mode RW
    170  1.2    fvdl 	field	WIDEXFER	0x80		/* Wide transfer control */
    171  1.2    fvdl 	field	ENABLE_CRC	0x40		/* CRC for D-Phases */
    172  1.2    fvdl 	field	SINGLE_EDGE	0x10		/* Disable DT Transfers */
    173  1.1    fvdl 	mask	SXFR		0x70		/* Sync transfer rate */
    174  1.1    fvdl 	mask	SXFR_ULTRA2	0x0f		/* Sync transfer rate */
    175  1.1    fvdl 	mask	SOFS		0x0f		/* Sync offset */
    176  1.1    fvdl }
    177  1.1    fvdl 
    178  1.1    fvdl /*
    179  1.1    fvdl  * SCSI ID (p. 3-18).
    180  1.1    fvdl  * Contains the ID of the board and the current target on the
    181  1.1    fvdl  * selected channel.
    182  1.1    fvdl  */
    183  1.1    fvdl register SCSIID	{
    184  1.1    fvdl 	address			0x005
    185  1.1    fvdl 	access_mode RW
    186  1.1    fvdl 	mask	TID		0xf0		/* Target ID mask */
    187  1.2    fvdl 	mask	TWIN_TID	0x70
    188  1.2    fvdl 	field	TWIN_CHNLB	0x80
    189  1.1    fvdl 	mask	OID		0x0f		/* Our ID mask */
    190  1.1    fvdl 	/*
    191  1.1    fvdl 	 * SCSI Maximum Offset (p. 4-61 aic7890/91 Data Book)
    192  1.1    fvdl 	 * The aic7890/91 allow an offset of up to 127 transfers in both wide
    193  1.1    fvdl 	 * and narrow mode.
    194  1.1    fvdl 	 */
    195  1.1    fvdl 	alias	SCSIOFFSET
    196  1.1    fvdl 	mask	SOFS_ULTRA2	0x7f		/* Sync offset U2 chips */
    197  1.1    fvdl }
    198  1.1    fvdl 
    199  1.1    fvdl /*
    200  1.1    fvdl  * SCSI Latched Data (p. 3-19).
    201  1.1    fvdl  * Read/Write latches used to transfer data on the SCSI bus during
    202  1.1    fvdl  * Automatic or Manual PIO mode.  SCSIDATH can be used for the
    203  1.1    fvdl  * upper byte of a 16bit wide asynchronouse data phase transfer.
    204  1.1    fvdl  */
    205  1.1    fvdl register SCSIDATL {
    206  1.1    fvdl 	address			0x006
    207  1.1    fvdl 	access_mode RW
    208  1.1    fvdl }
    209  1.1    fvdl 
    210  1.1    fvdl register SCSIDATH {
    211  1.1    fvdl 	address			0x007
    212  1.1    fvdl 	access_mode RW
    213  1.1    fvdl }
    214  1.1    fvdl 
    215  1.1    fvdl /*
    216  1.1    fvdl  * SCSI Transfer Count (pp. 3-19,20)
    217  1.1    fvdl  * These registers count down the number of bytes transferred
    218  1.1    fvdl  * across the SCSI bus.  The counter is decremented only once
    219  1.1    fvdl  * the data has been safely transferred.  SDONE in SSTAT0 is
    220  1.1    fvdl  * set when STCNT goes to 0
    221  1.3   perry  */
    222  1.1    fvdl register STCNT {
    223  1.1    fvdl 	address			0x008
    224  1.1    fvdl 	size	3
    225  1.1    fvdl 	access_mode RW
    226  1.1    fvdl }
    227  1.1    fvdl 
    228  1.2    fvdl /* ALT_MODE registers (Ultra2 and Ultra160 chips) */
    229  1.2    fvdl register SXFRCTL2 {
    230  1.2    fvdl 	address			0x013
    231  1.2    fvdl 	access_mode RW
    232  1.2    fvdl 	field	AUTORSTDIS	0x10
    233  1.2    fvdl 	field	CMDDMAEN	0x08
    234  1.2    fvdl 	mask	ASYNC_SETUP	0x07
    235  1.2    fvdl }
    236  1.2    fvdl 
    237  1.1    fvdl /* ALT_MODE register on Ultra160 chips */
    238  1.1    fvdl register OPTIONMODE {
    239  1.1    fvdl 	address			0x008
    240  1.1    fvdl 	access_mode RW
    241  1.2    fvdl 	field	AUTORATEEN		0x80
    242  1.2    fvdl 	field	AUTOACKEN		0x40
    243  1.2    fvdl 	field	ATNMGMNTEN		0x20
    244  1.2    fvdl 	field	BUSFREEREV		0x10
    245  1.2    fvdl 	field	EXPPHASEDIS		0x08
    246  1.2    fvdl 	field	SCSIDATL_IMGEN		0x04
    247  1.2    fvdl 	field	AUTO_MSGOUT_DE		0x02
    248  1.2    fvdl 	field	DIS_MSGIN_DUALEDGE	0x01
    249  1.1    fvdl 	mask	OPTIONMODE_DEFAULTS	AUTO_MSGOUT_DE|DIS_MSGIN_DUALEDGE
    250  1.1    fvdl }
    251  1.1    fvdl 
    252  1.1    fvdl /* ALT_MODE register on Ultra160 chips */
    253  1.1    fvdl register TARGCRCCNT {
    254  1.1    fvdl 	address			0x00a
    255  1.1    fvdl 	size	2
    256  1.1    fvdl 	access_mode RW
    257  1.1    fvdl }
    258  1.1    fvdl 
    259  1.1    fvdl /*
    260  1.1    fvdl  * Clear SCSI Interrupt 0 (p. 3-20)
    261  1.1    fvdl  * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT0.
    262  1.1    fvdl  */
    263  1.1    fvdl register CLRSINT0 {
    264  1.1    fvdl 	address			0x00b
    265  1.1    fvdl 	access_mode WO
    266  1.2    fvdl 	field	CLRSELDO	0x40
    267  1.2    fvdl 	field	CLRSELDI	0x20
    268  1.2    fvdl 	field	CLRSELINGO	0x10
    269  1.2    fvdl 	field	CLRSWRAP	0x08
    270  1.2    fvdl 	field	CLRIOERR	0x08	/* Ultra2 Only */
    271  1.2    fvdl 	field	CLRSPIORDY	0x02
    272  1.1    fvdl }
    273  1.1    fvdl 
    274  1.1    fvdl /*
    275  1.1    fvdl  * SCSI Status 0 (p. 3-21)
    276  1.1    fvdl  * Contains one set of SCSI Interrupt codes
    277  1.1    fvdl  * These are most likely of interest to the sequencer
    278  1.1    fvdl  */
    279  1.1    fvdl register SSTAT0	{
    280  1.1    fvdl 	address			0x00b
    281  1.1    fvdl 	access_mode RO
    282  1.2    fvdl 	field	TARGET		0x80	/* Board acting as target */
    283  1.2    fvdl 	field	SELDO		0x40	/* Selection Done */
    284  1.2    fvdl 	field	SELDI		0x20	/* Board has been selected */
    285  1.2    fvdl 	field	SELINGO		0x10	/* Selection In Progress */
    286  1.2    fvdl 	field	SWRAP		0x08	/* 24bit counter wrap */
    287  1.8  andvar 	field	IOERR		0x08	/* LVD Transceiver mode changed */
    288  1.2    fvdl 	field	SDONE		0x04	/* STCNT = 0x000000 */
    289  1.2    fvdl 	field	SPIORDY		0x02	/* SCSI PIO Ready */
    290  1.2    fvdl 	field	DMADONE		0x01	/* DMA transfer completed */
    291  1.1    fvdl }
    292  1.1    fvdl 
    293  1.1    fvdl /*
    294  1.1    fvdl  * Clear SCSI Interrupt 1 (p. 3-23)
    295  1.1    fvdl  * Writing a 1 to a bit clears the associated SCSI Interrupt in SSTAT1.
    296  1.1    fvdl  */
    297  1.1    fvdl register CLRSINT1 {
    298  1.1    fvdl 	address			0x00c
    299  1.1    fvdl 	access_mode WO
    300  1.2    fvdl 	field	CLRSELTIMEO	0x80
    301  1.2    fvdl 	field	CLRATNO		0x40
    302  1.2    fvdl 	field	CLRSCSIRSTI	0x20
    303  1.2    fvdl 	field	CLRBUSFREE	0x08
    304  1.2    fvdl 	field	CLRSCSIPERR	0x04
    305  1.2    fvdl 	field	CLRPHASECHG	0x02
    306  1.2    fvdl 	field	CLRREQINIT	0x01
    307  1.1    fvdl }
    308  1.1    fvdl 
    309  1.1    fvdl /*
    310  1.1    fvdl  * SCSI Status 1 (p. 3-24)
    311  1.1    fvdl  */
    312  1.1    fvdl register SSTAT1	{
    313  1.1    fvdl 	address			0x00c
    314  1.1    fvdl 	access_mode RO
    315  1.2    fvdl 	field	SELTO		0x80
    316  1.2    fvdl 	field	ATNTARG 	0x40
    317  1.2    fvdl 	field	SCSIRSTI	0x20
    318  1.2    fvdl 	field	PHASEMIS	0x10
    319  1.2    fvdl 	field	BUSFREE		0x08
    320  1.2    fvdl 	field	SCSIPERR	0x04
    321  1.2    fvdl 	field	PHASECHG	0x02
    322  1.2    fvdl 	field	REQINIT		0x01
    323  1.1    fvdl }
    324  1.1    fvdl 
    325  1.1    fvdl /*
    326  1.1    fvdl  * SCSI Status 2 (pp. 3-25,26)
    327  1.1    fvdl  */
    328  1.1    fvdl register SSTAT2 {
    329  1.1    fvdl 	address			0x00d
    330  1.1    fvdl 	access_mode RO
    331  1.2    fvdl 	field	OVERRUN		0x80
    332  1.6  andvar 	field	SHVALID		0x40	/* Shadow Layer non-zero */
    333  1.2    fvdl 	field	EXP_ACTIVE	0x10	/* SCSI Expander Active */
    334  1.2    fvdl 	field	CRCVALERR	0x08	/* CRC doesn't match (U3 only) */
    335  1.2    fvdl 	field	CRCENDERR	0x04	/* No terminal CRC packet (U3 only) */
    336  1.2    fvdl 	field	CRCREQERR	0x02	/* Illegal CRC packet req (U3 only) */
    337  1.2    fvdl 	field	DUAL_EDGE_ERR	0x01	/* Incorrect data phase (U3 only) */
    338  1.1    fvdl 	mask	SFCNT		0x1f
    339  1.1    fvdl }
    340  1.1    fvdl 
    341  1.1    fvdl /*
    342  1.1    fvdl  * SCSI Status 3 (p. 3-26)
    343  1.1    fvdl  */
    344  1.1    fvdl register SSTAT3 {
    345  1.1    fvdl 	address			0x00e
    346  1.1    fvdl 	access_mode RO
    347  1.1    fvdl 	mask	SCSICNT		0xf0
    348  1.1    fvdl 	mask	OFFCNT		0x0f
    349  1.2    fvdl 	mask	U2OFFCNT	0x7f
    350  1.1    fvdl }
    351  1.1    fvdl 
    352  1.1    fvdl /*
    353  1.1    fvdl  * SCSI ID for the aic7890/91 chips
    354  1.1    fvdl  */
    355  1.1    fvdl register SCSIID_ULTRA2 {
    356  1.1    fvdl 	address			0x00f
    357  1.1    fvdl 	access_mode RW
    358  1.1    fvdl 	mask	TID		0xf0		/* Target ID mask */
    359  1.1    fvdl 	mask	OID		0x0f		/* Our ID mask */
    360  1.1    fvdl }
    361  1.1    fvdl 
    362  1.1    fvdl /*
    363  1.1    fvdl  * SCSI Interrupt Mode 1 (p. 3-28)
    364  1.1    fvdl  * Setting any bit will enable the corresponding function
    365  1.1    fvdl  * in SIMODE0 to interrupt via the IRQ pin.
    366  1.1    fvdl  */
    367  1.1    fvdl register SIMODE0 {
    368  1.1    fvdl 	address			0x010
    369  1.1    fvdl 	access_mode RW
    370  1.2    fvdl 	field	ENSELDO		0x40
    371  1.2    fvdl 	field	ENSELDI		0x20
    372  1.2    fvdl 	field	ENSELINGO	0x10
    373  1.2    fvdl 	field	ENSWRAP		0x08
    374  1.8  andvar 	field	ENIOERR		0x08	/* LVD Transceiver mode changes */
    375  1.2    fvdl 	field	ENSDONE		0x04
    376  1.2    fvdl 	field	ENSPIORDY	0x02
    377  1.2    fvdl 	field	ENDMADONE	0x01
    378  1.1    fvdl }
    379  1.1    fvdl 
    380  1.1    fvdl /*
    381  1.1    fvdl  * SCSI Interrupt Mode 1 (pp. 3-28,29)
    382  1.1    fvdl  * Setting any bit will enable the corresponding function
    383  1.1    fvdl  * in SIMODE1 to interrupt via the IRQ pin.
    384  1.1    fvdl  */
    385  1.1    fvdl register SIMODE1 {
    386  1.1    fvdl 	address			0x011
    387  1.1    fvdl 	access_mode RW
    388  1.2    fvdl 	field	ENSELTIMO	0x80
    389  1.2    fvdl 	field	ENATNTARG	0x40
    390  1.2    fvdl 	field	ENSCSIRST	0x20
    391  1.2    fvdl 	field	ENPHASEMIS	0x10
    392  1.2    fvdl 	field	ENBUSFREE	0x08
    393  1.2    fvdl 	field	ENSCSIPERR	0x04
    394  1.2    fvdl 	field	ENPHASECHG	0x02
    395  1.2    fvdl 	field	ENREQINIT	0x01
    396  1.1    fvdl }
    397  1.1    fvdl 
    398  1.1    fvdl /*
    399  1.1    fvdl  * SCSI Data Bus (High) (p. 3-29)
    400  1.1    fvdl  * This register reads data on the SCSI Data bus directly.
    401  1.1    fvdl  */
    402  1.1    fvdl register SCSIBUSL {
    403  1.1    fvdl 	address			0x012
    404  1.2    fvdl 	access_mode RW
    405  1.1    fvdl }
    406  1.1    fvdl 
    407  1.1    fvdl register SCSIBUSH {
    408  1.1    fvdl 	address			0x013
    409  1.2    fvdl 	access_mode RW
    410  1.1    fvdl }
    411  1.1    fvdl 
    412  1.1    fvdl /*
    413  1.1    fvdl  * SCSI/Host Address (p. 3-30)
    414  1.1    fvdl  * These registers hold the host address for the byte about to be
    415  1.1    fvdl  * transferred on the SCSI bus.  They are counted up in the same
    416  1.1    fvdl  * manner as STCNT is counted down.  SHADDR should always be used
    417  1.1    fvdl  * to determine the address of the last byte transferred since HADDR
    418  1.1    fvdl  * can be skewed by write ahead.
    419  1.1    fvdl  */
    420  1.1    fvdl register SHADDR {
    421  1.1    fvdl 	address			0x014
    422  1.1    fvdl 	size	4
    423  1.1    fvdl 	access_mode RO
    424  1.1    fvdl }
    425  1.1    fvdl 
    426  1.1    fvdl /*
    427  1.1    fvdl  * Selection Timeout Timer (p. 3-30)
    428  1.1    fvdl  */
    429  1.1    fvdl register SELTIMER {
    430  1.1    fvdl 	address			0x018
    431  1.1    fvdl 	access_mode RW
    432  1.2    fvdl 	field	STAGE6		0x20
    433  1.2    fvdl 	field	STAGE5		0x10
    434  1.2    fvdl 	field	STAGE4		0x08
    435  1.2    fvdl 	field	STAGE3		0x04
    436  1.2    fvdl 	field	STAGE2		0x02
    437  1.2    fvdl 	field	STAGE1		0x01
    438  1.1    fvdl 	alias	TARGIDIN
    439  1.1    fvdl }
    440  1.1    fvdl 
    441  1.1    fvdl /*
    442  1.1    fvdl  * Selection/Reselection ID (p. 3-31)
    443  1.1    fvdl  * Upper four bits are the device id.  The ONEBIT is set when the re/selecting
    444  1.1    fvdl  * device did not set its own ID.
    445  1.1    fvdl  */
    446  1.1    fvdl register SELID {
    447  1.1    fvdl 	address			0x019
    448  1.1    fvdl 	access_mode RW
    449  1.1    fvdl 	mask	SELID_MASK	0xf0
    450  1.2    fvdl 	field	ONEBIT		0x08
    451  1.1    fvdl }
    452  1.1    fvdl 
    453  1.1    fvdl register SCAMCTL {
    454  1.1    fvdl 	address			0x01a
    455  1.1    fvdl 	access_mode RW
    456  1.2    fvdl 	field	ENSCAMSELO	0x80
    457  1.2    fvdl 	field	CLRSCAMSELID	0x40
    458  1.2    fvdl 	field	ALTSTIM		0x20
    459  1.2    fvdl 	field	DFLTTID		0x10
    460  1.1    fvdl 	mask	SCAMLVL		0x03
    461  1.1    fvdl }
    462  1.1    fvdl 
    463  1.1    fvdl /*
    464  1.1    fvdl  * Target Mode Selecting in ID bitmask (aic7890/91/96/97)
    465  1.1    fvdl  */
    466  1.1    fvdl register TARGID {
    467  1.1    fvdl 	address			0x01b
    468  1.1    fvdl 	size			2
    469  1.1    fvdl 	access_mode RW
    470  1.1    fvdl }
    471  1.1    fvdl 
    472  1.1    fvdl /*
    473  1.7  andvar  * Serial Port I/O Capability register (p. 4-95 aic7860 Data Book)
    474  1.1    fvdl  * Indicates if external logic has been attached to the chip to
    475  1.1    fvdl  * perform the tasks of accessing a serial eeprom, testing termination
    476  1.1    fvdl  * strength, and performing cable detection.  On the aic7860, most of
    477  1.1    fvdl  * these features are handled on chip, but on the aic7855 an attached
    478  1.1    fvdl  * aic3800 does the grunt work.
    479  1.1    fvdl  */
    480  1.1    fvdl register SPIOCAP {
    481  1.1    fvdl 	address			0x01b
    482  1.1    fvdl 	access_mode RW
    483  1.2    fvdl 	field	SOFT1		0x80
    484  1.2    fvdl 	field	SOFT0		0x40
    485  1.3   perry 	field	SOFTCMDEN	0x20
    486  1.2    fvdl 	field	EXT_BRDCTL	0x10	/* External Board control */
    487  1.2    fvdl 	field	SEEPROM		0x08	/* External serial eeprom logic */
    488  1.2    fvdl 	field	EEPROM		0x04	/* Writable external BIOS ROM */
    489  1.2    fvdl 	field	ROM		0x02	/* Logic for accessing external ROM */
    490  1.2    fvdl 	field	SSPIOCPS	0x01	/* Termination and cable detection */
    491  1.1    fvdl }
    492  1.1    fvdl 
    493  1.1    fvdl register BRDCTL	{
    494  1.1    fvdl 	address			0x01d
    495  1.2    fvdl 	field	BRDDAT7		0x80
    496  1.2    fvdl 	field	BRDDAT6		0x40
    497  1.2    fvdl 	field	BRDDAT5		0x20
    498  1.2    fvdl 	field	BRDSTB		0x10
    499  1.2    fvdl 	field	BRDCS		0x08
    500  1.2    fvdl 	field	BRDRW		0x04
    501  1.2    fvdl 	field	BRDCTL1		0x02
    502  1.2    fvdl 	field	BRDCTL0		0x01
    503  1.1    fvdl 	/* 7890 Definitions */
    504  1.2    fvdl 	field	BRDDAT4		0x10
    505  1.2    fvdl 	field	BRDDAT3		0x08
    506  1.2    fvdl 	field	BRDDAT2		0x04
    507  1.2    fvdl 	field	BRDRW_ULTRA2	0x02
    508  1.2    fvdl 	field	BRDSTB_ULTRA2	0x01
    509  1.1    fvdl }
    510  1.1    fvdl 
    511  1.1    fvdl /*
    512  1.1    fvdl  * Serial EEPROM Control (p. 4-92 in 7870 Databook)
    513  1.1    fvdl  * Controls the reading and writing of an external serial 1-bit
    514  1.1    fvdl  * EEPROM Device.  In order to access the serial EEPROM, you must
    515  1.1    fvdl  * first set the SEEMS bit that generates a request to the memory
    516  1.1    fvdl  * port for access to the serial EEPROM device.  When the memory
    517  1.1    fvdl  * port is not busy servicing another request, it reconfigures
    518  1.1    fvdl  * to allow access to the serial EEPROM.  When this happens, SEERDY
    519  1.1    fvdl  * gets set high to verify that the memory port access has been
    520  1.3   perry  * granted.
    521  1.1    fvdl  *
    522  1.3   perry  * After successful arbitration for the memory port, the SEECS bit of
    523  1.3   perry  * the SEECTL register is connected to the chip select.  The SEECK,
    524  1.3   perry  * SEEDO, and SEEDI are connected to the clock, data out, and data in
    525  1.3   perry  * lines respectively.  The SEERDY bit of SEECTL is useful in that it
    526  1.3   perry  * gives us an 800 nsec timer.  After a write to the SEECTL register,
    527  1.3   perry  * the SEERDY goes high 800 nsec later.  The one exception to this is
    528  1.3   perry  * when we first request access to the memory port.  The SEERDY goes
    529  1.3   perry  * high to signify that access has been granted and, for this case, has
    530  1.1    fvdl  * no implied timing.
    531  1.1    fvdl  *
    532  1.3   perry  * See 93cx6.c for detailed information on the protocol necessary to
    533  1.1    fvdl  * read the serial EEPROM.
    534  1.1    fvdl  */
    535  1.1    fvdl register SEECTL {
    536  1.1    fvdl 	address			0x01e
    537  1.2    fvdl 	field	EXTARBACK	0x80
    538  1.2    fvdl 	field	EXTARBREQ	0x40
    539  1.2    fvdl 	field	SEEMS		0x20
    540  1.2    fvdl 	field	SEERDY		0x10
    541  1.2    fvdl 	field	SEECS		0x08
    542  1.2    fvdl 	field	SEECK		0x04
    543  1.2    fvdl 	field	SEEDO		0x02
    544  1.2    fvdl 	field	SEEDI		0x01
    545  1.1    fvdl }
    546  1.1    fvdl /*
    547  1.1    fvdl  * SCSI Block Control (p. 3-32)
    548  1.1    fvdl  * Controls Bus type and channel selection.  In a twin channel configuration
    549  1.1    fvdl  * addresses 0x00-0x1e are gated to the appropriate channel based on this
    550  1.1    fvdl  * register.  SELWIDE allows for the coexistence of 8bit and 16bit devices
    551  1.1    fvdl  * on a wide bus.
    552  1.1    fvdl  */
    553  1.1    fvdl register SBLKCTL {
    554  1.1    fvdl 	address			0x01f
    555  1.1    fvdl 	access_mode RW
    556  1.2    fvdl 	field	DIAGLEDEN	0x80	/* Aic78X0 only */
    557  1.2    fvdl 	field	DIAGLEDON	0x40	/* Aic78X0 only */
    558  1.2    fvdl 	field	AUTOFLUSHDIS	0x20
    559  1.2    fvdl 	field	SELBUSB		0x08
    560  1.2    fvdl 	field	ENAB40		0x08	/* LVD transceiver active */
    561  1.2    fvdl 	field	ENAB20		0x04	/* SE/HVD transceiver active */
    562  1.2    fvdl 	field	SELWIDE		0x02
    563  1.2    fvdl 	field	XCVR		0x01	/* External transceiver active */
    564  1.1    fvdl }
    565  1.1    fvdl 
    566  1.1    fvdl /*
    567  1.1    fvdl  * Sequencer Control (p. 3-33)
    568  1.1    fvdl  * Error detection mode and speed configuration
    569  1.1    fvdl  */
    570  1.1    fvdl register SEQCTL {
    571  1.1    fvdl 	address			0x060
    572  1.1    fvdl 	access_mode RW
    573  1.2    fvdl 	field	PERRORDIS	0x80
    574  1.2    fvdl 	field	PAUSEDIS	0x40
    575  1.2    fvdl 	field	FAILDIS		0x20
    576  1.2    fvdl 	field	FASTMODE	0x10
    577  1.2    fvdl 	field	BRKADRINTEN	0x08
    578  1.2    fvdl 	field	STEP		0x04
    579  1.2    fvdl 	field	SEQRESET	0x02
    580  1.2    fvdl 	field	LOADRAM		0x01
    581  1.1    fvdl }
    582  1.1    fvdl 
    583  1.1    fvdl /*
    584  1.1    fvdl  * Sequencer RAM Data (p. 3-34)
    585  1.1    fvdl  * Single byte window into the Scratch Ram area starting at the address
    586  1.1    fvdl  * specified by SEQADDR0 and SEQADDR1.  To write a full word, simply write
    587  1.1    fvdl  * four bytes in succession.  The SEQADDRs will increment after the most
    588  1.1    fvdl  * significant byte is written
    589  1.1    fvdl  */
    590  1.1    fvdl register SEQRAM {
    591  1.1    fvdl 	address			0x061
    592  1.1    fvdl 	access_mode RW
    593  1.1    fvdl }
    594  1.1    fvdl 
    595  1.1    fvdl /*
    596  1.1    fvdl  * Sequencer Address Registers (p. 3-35)
    597  1.1    fvdl  * Only the first bit of SEQADDR1 holds addressing information
    598  1.1    fvdl  */
    599  1.1    fvdl register SEQADDR0 {
    600  1.1    fvdl 	address			0x062
    601  1.1    fvdl 	access_mode RW
    602  1.1    fvdl }
    603  1.1    fvdl 
    604  1.1    fvdl register SEQADDR1 {
    605  1.1    fvdl 	address			0x063
    606  1.1    fvdl 	access_mode RW
    607  1.1    fvdl 	mask	SEQADDR1_MASK	0x01
    608  1.1    fvdl }
    609  1.1    fvdl 
    610  1.1    fvdl /*
    611  1.1    fvdl  * Accumulator
    612  1.1    fvdl  * We cheat by passing arguments in the Accumulator up to the kernel driver
    613  1.1    fvdl  */
    614  1.1    fvdl register ACCUM {
    615  1.1    fvdl 	address			0x064
    616  1.1    fvdl 	access_mode RW
    617  1.1    fvdl 	accumulator
    618  1.1    fvdl }
    619  1.1    fvdl 
    620  1.1    fvdl register SINDEX	{
    621  1.1    fvdl 	address			0x065
    622  1.1    fvdl 	access_mode RW
    623  1.1    fvdl 	sindex
    624  1.1    fvdl }
    625  1.1    fvdl 
    626  1.1    fvdl register DINDEX {
    627  1.1    fvdl 	address			0x066
    628  1.1    fvdl 	access_mode RW
    629  1.1    fvdl }
    630  1.1    fvdl 
    631  1.1    fvdl register ALLONES {
    632  1.1    fvdl 	address			0x069
    633  1.1    fvdl 	access_mode RO
    634  1.1    fvdl 	allones
    635  1.1    fvdl }
    636  1.1    fvdl 
    637  1.1    fvdl register ALLZEROS {
    638  1.1    fvdl 	address			0x06a
    639  1.1    fvdl 	access_mode RO
    640  1.1    fvdl 	allzeros
    641  1.1    fvdl }
    642  1.1    fvdl 
    643  1.1    fvdl register NONE {
    644  1.1    fvdl 	address			0x06a
    645  1.1    fvdl 	access_mode WO
    646  1.1    fvdl 	none
    647  1.1    fvdl }
    648  1.1    fvdl 
    649  1.1    fvdl register FLAGS {
    650  1.1    fvdl 	address			0x06b
    651  1.1    fvdl 	access_mode RO
    652  1.2    fvdl 	field	ZERO		0x02
    653  1.2    fvdl 	field	CARRY		0x01
    654  1.1    fvdl }
    655  1.1    fvdl 
    656  1.1    fvdl register SINDIR	{
    657  1.1    fvdl 	address			0x06c
    658  1.1    fvdl 	access_mode RO
    659  1.1    fvdl }
    660  1.1    fvdl 
    661  1.1    fvdl register DINDIR	 {
    662  1.1    fvdl 	address			0x06d
    663  1.1    fvdl 	access_mode WO
    664  1.1    fvdl }
    665  1.1    fvdl 
    666  1.1    fvdl register FUNCTION1 {
    667  1.1    fvdl 	address			0x06e
    668  1.1    fvdl 	access_mode RW
    669  1.1    fvdl }
    670  1.1    fvdl 
    671  1.1    fvdl register STACK {
    672  1.1    fvdl 	address			0x06f
    673  1.1    fvdl 	access_mode RO
    674  1.1    fvdl }
    675  1.1    fvdl 
    676  1.2    fvdl const	STACK_SIZE	4
    677  1.2    fvdl 
    678  1.1    fvdl /*
    679  1.1    fvdl  * Board Control (p. 3-43)
    680  1.1    fvdl  */
    681  1.1    fvdl register BCTL {
    682  1.1    fvdl 	address			0x084
    683  1.1    fvdl 	access_mode RW
    684  1.2    fvdl 	field	ACE		0x08
    685  1.2    fvdl 	field	ENABLE		0x01
    686  1.1    fvdl }
    687  1.1    fvdl 
    688  1.1    fvdl /*
    689  1.1    fvdl  * On the aic78X0 chips, Board Control is replaced by the DSCommand
    690  1.1    fvdl  * register (p. 4-64)
    691  1.1    fvdl  */
    692  1.1    fvdl register DSCOMMAND0 {
    693  1.1    fvdl 	address			0x084
    694  1.1    fvdl 	access_mode RW
    695  1.2    fvdl 	field	CACHETHEN	0x80	/* Cache Threshold enable */
    696  1.2    fvdl 	field	DPARCKEN	0x40	/* Data Parity Check Enable */
    697  1.2    fvdl 	field	MPARCKEN	0x20	/* Memory Parity Check Enable */
    698  1.2    fvdl 	field	EXTREQLCK	0x10	/* External Request Lock */
    699  1.1    fvdl 	/* aic7890/91/96/97 only */
    700  1.2    fvdl 	field	INTSCBRAMSEL	0x08	/* Internal SCB RAM Select */
    701  1.2    fvdl 	field	RAMPS		0x04	/* External SCB RAM Present */
    702  1.2    fvdl 	field	USCBSIZE32	0x02	/* Use 32byte SCB Page Size */
    703  1.2    fvdl 	field	CIOPARCKEN	0x01	/* Internal bus parity error enable */
    704  1.2    fvdl }
    705  1.2    fvdl 
    706  1.2    fvdl register DSCOMMAND1 {
    707  1.2    fvdl 	address			0x085
    708  1.2    fvdl 	access_mode RW
    709  1.2    fvdl 	mask	DSLATT		0xfc	/* PCI latency timer (non-ultra2) */
    710  1.2    fvdl 	field	HADDLDSEL1	0x02	/* Host Address Load Select Bits */
    711  1.2    fvdl 	field	HADDLDSEL0	0x01
    712  1.1    fvdl }
    713  1.1    fvdl 
    714  1.1    fvdl /*
    715  1.2    fvdl  * Bus On/Off Time (p. 3-44) aic7770 only
    716  1.1    fvdl  */
    717  1.1    fvdl register BUSTIME {
    718  1.1    fvdl 	address			0x085
    719  1.1    fvdl 	access_mode RW
    720  1.1    fvdl 	mask	BOFF		0xf0
    721  1.1    fvdl 	mask	BON		0x0f
    722  1.1    fvdl }
    723  1.1    fvdl 
    724  1.1    fvdl /*
    725  1.1    fvdl  * Bus Speed (p. 3-45) aic7770 only
    726  1.1    fvdl  */
    727  1.1    fvdl register BUSSPD {
    728  1.1    fvdl 	address			0x086
    729  1.1    fvdl 	access_mode RW
    730  1.1    fvdl 	mask	DFTHRSH		0xc0
    731  1.1    fvdl 	mask	STBOFF		0x38
    732  1.1    fvdl 	mask	STBON		0x07
    733  1.1    fvdl 	mask	DFTHRSH_100	0xc0
    734  1.2    fvdl 	mask	DFTHRSH_75	0x80
    735  1.1    fvdl }
    736  1.1    fvdl 
    737  1.1    fvdl /* aic7850/55/60/70/80/95 only */
    738  1.1    fvdl register DSPCISTATUS {
    739  1.1    fvdl 	address			0x086
    740  1.1    fvdl 	mask	DFTHRSH_100	0xc0
    741  1.1    fvdl }
    742  1.1    fvdl 
    743  1.1    fvdl /* aic7890/91/96/97 only */
    744  1.1    fvdl register HS_MAILBOX {
    745  1.1    fvdl 	address			0x086
    746  1.1    fvdl 	mask	HOST_MAILBOX	0xF0
    747  1.1    fvdl 	mask	SEQ_MAILBOX	0x0F
    748  1.2    fvdl 	mask	HOST_TQINPOS	0x80	/* Boundary at either 0 or 128 */
    749  1.1    fvdl }
    750  1.1    fvdl 
    751  1.1    fvdl const	HOST_MAILBOX_SHIFT	4
    752  1.1    fvdl const	SEQ_MAILBOX_SHIFT	0
    753  1.1    fvdl 
    754  1.1    fvdl /*
    755  1.1    fvdl  * Host Control (p. 3-47) R/W
    756  1.1    fvdl  * Overall host control of the device.
    757  1.1    fvdl  */
    758  1.1    fvdl register HCNTRL {
    759  1.1    fvdl 	address			0x087
    760  1.1    fvdl 	access_mode RW
    761  1.2    fvdl 	field	POWRDN		0x40
    762  1.2    fvdl 	field	SWINT		0x10
    763  1.2    fvdl 	field	IRQMS		0x08
    764  1.2    fvdl 	field	PAUSE		0x04
    765  1.2    fvdl 	field	INTEN		0x02
    766  1.2    fvdl 	field	CHIPRST		0x01
    767  1.2    fvdl 	field	CHIPRSTACK	0x01
    768  1.1    fvdl }
    769  1.1    fvdl 
    770  1.1    fvdl /*
    771  1.1    fvdl  * Host Address (p. 3-48)
    772  1.1    fvdl  * This register contains the address of the byte about
    773  1.1    fvdl  * to be transferred across the host bus.
    774  1.1    fvdl  */
    775  1.1    fvdl register HADDR {
    776  1.1    fvdl 	address			0x088
    777  1.1    fvdl 	size	4
    778  1.1    fvdl 	access_mode RW
    779  1.1    fvdl }
    780  1.1    fvdl 
    781  1.1    fvdl register HCNT {
    782  1.1    fvdl 	address			0x08c
    783  1.1    fvdl 	size	3
    784  1.1    fvdl 	access_mode RW
    785  1.1    fvdl }
    786  1.1    fvdl 
    787  1.1    fvdl /*
    788  1.1    fvdl  * SCB Pointer (p. 3-49)
    789  1.2    fvdl  * Gate one of the SCBs into the SCBARRAY window.
    790  1.1    fvdl  */
    791  1.1    fvdl register SCBPTR {
    792  1.1    fvdl 	address			0x090
    793  1.1    fvdl 	access_mode RW
    794  1.1    fvdl }
    795  1.1    fvdl 
    796  1.1    fvdl /*
    797  1.1    fvdl  * Interrupt Status (p. 3-50)
    798  1.1    fvdl  * Status for system interrupts
    799  1.1    fvdl  */
    800  1.1    fvdl register INTSTAT {
    801  1.1    fvdl 	address			0x091
    802  1.1    fvdl 	access_mode RW
    803  1.2    fvdl 	field	BRKADRINT 0x08
    804  1.2    fvdl 	field	SCSIINT	  0x04
    805  1.2    fvdl 	field	CMDCMPLT  0x02
    806  1.2    fvdl 	field	SEQINT    0x01
    807  1.1    fvdl 	mask	BAD_PHASE	SEQINT		/* unknown scsi bus phase */
    808  1.1    fvdl 	mask	SEND_REJECT	0x10|SEQINT	/* sending a message reject */
    809  1.3   perry 	mask	PROTO_VIOLATION	0x20|SEQINT	/* SCSI protocol violation */
    810  1.1    fvdl 	mask	NO_MATCH	0x30|SEQINT	/* no cmd match for reconnect */
    811  1.2    fvdl 	mask	IGN_WIDE_RES	0x40|SEQINT	/* Complex IGN Wide Res Msg */
    812  1.2    fvdl 	mask	PDATA_REINIT	0x50|SEQINT	/*
    813  1.2    fvdl 						 * Returned to data phase
    814  1.2    fvdl 						 * that requires data
    815  1.2    fvdl 						 * transfer pointers to be
    816  1.2    fvdl 						 * recalculated from the
    817  1.2    fvdl 						 * transfer residual.
    818  1.2    fvdl 						 */
    819  1.2    fvdl 	mask	HOST_MSG_LOOP	0x60|SEQINT	/*
    820  1.1    fvdl 						 * The bus is ready for the
    821  1.1    fvdl 						 * host to perform another
    822  1.1    fvdl 						 * message transaction.  This
    823  1.1    fvdl 						 * mechanism is used for things
    824  1.1    fvdl 						 * like sync/wide negotiation
    825  1.1    fvdl 						 * that require a kernel based
    826  1.1    fvdl 						 * message state engine.
    827  1.1    fvdl 						 */
    828  1.2    fvdl 	mask	BAD_STATUS	0x70|SEQINT	/* Bad status from target */
    829  1.2    fvdl 	mask	PERR_DETECTED	0x80|SEQINT	/*
    830  1.1    fvdl 						 * Either the phase_lock
    831  1.1    fvdl 						 * or inb_next routine has
    832  1.1    fvdl 						 * noticed a parity error.
    833  1.1    fvdl 						 */
    834  1.2    fvdl 	mask	DATA_OVERRUN	0x90|SEQINT	/*
    835  1.1    fvdl 						 * Target attempted to write
    836  1.1    fvdl 						 * beyond the bounds of its
    837  1.1    fvdl 						 * command.
    838  1.1    fvdl 						 */
    839  1.2    fvdl 	mask	MKMSG_FAILED	0xa0|SEQINT	/*
    840  1.2    fvdl 						 * Target completed command
    841  1.2    fvdl 						 * without honoring our ATN
    842  1.3   perry 						 * request to issue a message.
    843  1.2    fvdl 						 */
    844  1.2    fvdl 	mask	MISSED_BUSFREE	0xb0|SEQINT	/*
    845  1.2    fvdl 						 * The sequencer never saw
    846  1.2    fvdl 						 * the bus go free after
    847  1.2    fvdl 						 * either a command complete
    848  1.2    fvdl 						 * or disconnect message.
    849  1.2    fvdl 						 */
    850  1.2    fvdl 	mask	SCB_MISMATCH	0xc0|SEQINT	/*
    851  1.2    fvdl 						 * Downloaded SCB's tag does
    852  1.2    fvdl 						 * not match the entry we
    853  1.2    fvdl 						 * intended to download.
    854  1.2    fvdl 						 */
    855  1.2    fvdl 	mask	NO_FREE_SCB	0xd0|SEQINT	/*
    856  1.2    fvdl 						 * get_free_or_disc_scb failed.
    857  1.2    fvdl 						 */
    858  1.2    fvdl 	mask	OUT_OF_RANGE	0xe0|SEQINT
    859  1.1    fvdl 
    860  1.1    fvdl 	mask	SEQINT_MASK	0xf0|SEQINT	/* SEQINT Status Codes */
    861  1.1    fvdl 	mask	INT_PEND  (BRKADRINT|SEQINT|SCSIINT|CMDCMPLT)
    862  1.1    fvdl }
    863  1.1    fvdl 
    864  1.1    fvdl /*
    865  1.1    fvdl  * Hard Error (p. 3-53)
    866  1.1    fvdl  * Reporting of catastrophic errors.  You usually cannot recover from
    867  1.1    fvdl  * these without a full board reset.
    868  1.1    fvdl  */
    869  1.1    fvdl register ERROR {
    870  1.1    fvdl 	address			0x092
    871  1.1    fvdl 	access_mode RO
    872  1.2    fvdl 	field	CIOPARERR	0x80	/* Ultra2 only */
    873  1.2    fvdl 	field	PCIERRSTAT	0x40	/* PCI only */
    874  1.2    fvdl 	field	MPARERR		0x20	/* PCI only */
    875  1.2    fvdl 	field	DPARERR		0x10	/* PCI only */
    876  1.2    fvdl 	field	SQPARERR	0x08
    877  1.2    fvdl 	field	ILLOPCODE	0x04
    878  1.2    fvdl 	field	ILLSADDR	0x02
    879  1.2    fvdl 	field	ILLHADDR	0x01
    880  1.1    fvdl }
    881  1.1    fvdl 
    882  1.1    fvdl /*
    883  1.1    fvdl  * Clear Interrupt Status (p. 3-52)
    884  1.1    fvdl  */
    885  1.1    fvdl register CLRINT {
    886  1.1    fvdl 	address			0x092
    887  1.1    fvdl 	access_mode WO
    888  1.2    fvdl 	field	CLRPARERR	0x10	/* PCI only */
    889  1.2    fvdl 	field	CLRBRKADRINT	0x08
    890  1.2    fvdl 	field	CLRSCSIINT      0x04
    891  1.2    fvdl 	field	CLRCMDINT 	0x02
    892  1.2    fvdl 	field	CLRSEQINT 	0x01
    893  1.1    fvdl }
    894  1.1    fvdl 
    895  1.1    fvdl register DFCNTRL {
    896  1.1    fvdl 	address			0x093
    897  1.1    fvdl 	access_mode RW
    898  1.2    fvdl 	field	PRELOADEN	0x80	/* aic7890 only */
    899  1.2    fvdl 	field	WIDEODD		0x40
    900  1.2    fvdl 	field	SCSIEN		0x20
    901  1.2    fvdl 	field	SDMAEN		0x10
    902  1.2    fvdl 	field	SDMAENACK	0x10
    903  1.2    fvdl 	field	HDMAEN		0x08
    904  1.2    fvdl 	field	HDMAENACK	0x08
    905  1.2    fvdl 	field	DIRECTION	0x04
    906  1.2    fvdl 	field	FIFOFLUSH	0x02
    907  1.2    fvdl 	field	FIFORESET	0x01
    908  1.1    fvdl }
    909  1.1    fvdl 
    910  1.1    fvdl register DFSTATUS {
    911  1.1    fvdl 	address			0x094
    912  1.1    fvdl 	access_mode RO
    913  1.2    fvdl 	field	PRELOAD_AVAIL	0x80
    914  1.2    fvdl 	field	DFCACHETH	0x40
    915  1.2    fvdl 	field	FIFOQWDEMP	0x20
    916  1.2    fvdl 	field	MREQPEND	0x10
    917  1.2    fvdl 	field	HDONE		0x08
    918  1.2    fvdl 	field	DFTHRESH	0x04
    919  1.2    fvdl 	field	FIFOFULL	0x02
    920  1.2    fvdl 	field	FIFOEMP		0x01
    921  1.1    fvdl }
    922  1.1    fvdl 
    923  1.1    fvdl register DFWADDR {
    924  1.1    fvdl 	address			0x95
    925  1.1    fvdl 	access_mode RW
    926  1.1    fvdl }
    927  1.1    fvdl 
    928  1.1    fvdl register DFRADDR {
    929  1.1    fvdl 	address			0x97
    930  1.1    fvdl 	access_mode RW
    931  1.1    fvdl }
    932  1.1    fvdl 
    933  1.1    fvdl register DFDAT {
    934  1.1    fvdl 	address			0x099
    935  1.1    fvdl 	access_mode RW
    936  1.1    fvdl }
    937  1.1    fvdl 
    938  1.1    fvdl /*
    939  1.1    fvdl  * SCB Auto Increment (p. 3-59)
    940  1.1    fvdl  * Byte offset into the SCB Array and an optional bit to allow auto
    941  1.1    fvdl  * incrementing of the address during download and upload operations
    942  1.1    fvdl  */
    943  1.1    fvdl register SCBCNT {
    944  1.1    fvdl 	address			0x09a
    945  1.1    fvdl 	access_mode RW
    946  1.2    fvdl 	field	SCBAUTO		0x80
    947  1.1    fvdl 	mask	SCBCNT_MASK	0x1f
    948  1.1    fvdl }
    949  1.1    fvdl 
    950  1.1    fvdl /*
    951  1.1    fvdl  * Queue In FIFO (p. 3-60)
    952  1.6  andvar  * Input queue for queued SCBs (commands that the sequencer has yet to start)
    953  1.1    fvdl  */
    954  1.1    fvdl register QINFIFO {
    955  1.1    fvdl 	address			0x09b
    956  1.1    fvdl 	access_mode RW
    957  1.1    fvdl }
    958  1.1    fvdl 
    959  1.1    fvdl /*
    960  1.1    fvdl  * Queue In Count (p. 3-60)
    961  1.1    fvdl  * Number of queued SCBs
    962  1.1    fvdl  */
    963  1.1    fvdl register QINCNT	{
    964  1.1    fvdl 	address			0x09c
    965  1.1    fvdl 	access_mode RO
    966  1.1    fvdl }
    967  1.1    fvdl 
    968  1.1    fvdl /*
    969  1.1    fvdl  * Queue Out FIFO (p. 3-61)
    970  1.1    fvdl  * Queue of SCBs that have completed and await the host
    971  1.1    fvdl  */
    972  1.1    fvdl register QOUTFIFO {
    973  1.1    fvdl 	address			0x09d
    974  1.1    fvdl 	access_mode WO
    975  1.1    fvdl }
    976  1.1    fvdl 
    977  1.1    fvdl register CRCCONTROL1 {
    978  1.1    fvdl 	address			0x09d
    979  1.1    fvdl 	access_mode RW
    980  1.2    fvdl 	field	CRCONSEEN		0x80
    981  1.2    fvdl 	field	CRCVALCHKEN		0x40
    982  1.2    fvdl 	field	CRCENDCHKEN		0x20
    983  1.2    fvdl 	field	CRCREQCHKEN		0x10
    984  1.2    fvdl 	field	TARGCRCENDEN		0x08
    985  1.2    fvdl 	field	TARGCRCCNTEN		0x04
    986  1.1    fvdl }
    987  1.1    fvdl 
    988  1.1    fvdl 
    989  1.1    fvdl /*
    990  1.1    fvdl  * Queue Out Count (p. 3-61)
    991  1.1    fvdl  * Number of queued SCBs in the Out FIFO
    992  1.1    fvdl  */
    993  1.1    fvdl register QOUTCNT {
    994  1.1    fvdl 	address			0x09e
    995  1.1    fvdl 	access_mode RO
    996  1.1    fvdl }
    997  1.1    fvdl 
    998  1.1    fvdl register SCSIPHASE {
    999  1.1    fvdl 	address			0x09e
   1000  1.1    fvdl 	access_mode RO
   1001  1.2    fvdl 	field	STATUS_PHASE	0x20
   1002  1.2    fvdl 	field	COMMAND_PHASE	0x10
   1003  1.2    fvdl 	field	MSG_IN_PHASE	0x08
   1004  1.2    fvdl 	field	MSG_OUT_PHASE	0x04
   1005  1.2    fvdl 	field	DATA_IN_PHASE	0x02
   1006  1.2    fvdl 	field	DATA_OUT_PHASE	0x01
   1007  1.2    fvdl 	mask	DATA_PHASE_MASK	0x03
   1008  1.1    fvdl }
   1009  1.1    fvdl 
   1010  1.1    fvdl /*
   1011  1.1    fvdl  * Special Function
   1012  1.1    fvdl  */
   1013  1.1    fvdl register SFUNCT {
   1014  1.1    fvdl 	address			0x09f
   1015  1.1    fvdl 	access_mode RW
   1016  1.2    fvdl 	field	ALT_MODE	0x80
   1017  1.1    fvdl }
   1018  1.1    fvdl 
   1019  1.1    fvdl /*
   1020  1.1    fvdl  * SCB Definition (p. 5-4)
   1021  1.1    fvdl  */
   1022  1.1    fvdl scb {
   1023  1.2    fvdl 	address		0x0a0
   1024  1.2    fvdl 	size		64
   1025  1.2    fvdl 
   1026  1.2    fvdl 	SCB_CDB_PTR {
   1027  1.2    fvdl 		size	4
   1028  1.2    fvdl 		alias	SCB_RESIDUAL_DATACNT
   1029  1.2    fvdl 		alias	SCB_CDB_STORE
   1030  1.2    fvdl 	}
   1031  1.2    fvdl 	SCB_RESIDUAL_SGPTR {
   1032  1.2    fvdl 		size	4
   1033  1.1    fvdl 	}
   1034  1.2    fvdl 	SCB_SCSI_STATUS {
   1035  1.1    fvdl 		size	1
   1036  1.1    fvdl 	}
   1037  1.2    fvdl 	SCB_TARGET_PHASES {
   1038  1.1    fvdl 		size	1
   1039  1.1    fvdl 	}
   1040  1.2    fvdl 	SCB_TARGET_DATA_DIR {
   1041  1.1    fvdl 		size	1
   1042  1.1    fvdl 	}
   1043  1.2    fvdl 	SCB_TARGET_ITAG {
   1044  1.1    fvdl 		size	1
   1045  1.1    fvdl 	}
   1046  1.1    fvdl 	SCB_DATAPTR {
   1047  1.1    fvdl 		size	4
   1048  1.1    fvdl 	}
   1049  1.1    fvdl 	SCB_DATACNT {
   1050  1.1    fvdl 		/*
   1051  1.2    fvdl 		 * The last byte is really the high address bits for
   1052  1.2    fvdl 		 * the data address.
   1053  1.1    fvdl 		 */
   1054  1.1    fvdl 		size	4
   1055  1.2    fvdl 		field	SG_LAST_SEG		0x80	/* In the fourth byte */
   1056  1.2    fvdl 		mask	SG_HIGH_ADDR_BITS	0x7F	/* In the fourth byte */
   1057  1.1    fvdl 	}
   1058  1.2    fvdl 	SCB_SGPTR {
   1059  1.1    fvdl 		size	4
   1060  1.2    fvdl 		field	SG_RESID_VALID	0x04	/* In the first byte */
   1061  1.2    fvdl 		field	SG_FULL_RESID	0x02	/* In the first byte */
   1062  1.2    fvdl 		field	SG_LIST_NULL	0x01	/* In the first byte */
   1063  1.1    fvdl 	}
   1064  1.2    fvdl 	SCB_CONTROL {
   1065  1.2    fvdl 		size	1
   1066  1.2    fvdl 		field	TARGET_SCB			0x80
   1067  1.2    fvdl 		field	STATUS_RCVD			0x80
   1068  1.2    fvdl 		field	DISCENB				0x40
   1069  1.2    fvdl 		field	TAG_ENB				0x20
   1070  1.2    fvdl 		field	MK_MESSAGE			0x10
   1071  1.2    fvdl 		field	ULTRAENB			0x08
   1072  1.2    fvdl 		field	DISCONNECTED			0x04
   1073  1.2    fvdl 		mask	SCB_TAG_TYPE			0x03
   1074  1.2    fvdl 	}
   1075  1.2    fvdl 	SCB_SCSIID {
   1076  1.2    fvdl 		size	1
   1077  1.2    fvdl 		field	TWIN_CHNLB			0x80
   1078  1.2    fvdl 		mask	TWIN_TID			0x70
   1079  1.2    fvdl 		mask	TID				0xf0
   1080  1.2    fvdl 		mask	OID				0x0f
   1081  1.2    fvdl 	}
   1082  1.2    fvdl 	SCB_LUN {
   1083  1.2    fvdl 		mask	LID				0xff
   1084  1.1    fvdl 		size	1
   1085  1.1    fvdl 	}
   1086  1.1    fvdl 	SCB_TAG {
   1087  1.1    fvdl 		size	1
   1088  1.1    fvdl 	}
   1089  1.2    fvdl 	SCB_CDB_LEN {
   1090  1.1    fvdl 		size	1
   1091  1.1    fvdl 	}
   1092  1.1    fvdl 	SCB_SCSIRATE {
   1093  1.1    fvdl 		size	1
   1094  1.1    fvdl 	}
   1095  1.1    fvdl 	SCB_SCSIOFFSET {
   1096  1.1    fvdl 		size	1
   1097  1.1    fvdl 	}
   1098  1.2    fvdl 	SCB_NEXT {
   1099  1.2    fvdl 		size	1
   1100  1.1    fvdl 	}
   1101  1.2    fvdl 	SCB_64_SPARE {
   1102  1.1    fvdl 		size	16
   1103  1.1    fvdl 	}
   1104  1.2    fvdl 	SCB_64_BTT {
   1105  1.2    fvdl 		size	16
   1106  1.1    fvdl 	}
   1107  1.1    fvdl }
   1108  1.1    fvdl 
   1109  1.2    fvdl const	SCB_UPLOAD_SIZE		32
   1110  1.2    fvdl const	SCB_DOWNLOAD_SIZE	32
   1111  1.2    fvdl const	SCB_DOWNLOAD_SIZE_64	48
   1112  1.1    fvdl 
   1113  1.1    fvdl const	SG_SIZEOF	0x08		/* sizeof(struct ahc_dma) */
   1114  1.1    fvdl 
   1115  1.1    fvdl /* --------------------- AHA-2840-only definitions -------------------- */
   1116  1.1    fvdl 
   1117  1.1    fvdl register SEECTL_2840 {
   1118  1.1    fvdl 	address			0x0c0
   1119  1.1    fvdl 	access_mode RW
   1120  1.2    fvdl 	field	CS_2840		0x04
   1121  1.2    fvdl 	field	CK_2840		0x02
   1122  1.2    fvdl 	field	DO_2840		0x01
   1123  1.1    fvdl }
   1124  1.1    fvdl 
   1125  1.1    fvdl register STATUS_2840 {
   1126  1.1    fvdl 	address			0x0c1
   1127  1.1    fvdl 	access_mode RW
   1128  1.2    fvdl 	field	EEPROM_TF	0x80
   1129  1.1    fvdl 	mask	BIOS_SEL	0x60
   1130  1.1    fvdl 	mask	ADSEL		0x1e
   1131  1.2    fvdl 	field	DI_2840		0x01
   1132  1.1    fvdl }
   1133  1.1    fvdl 
   1134  1.1    fvdl /* --------------------- AIC-7870-only definitions -------------------- */
   1135  1.1    fvdl 
   1136  1.1    fvdl register CCHADDR {
   1137  1.1    fvdl 	address			0x0E0
   1138  1.1    fvdl 	size 8
   1139  1.1    fvdl }
   1140  1.1    fvdl 
   1141  1.1    fvdl register CCHCNT {
   1142  1.1    fvdl 	address			0x0E8
   1143  1.1    fvdl }
   1144  1.1    fvdl 
   1145  1.1    fvdl register CCSGRAM {
   1146  1.1    fvdl 	address			0x0E9
   1147  1.1    fvdl }
   1148  1.1    fvdl 
   1149  1.1    fvdl register CCSGADDR {
   1150  1.1    fvdl 	address			0x0EA
   1151  1.1    fvdl }
   1152  1.1    fvdl 
   1153  1.1    fvdl register CCSGCTL {
   1154  1.1    fvdl 	address			0x0EB
   1155  1.2    fvdl 	field	CCSGDONE	0x80
   1156  1.2    fvdl 	field	CCSGEN		0x08
   1157  1.2    fvdl 	field	SG_FETCH_NEEDED 0x02	/* Bit used for software state */
   1158  1.2    fvdl 	field	CCSGRESET	0x01
   1159  1.1    fvdl }
   1160  1.1    fvdl 
   1161  1.1    fvdl register CCSCBCNT {
   1162  1.1    fvdl 	address			0xEF
   1163  1.1    fvdl }
   1164  1.1    fvdl 
   1165  1.1    fvdl register CCSCBCTL {
   1166  1.1    fvdl 	address			0x0EE
   1167  1.2    fvdl 	field	CCSCBDONE	0x80
   1168  1.2    fvdl 	field	ARRDONE		0x40	/* SCB Array prefetch done */
   1169  1.2    fvdl 	field	CCARREN		0x10
   1170  1.2    fvdl 	field	CCSCBEN		0x08
   1171  1.2    fvdl 	field	CCSCBDIR	0x04
   1172  1.2    fvdl 	field	CCSCBRESET	0x01
   1173  1.1    fvdl }
   1174  1.1    fvdl 
   1175  1.1    fvdl register CCSCBADDR {
   1176  1.1    fvdl 	address			0x0ED
   1177  1.1    fvdl }
   1178  1.1    fvdl 
   1179  1.1    fvdl register CCSCBRAM {
   1180  1.1    fvdl 	address			0xEC
   1181  1.1    fvdl }
   1182  1.1    fvdl 
   1183  1.1    fvdl /*
   1184  1.1    fvdl  * SCB bank address (7895/7896/97 only)
   1185  1.1    fvdl  */
   1186  1.1    fvdl register SCBBADDR {
   1187  1.1    fvdl 	address			0x0F0
   1188  1.1    fvdl 	access_mode RW
   1189  1.1    fvdl }
   1190  1.1    fvdl 
   1191  1.1    fvdl register CCSCBPTR {
   1192  1.1    fvdl 	address			0x0F1
   1193  1.1    fvdl }
   1194  1.1    fvdl 
   1195  1.1    fvdl register HNSCB_QOFF {
   1196  1.1    fvdl 	address			0x0F4
   1197  1.1    fvdl }
   1198  1.1    fvdl 
   1199  1.1    fvdl register SNSCB_QOFF {
   1200  1.1    fvdl 	address			0x0F6
   1201  1.1    fvdl }
   1202  1.1    fvdl 
   1203  1.1    fvdl register SDSCB_QOFF {
   1204  1.1    fvdl 	address			0x0F8
   1205  1.1    fvdl }
   1206  1.1    fvdl 
   1207  1.1    fvdl register QOFF_CTLSTA {
   1208  1.1    fvdl 	address			0x0FA
   1209  1.2    fvdl 	field	SCB_AVAIL	0x40
   1210  1.2    fvdl 	field	SNSCB_ROLLOVER	0x20
   1211  1.2    fvdl 	field	SDSCB_ROLLOVER	0x10
   1212  1.1    fvdl 	mask	SCB_QSIZE	0x07
   1213  1.1    fvdl 	mask	SCB_QSIZE_256	0x06
   1214  1.1    fvdl }
   1215  1.1    fvdl 
   1216  1.1    fvdl register DFF_THRSH {
   1217  1.1    fvdl 	address			0x0FB
   1218  1.1    fvdl 	mask	WR_DFTHRSH	0x70
   1219  1.1    fvdl 	mask	RD_DFTHRSH	0x07
   1220  1.1    fvdl 	mask	RD_DFTHRSH_MIN	0x00
   1221  1.1    fvdl 	mask	RD_DFTHRSH_25	0x01
   1222  1.1    fvdl 	mask	RD_DFTHRSH_50	0x02
   1223  1.1    fvdl 	mask	RD_DFTHRSH_63	0x03
   1224  1.1    fvdl 	mask	RD_DFTHRSH_75	0x04
   1225  1.1    fvdl 	mask	RD_DFTHRSH_85	0x05
   1226  1.1    fvdl 	mask	RD_DFTHRSH_90	0x06
   1227  1.1    fvdl 	mask	RD_DFTHRSH_MAX	0x07
   1228  1.1    fvdl 	mask	WR_DFTHRSH_MIN	0x00
   1229  1.1    fvdl 	mask	WR_DFTHRSH_25	0x10
   1230  1.1    fvdl 	mask	WR_DFTHRSH_50	0x20
   1231  1.1    fvdl 	mask	WR_DFTHRSH_63	0x30
   1232  1.1    fvdl 	mask	WR_DFTHRSH_75	0x40
   1233  1.1    fvdl 	mask	WR_DFTHRSH_85	0x50
   1234  1.1    fvdl 	mask	WR_DFTHRSH_90	0x60
   1235  1.1    fvdl 	mask	WR_DFTHRSH_MAX	0x70
   1236  1.1    fvdl }
   1237  1.1    fvdl 
   1238  1.2    fvdl register SG_CACHE_PRE {
   1239  1.2    fvdl 	access_mode WO
   1240  1.1    fvdl 	address			0x0fc
   1241  1.2    fvdl 	mask	SG_ADDR_MASK	0xf8
   1242  1.2    fvdl 	field	ODD_SEG		0x04
   1243  1.2    fvdl 	field	LAST_SEG	0x02
   1244  1.2    fvdl 	field	LAST_SEG_DONE	0x01
   1245  1.1    fvdl }
   1246  1.1    fvdl 
   1247  1.2    fvdl register SG_CACHE_SHADOW {
   1248  1.2    fvdl 	access_mode RO
   1249  1.2    fvdl 	address			0x0fc
   1250  1.2    fvdl 	mask	SG_ADDR_MASK	0xf8
   1251  1.2    fvdl 	field	ODD_SEG		0x04
   1252  1.2    fvdl 	field	LAST_SEG	0x02
   1253  1.2    fvdl 	field	LAST_SEG_DONE	0x01
   1254  1.2    fvdl }
   1255  1.1    fvdl /* ---------------------- Scratch RAM Offsets ------------------------- */
   1256  1.1    fvdl /* These offsets are either to values that are initialized by the board's
   1257  1.1    fvdl  * BIOS or are specified by the sequencer code.
   1258  1.1    fvdl  *
   1259  1.1    fvdl  * The host adapter card (at least the BIOS) uses 20-2f for SCSI
   1260  1.1    fvdl  * device information, 32-33 and 5a-5f as well. As it turns out, the
   1261  1.1    fvdl  * BIOS trashes 20-2f, writing the synchronous negotiation results
   1262  1.1    fvdl  * on top of the BIOS values, so we re-use those for our per-target
   1263  1.1    fvdl  * scratchspace (actually a value that can be copied directly into
   1264  1.1    fvdl  * SCSIRATE).  The kernel driver will enable synchronous negotiation
   1265  1.1    fvdl  * for all targets that have a value other than 0 in the lower four
   1266  1.1    fvdl  * bits of the target scratch space.  This should work regardless of
   1267  1.1    fvdl  * whether the bios has been installed.
   1268  1.1    fvdl  */
   1269  1.1    fvdl 
   1270  1.1    fvdl scratch_ram {
   1271  1.2    fvdl 	address		0x020
   1272  1.2    fvdl 	size		58
   1273  1.1    fvdl 
   1274  1.1    fvdl 	/*
   1275  1.1    fvdl 	 * 1 byte per target starting at this address for configuration values
   1276  1.1    fvdl 	 */
   1277  1.2    fvdl 	BUSY_TARGETS {
   1278  1.2    fvdl 		alias		TARG_SCSIRATE
   1279  1.1    fvdl 		size		16
   1280  1.1    fvdl 	}
   1281  1.1    fvdl 	/*
   1282  1.2    fvdl 	 * Bit vector of targets that have ULTRA enabled as set by
   1283  1.2    fvdl 	 * the BIOS.  The Sequencer relies on a per-SCB field to
   1284  1.2    fvdl 	 * control whether to enable Ultra transfers or not.  During
   1285  1.2    fvdl 	 * initialization, we read this field and reuse it for 2
   1286  1.2    fvdl 	 * entries in the busy target table.
   1287  1.1    fvdl 	 */
   1288  1.1    fvdl 	ULTRA_ENB {
   1289  1.2    fvdl 		alias		CMDSIZE_TABLE
   1290  1.1    fvdl 		size		2
   1291  1.1    fvdl 	}
   1292  1.1    fvdl 	/*
   1293  1.2    fvdl 	 * Bit vector of targets that have disconnection disabled as set by
   1294  1.2    fvdl 	 * the BIOS.  The Sequencer relies in a per-SCB field to control the
   1295  1.2    fvdl 	 * disconnect priveldge.  During initialization, we read this field
   1296  1.2    fvdl 	 * and reuse it for 2 entries in the busy target table.
   1297  1.1    fvdl 	 */
   1298  1.1    fvdl 	DISC_DSB {
   1299  1.1    fvdl 		size		2
   1300  1.1    fvdl 	}
   1301  1.2    fvdl 	CMDSIZE_TABLE_TAIL {
   1302  1.2    fvdl 		size		4
   1303  1.2    fvdl 	}
   1304  1.2    fvdl 	/*
   1305  1.2    fvdl 	 * Partial transfer past cacheline end to be
   1306  1.2    fvdl 	 * transferred using an extra S/G.
   1307  1.2    fvdl 	 */
   1308  1.2    fvdl 	MWI_RESIDUAL {
   1309  1.2    fvdl 		size		1
   1310  1.2    fvdl 		alias	TARG_IMMEDIATE_SCB
   1311  1.2    fvdl 	}
   1312  1.2    fvdl 	/*
   1313  1.2    fvdl 	 * SCBID of the next SCB to be started by the controller.
   1314  1.2    fvdl 	 */
   1315  1.2    fvdl 	NEXT_QUEUED_SCB {
   1316  1.2    fvdl 		size		1
   1317  1.2    fvdl 	}
   1318  1.1    fvdl 	/*
   1319  1.1    fvdl 	 * Single byte buffer used to designate the type or message
   1320  1.1    fvdl 	 * to send to a target.
   1321  1.1    fvdl 	 */
   1322  1.1    fvdl 	MSG_OUT {
   1323  1.1    fvdl 		size		1
   1324  1.1    fvdl 	}
   1325  1.1    fvdl 	/* Parameters for DMA Logic */
   1326  1.1    fvdl 	DMAPARAMS {
   1327  1.1    fvdl 		size		1
   1328  1.2    fvdl 		field	PRELOADEN	0x80
   1329  1.2    fvdl 		field	WIDEODD		0x40
   1330  1.2    fvdl 		field	SCSIEN		0x20
   1331  1.2    fvdl 		field	SDMAEN		0x10
   1332  1.2    fvdl 		field	SDMAENACK	0x10
   1333  1.2    fvdl 		field	HDMAEN		0x08
   1334  1.2    fvdl 		field	HDMAENACK	0x08
   1335  1.2    fvdl 		field	DIRECTION	0x04	/* Set indicates PCI->SCSI */
   1336  1.2    fvdl 		field	FIFOFLUSH	0x02
   1337  1.2    fvdl 		field	FIFORESET	0x01
   1338  1.1    fvdl 	}
   1339  1.1    fvdl 	SEQ_FLAGS {
   1340  1.1    fvdl 		size		1
   1341  1.2    fvdl 		field	NOT_IDENTIFIED		0x80
   1342  1.2    fvdl 		field	NO_CDB_SENT		0x40
   1343  1.2    fvdl 		field	TARGET_CMD_IS_TAGGED	0x40
   1344  1.2    fvdl 		field	DPHASE			0x20
   1345  1.1    fvdl 		/* Target flags */
   1346  1.2    fvdl 		field	TARG_CMD_PENDING	0x10
   1347  1.2    fvdl 		field	CMDPHASE_PENDING	0x08
   1348  1.2    fvdl 		field	DPHASE_PENDING		0x04
   1349  1.2    fvdl 		field	SPHASE_PENDING		0x02
   1350  1.2    fvdl 		field	NO_DISCONNECT		0x01
   1351  1.1    fvdl 	}
   1352  1.1    fvdl 	/*
   1353  1.1    fvdl 	 * Temporary storage for the
   1354  1.1    fvdl 	 * target/channel/lun of a
   1355  1.1    fvdl 	 * reconnecting target
   1356  1.1    fvdl 	 */
   1357  1.2    fvdl 	SAVED_SCSIID {
   1358  1.1    fvdl 		size		1
   1359  1.1    fvdl 	}
   1360  1.2    fvdl 	SAVED_LUN {
   1361  1.1    fvdl 		size		1
   1362  1.1    fvdl 	}
   1363  1.1    fvdl 	/*
   1364  1.3   perry 	 * The last bus phase as seen by the sequencer.
   1365  1.1    fvdl 	 */
   1366  1.1    fvdl 	LASTPHASE {
   1367  1.1    fvdl 		size		1
   1368  1.2    fvdl 		field	CDI		0x80
   1369  1.2    fvdl 		field	IOI		0x40
   1370  1.2    fvdl 		field	MSGI		0x20
   1371  1.1    fvdl 		mask	PHASE_MASK	CDI|IOI|MSGI
   1372  1.1    fvdl 		mask	P_DATAOUT	0x00
   1373  1.1    fvdl 		mask	P_DATAIN	IOI
   1374  1.1    fvdl 		mask	P_COMMAND	CDI
   1375  1.1    fvdl 		mask	P_MESGOUT	CDI|MSGI
   1376  1.1    fvdl 		mask	P_STATUS	CDI|IOI
   1377  1.1    fvdl 		mask	P_MESGIN	CDI|IOI|MSGI
   1378  1.1    fvdl 		mask	P_BUSFREE	0x01
   1379  1.1    fvdl 	}
   1380  1.1    fvdl 	/*
   1381  1.1    fvdl 	 * head of list of SCBs awaiting
   1382  1.1    fvdl 	 * selection
   1383  1.1    fvdl 	 */
   1384  1.1    fvdl 	WAITING_SCBH {
   1385  1.1    fvdl 		size		1
   1386  1.1    fvdl 	}
   1387  1.1    fvdl 	/*
   1388  1.1    fvdl 	 * head of list of SCBs that are
   1389  1.1    fvdl 	 * disconnected.  Used for SCB
   1390  1.1    fvdl 	 * paging.
   1391  1.1    fvdl 	 */
   1392  1.1    fvdl 	DISCONNECTED_SCBH {
   1393  1.1    fvdl 		size		1
   1394  1.1    fvdl 	}
   1395  1.1    fvdl 	/*
   1396  1.1    fvdl 	 * head of list of SCBs that are
   1397  1.1    fvdl 	 * not in use.  Used for SCB paging.
   1398  1.1    fvdl 	 */
   1399  1.1    fvdl 	FREE_SCBH {
   1400  1.1    fvdl 		size		1
   1401  1.1    fvdl 	}
   1402  1.1    fvdl 	/*
   1403  1.2    fvdl 	 * head of list of SCBs that have
   1404  1.2    fvdl 	 * completed but have not been
   1405  1.2    fvdl 	 * put into the qoutfifo.
   1406  1.1    fvdl 	 */
   1407  1.2    fvdl 	COMPLETE_SCBH {
   1408  1.2    fvdl 		size		1
   1409  1.1    fvdl 	}
   1410  1.1    fvdl 	/*
   1411  1.2    fvdl 	 * Address of the hardware scb array in the host.
   1412  1.1    fvdl 	 */
   1413  1.2    fvdl 	HSCB_ADDR {
   1414  1.1    fvdl 		size		4
   1415  1.1    fvdl 	}
   1416  1.1    fvdl 	/*
   1417  1.2    fvdl 	 * Base address of our shared data with the kernel driver in host
   1418  1.2    fvdl 	 * memory.  This includes the qoutfifo and target mode
   1419  1.2    fvdl 	 * incoming command queue.
   1420  1.1    fvdl 	 */
   1421  1.2    fvdl 	SHARED_DATA_ADDR {
   1422  1.1    fvdl 		size		4
   1423  1.1    fvdl 	}
   1424  1.1    fvdl 	KERNEL_QINPOS {
   1425  1.1    fvdl 		size		1
   1426  1.1    fvdl 	}
   1427  1.1    fvdl 	QINPOS {
   1428  1.1    fvdl 		size		1
   1429  1.1    fvdl 	}
   1430  1.1    fvdl 	QOUTPOS {
   1431  1.1    fvdl 		size		1
   1432  1.1    fvdl 	}
   1433  1.1    fvdl 	/*
   1434  1.1    fvdl 	 * Kernel and sequencer offsets into the queue of
   1435  1.1    fvdl 	 * incoming target mode command descriptors.  The
   1436  1.1    fvdl 	 * queue is full when the KERNEL_TQINPOS == TQINPOS.
   1437  1.1    fvdl 	 */
   1438  1.1    fvdl 	KERNEL_TQINPOS {
   1439  1.1    fvdl 		size		1
   1440  1.1    fvdl 	}
   1441  1.3   perry 	TQINPOS {
   1442  1.1    fvdl 		size		1
   1443  1.1    fvdl 	}
   1444  1.1    fvdl 	ARG_1 {
   1445  1.1    fvdl 		size		1
   1446  1.1    fvdl 		mask	SEND_MSG		0x80
   1447  1.1    fvdl 		mask	SEND_SENSE		0x40
   1448  1.1    fvdl 		mask	SEND_REJ		0x20
   1449  1.1    fvdl 		mask	MSGOUT_PHASEMIS		0x10
   1450  1.1    fvdl 		mask	EXIT_MSG_LOOP		0x08
   1451  1.1    fvdl 		mask	CONT_MSG_LOOP		0x04
   1452  1.1    fvdl 		mask	CONT_TARG_SESSION	0x02
   1453  1.1    fvdl 		alias	RETURN_1
   1454  1.1    fvdl 	}
   1455  1.1    fvdl 	ARG_2 {
   1456  1.1    fvdl 		size		1
   1457  1.1    fvdl 		alias	RETURN_2
   1458  1.1    fvdl 	}
   1459  1.1    fvdl 
   1460  1.1    fvdl 	/*
   1461  1.1    fvdl 	 * Snapshot of MSG_OUT taken after each message is sent.
   1462  1.1    fvdl 	 */
   1463  1.1    fvdl 	LAST_MSG {
   1464  1.1    fvdl 		size		1
   1465  1.1    fvdl 	}
   1466  1.1    fvdl 
   1467  1.1    fvdl 	/*
   1468  1.1    fvdl 	 * Sequences the kernel driver has okayed for us.  This allows
   1469  1.1    fvdl 	 * the driver to do things like prevent initiator or target
   1470  1.1    fvdl 	 * operations.
   1471  1.1    fvdl 	 */
   1472  1.1    fvdl 	SCSISEQ_TEMPLATE {
   1473  1.1    fvdl 		size		1
   1474  1.2    fvdl 		field	ENSELO		0x40
   1475  1.2    fvdl 		field	ENSELI		0x20
   1476  1.2    fvdl 		field	ENRSELI		0x10
   1477  1.2    fvdl 		field	ENAUTOATNO	0x08
   1478  1.2    fvdl 		field	ENAUTOATNI	0x04
   1479  1.2    fvdl 		field	ENAUTOATNP	0x02
   1480  1.1    fvdl 	}
   1481  1.1    fvdl 
   1482  1.1    fvdl 	/*
   1483  1.1    fvdl 	 * Track whether the transfer byte count for
   1484  1.1    fvdl 	 * the current data phase is odd.
   1485  1.1    fvdl 	 */
   1486  1.1    fvdl 	DATA_COUNT_ODD {
   1487  1.1    fvdl 		size		1
   1488  1.1    fvdl 	}
   1489  1.2    fvdl }
   1490  1.2    fvdl 
   1491  1.2    fvdl scratch_ram {
   1492  1.2    fvdl 	address		0x056
   1493  1.2    fvdl 	size		4
   1494  1.2    fvdl 	/*
   1495  1.2    fvdl 	 * These scratch ram locations are initialized by the 274X BIOS.
   1496  1.2    fvdl 	 * We reuse them after capturing the BIOS settings during
   1497  1.2    fvdl 	 * initialization.
   1498  1.2    fvdl 	 */
   1499  1.1    fvdl 
   1500  1.1    fvdl 	/*
   1501  1.1    fvdl 	 * The initiator specified tag for this target mode transaction.
   1502  1.1    fvdl 	 */
   1503  1.2    fvdl 	HA_274_BIOSGLOBAL {
   1504  1.2    fvdl 		size	1
   1505  1.2    fvdl 		field	HA_274_EXTENDED_TRANS	0x01
   1506  1.2    fvdl 		alias	INITIATOR_TAG
   1507  1.2    fvdl 	}
   1508  1.2    fvdl 
   1509  1.2    fvdl 	SEQ_FLAGS2 {
   1510  1.2    fvdl 		size	1
   1511  1.2    fvdl 		field	SCB_DMA			0x01
   1512  1.2    fvdl 		field	TARGET_MSG_PENDING	0x02
   1513  1.1    fvdl 	}
   1514  1.2    fvdl }
   1515  1.1    fvdl 
   1516  1.2    fvdl scratch_ram {
   1517  1.2    fvdl 	address		0x05a
   1518  1.2    fvdl 	size		6
   1519  1.1    fvdl 	/*
   1520  1.2    fvdl 	 * These are reserved registers in the card's scratch ram on the 2742.
   1521  1.5  andvar 	 * The EISA configuration chip is mapped here.  On Rev E. of the
   1522  1.2    fvdl 	 * aic7770, the sequencer can use this area for scratch, but the
   1523  1.2    fvdl 	 * host cannot directly access these registers.  On later chips, this
   1524  1.2    fvdl 	 * area can be read and written by both the host and the sequencer.
   1525  1.2    fvdl 	 * Even on later chips, many of these locations are initialized by
   1526  1.2    fvdl 	 * the BIOS.
   1527  1.1    fvdl 	 */
   1528  1.1    fvdl 	SCSICONF {
   1529  1.1    fvdl 		size		1
   1530  1.2    fvdl 		field	TERM_ENB	0x80
   1531  1.2    fvdl 		field	RESET_SCSI	0x40
   1532  1.2    fvdl 		field	ENSPCHK		0x20
   1533  1.1    fvdl 		mask	HSCSIID		0x07	/* our SCSI ID */
   1534  1.1    fvdl 		mask	HWSCSIID	0x0f	/* our SCSI ID if Wide Bus */
   1535  1.1    fvdl 	}
   1536  1.2    fvdl 	INTDEF {
   1537  1.2    fvdl 		address		0x05c
   1538  1.2    fvdl 		size		1
   1539  1.2    fvdl 		field	EDGE_TRIG	0x80
   1540  1.2    fvdl 		mask	VECTOR		0x0f
   1541  1.2    fvdl 	}
   1542  1.1    fvdl 	HOSTCONF {
   1543  1.1    fvdl 		address		0x05d
   1544  1.1    fvdl 		size		1
   1545  1.1    fvdl 	}
   1546  1.1    fvdl 	HA_274_BIOSCTRL	{
   1547  1.1    fvdl 		address		0x05f
   1548  1.1    fvdl 		size		1
   1549  1.1    fvdl 		mask	BIOSMODE		0x30
   1550  1.3   perry 		mask	BIOSDISABLED		0x30
   1551  1.2    fvdl 		field	CHANNEL_B_PRIMARY	0x08
   1552  1.1    fvdl 	}
   1553  1.2    fvdl }
   1554  1.2    fvdl 
   1555  1.2    fvdl scratch_ram {
   1556  1.2    fvdl 	address		0x070
   1557  1.2    fvdl 	size		16
   1558  1.2    fvdl 
   1559  1.1    fvdl 	/*
   1560  1.1    fvdl 	 * Per target SCSI offset values for Ultra2 controllers.
   1561  1.1    fvdl 	 */
   1562  1.1    fvdl 	TARG_OFFSET {
   1563  1.1    fvdl 		size		16
   1564  1.1    fvdl 	}
   1565  1.1    fvdl }
   1566  1.1    fvdl 
   1567  1.2    fvdl const TID_SHIFT		4
   1568  1.1    fvdl const SCB_LIST_NULL	0xff
   1569  1.1    fvdl const TARGET_CMD_CMPLT	0xfe
   1570  1.1    fvdl 
   1571  1.1    fvdl const CCSGADDR_MAX	0x80
   1572  1.1    fvdl const CCSGRAM_MAXSEGS	16
   1573  1.1    fvdl 
   1574  1.1    fvdl /* WDTR Message values */
   1575  1.1    fvdl const BUS_8_BIT			0x00
   1576  1.1    fvdl const BUS_16_BIT		0x01
   1577  1.1    fvdl const BUS_32_BIT		0x02
   1578  1.1    fvdl 
   1579  1.1    fvdl /* Offset maximums */
   1580  1.1    fvdl const MAX_OFFSET_8BIT		0x0f
   1581  1.1    fvdl const MAX_OFFSET_16BIT		0x08
   1582  1.1    fvdl const MAX_OFFSET_ULTRA2		0x7f
   1583  1.2    fvdl const MAX_OFFSET		0xff
   1584  1.1    fvdl const HOST_MSG			0xff
   1585  1.1    fvdl 
   1586  1.1    fvdl /* Target mode command processing constants */
   1587  1.1    fvdl const CMD_GROUP_CODE_SHIFT	0x05
   1588  1.1    fvdl 
   1589  1.1    fvdl const STATUS_BUSY		0x08
   1590  1.2    fvdl const STATUS_QUEUE_FULL	0x28
   1591  1.2    fvdl const TARGET_DATA_IN		1
   1592  1.1    fvdl 
   1593  1.1    fvdl /*
   1594  1.1    fvdl  * Downloaded (kernel inserted) constants
   1595  1.1    fvdl  */
   1596  1.2    fvdl /* Offsets into the SCBID array where different data is stored */
   1597  1.2    fvdl const QOUTFIFO_OFFSET download
   1598  1.2    fvdl const QINFIFO_OFFSET download
   1599  1.2    fvdl const CACHESIZE_MASK download
   1600  1.2    fvdl const INVERTED_CACHESIZE_MASK download
   1601  1.2    fvdl const SG_PREFETCH_CNT download
   1602  1.2    fvdl const SG_PREFETCH_ALIGN_MASK download
   1603  1.2    fvdl const SG_PREFETCH_ADDR_MASK download
   1604