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