Home | History | Annotate | Line # | Download | only in ic
siopreg.h revision 1.3
      1 /*	$NetBSD: siopreg.h,v 1.3 2000/04/27 14:06:58 bouyer Exp $	*/
      2 
      3 /*
      4  * Copyright (c) 2000 Manuel Bouyer.
      5  *
      6  * Redistribution and use in source and binary forms, with or without
      7  * modification, are permitted provided that the following conditions
      8  * are met:
      9  * 1. Redistributions of source code must retain the above copyright
     10  *    notice, this list of conditions and the following disclaimer.
     11  * 2. Redistributions in binary form must reproduce the above copyright
     12  *    notice, this list of conditions and the following disclaimer in the
     13  *    documentation and/or other materials provided with the distribution.
     14  * 3. All advertising materials mentioning features or use of this software
     15  *    must display the following acknowledgement:
     16  *	This product includes software developed by Manuel Bouyer
     17  * 4. The name of the author may not be used to endorse or promote products
     18  *    derived from this software without specific prior written permission.
     19  *
     20  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
     21  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
     22  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE
     23  * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
     24  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  * POSSIBILITY OF SUCH DAMAGE.
     30  *
     31  */
     32 
     33 /*
     34  * Devices definitions for Symbios/NCR M53c8xx PCI-SCSI I/O Processors
     35  * Docs available from http://www.symbios.com/
     36  */
     37 
     38 #define SIOP_SCNTL0 	0x00 /* SCSI control 0, R/W */
     39 #define SCNTL0_ARB_MASK	0xc0
     40 #define SCNTL0_SARB	0x00
     41 #define SCNTL0_FARB	0xc0
     42 #define SCNTL0_START	0x20
     43 #define SCNTL0_WATM	0x10
     44 #define SCNTL0_EPC	0x08
     45 #define SCNTL0_AAP	0x02
     46 #define SCNTL0_TRG	0x01
     47 
     48 #define SIOP_SCNTL1 	0x01 /* SCSI control 1, R/W */
     49 #define SCNTL1_EXC	0x80
     50 #define SCNTL1_ADB	0x40
     51 #define SCNTL1_DHP	0x20
     52 #define SCNTL1_CON	0x10
     53 #define SCNTL1_RST	0x08
     54 #define SCNTL1_AESP	0x04
     55 #define SCNTL1_IARB	0x02
     56 #define SCNTL1_SST	0x01
     57 
     58 #define SIOP_SCNTL2 	0x02 /* SCSI control 2, R/W */
     59 #define SCNTL2_SDU	0x80
     60 #define SCNTL2_CHM	0x40	/* 875 only */
     61 #define SCNTL2_SLPMD	0x20	/* 875 only */
     62 #define SCNTL2_SLPHBEN	0x10	/* 875 only */
     63 #define SCNTL2_WSS	0x08	/* 875 only */
     64 #define SCNTL2_VUE0	0x04	/* 875 only */
     65 #define SCNTL2_VUE1	0x02	/* 875 only */
     66 #define SCNTL2_WSR	0x01	/* 875 only */
     67 
     68 #define SIOP_SCNTL3 	0x03 /* SCSI control 3, R/W */
     69 #define SCNTL3_ULTRA	0x80	/* 875 only */
     70 #define SCNTL3_SCF_SHIFT 4
     71 #define SCNTL3_SCF_MASK	0x70
     72 #define SCNTL3_EWS	0x04	/* 875 only */
     73 #define SCNTL3_CCF_SHIFT 0
     74 #define SCNTL3_MASK	0x07
     75 
     76 #define SIOP_SCID	0x04 /* SCSI chip ID R/W */
     77 #define SCID_RRE	0x40
     78 #define SCID_SRE	0x20
     79 #define SCID_ENCID_SHIFT 0
     80 #define SCID_ENCID_MASK	0x07
     81 
     82 #define SIOP_SCXFER	0x05 /* SCSI transfer, R/W */
     83 #define SCXFER_TP_SHIFT	 5
     84 #define SCXFER_TP_MASK	0xe0
     85 #define SCXFER_MO_SHIFT  0
     86 #define SCXFER_MO_MASK  0x0f
     87 
     88 #define SIOP_SDID	0x06 /* SCSI destiation ID, R/W */
     89 #define SDID_ENCID_SHIFT 0
     90 #define SDID_ENCID_MASK	0x07
     91 
     92 #define SIOP_GPREG	0x07 /* General purpose, R/W */
     93 #define GPREG_GPIO4	0x10	/* 875 only */
     94 #define GPREG_GPIO3	0x08	/* 875 only */
     95 #define GPREG_GPIO2	0x04	/* 875 only */
     96 #define GPREG_GPIO1	0x02
     97 #define GPREG_GPIO0	0x01
     98 
     99 #define SIOP_SFBR	0x08 /* SCSI first byte received, R/W */
    100 
    101 #define SIOP_SOCL	0x09 /* SCSI output control latch, RW */
    102 
    103 #define SIOP_SSID	0x0A /* SCSI selector ID, RO */
    104 #define SSID_VAL	0x80
    105 #define SSID_ENCID_SHIFT 0
    106 #define SSID_ENCID_MASK 0x0f
    107 
    108 #define SIOP_SBCL	0x0B /* SCSI control line, RO */
    109 
    110 #define SIOP_DSTAT	0x0C /* DMA status, RO */
    111 #define DSTAT_DFE	0x80
    112 #define DSTAT_MDPE	0x40
    113 #define DSTAT_BF	0x20
    114 #define DSTAT_ABRT	0x10
    115 #define DSTAT_SSI	0x08
    116 #define DSTAT_SIR	0x04
    117 #define DSTAT_IID	0x01
    118 
    119 #define SIOP_SSTAT0	0x0D /* STSI status 0, RO */
    120 #define SSTAT0_ILF	0x80
    121 #define SSTAT0_ORF	0x40
    122 #define SSTAT0_OLF	0x20
    123 #define SSTAT0_AIP	0x10
    124 #define SSTAT0_LOA	0x08
    125 #define SSTAT0_WOA	0x04
    126 #define SSTAT0_RST	0x02
    127 #define SSTAT0_SDP	0x01
    128 
    129 #define SIOP_SSTAT1	0x0E /* STSI status 1, RO */
    130 #define SSTAT1_FFO_SHIFT 4
    131 #define SSTAT1_FFO_MASK 0x80
    132 #define SSTAT1_SDPL	0x08
    133 #define SSTAT1_MSG	0x04
    134 #define SSTAT1_CD	0x02
    135 #define SSTAT1_IO	0x01
    136 #define SSTAT1_PHASE_MASK (SSTAT1_IO | SSTAT1_CD | SSTAT1_MSG)
    137 #define SSTAT1_PHASE_DATAOUT	0
    138 #define SSTAT1_PHASE_DATAIN	SSTAT1_IO
    139 #define SSTAT1_PHASE_CMD	SSTAT1_CD
    140 #define SSTAT1_PHASE_STATUS	(SSTAT1_CD | SSTAT1_IO)
    141 #define SSTAT1_PHASE_MSGOUT	(SSTAT1_MSG | SSTAT1_CD)
    142 #define SSTAT1_PHASE_MSGIN	(SSTAT1_MSG | SSTAT1_CD | SSTAT1_IO)
    143 
    144 #define SIOP_SSTAT2	0x0F /* STSI status 2, RO */
    145 #define SSTAT2_ILF1	0x80	/* 875 only */
    146 #define SSTAT2_ORF1	0x40	/* 875 only */
    147 #define SSTAT2_OLF1	0x20	/* 875 only */
    148 #define SSTAT2_FF4	0x10	/* 875 only */
    149 #define SSTAT2_SPL1	0x08	/* 875 only */
    150 #define SSTAT2_DF	0x04	/* 875 only */
    151 #define SSTAT2_LDSC	0x02
    152 #define SSTAT2_SDP1	0x01	/* 875 only */
    153 
    154 #define SIOP_DSA	0x10 /* data struct addr, R/W */
    155 
    156 #define SIOP_ISTAT	0x14 /* IRQ status, R/W */
    157 #define ISTAT_ABRT	0x80
    158 #define ISTAT_SRST	0x40
    159 #define ISTAT_SIGP	0x20
    160 #define ISTAT_SEM	0x10
    161 #define ISTAT_CON	0x08
    162 #define ISTAT_INTF	0x04
    163 #define ISTAT_SIP	0x02
    164 #define ISTAT_DIP	0x01
    165 
    166 #define SIOP_CTEST0	0x18 /* Chip test 0, R/W */
    167 
    168 #define SIOP_CTEST1	0x19 /* Chip test 1, R/W */
    169 
    170 #define SIOP_CTEST2	0x1A /* Chip test 2, R/W */
    171 #define CTEST2_SRTCH	0x04	/* 875 only */
    172 
    173 #define SIOP_CTEST3	0x1B /* Chip test 3, R/W */
    174 #define CTEST3_FLF	0x08
    175 #define CTEST3_CLF	0x04
    176 #define CTEST3_FM	0x02
    177 #define CTEST3_WRIE	0x01
    178 
    179 #define SIOP_TEMP	0x1C /* Temp register (used by CALL/RET), R/W */
    180 
    181 #define SIOP_DFIFO	0x20 /* DMA FIFO */
    182 
    183 #define SIOP_CTEST4	0x21 /* Chip test 4, R/W */
    184 #define CTEST4_BDIS	0x80
    185 #define CTEST_ZMOD	0x40
    186 #define CTEST_ZSD	0x20
    187 #define CTEST_SRTM	0x10
    188 #define CTEST_MPEE	0x08
    189 
    190 #define SIOP_CTEST5	0x22 /* Chip test 5, R/W */
    191 #define CTEST5_ADCK	0x80
    192 #define CTEST5_BBCK	0x40
    193 #define CTEST5_MASR	0x10
    194 #define CTEST5_DDIR	0x08
    195 
    196 #define SIOP_CTEST6	0x23 /* Chip test 6, R/W */
    197 
    198 #define SIOP_DBC	0x24 /* DMA byte counter, R/W */
    199 
    200 #define SIOP_DCMD	0x27 /* DMA command, R/W */
    201 
    202 #define SIOP_DNAD	0x28 /* DMA next addr, R/W */
    203 
    204 #define SIOP_DSP	0x2C /* DMA scripts pointer, R/W */
    205 
    206 #define SIOP_DSPS	0x30 /* DMA scripts pointer save, R/W */
    207 
    208 #define SIOP_SCRATCHA	0x34 /* scratch register A. R/W */
    209 
    210 #define SIOP_DMODE	0x38 /* DMA mode, R/W */
    211 #define DMODE_BL_SHIFT   6
    212 #define DMODE_BL_MASK	0xC0
    213 #define DMODE_SIOM	0x20
    214 #define DMODE_DIOM	0x10
    215 #define DMODE_ERL	0x08
    216 #define DMODE_ERMP	0x04
    217 #define DMODE_BOF	0x02
    218 #define DMODE_MAN	0x01
    219 
    220 #define SIOP_DIEN	0x39 /* DMA interrupt enable, R/W */
    221 #define DIEN_MDPE	0x40
    222 #define DIEN_BF		0x20
    223 #define DIEN_AVRT	0x10
    224 #define DIEN_SSI	0x08
    225 #define DIEN_SIR	0x04
    226 #define DIEN_IID	0x01
    227 
    228 #define SIOP_SBR	0x3A /* scratch byte register, R/W */
    229 
    230 #define SIOP_DCNTL	0x3B /* DMA control, R/W */
    231 #define DCNTL_CLSE	0x80
    232 #define DCNTL_PFF	0x40
    233 #define DCNTL_PFEN	0x20
    234 #define DCNTL_SSM	0x10
    235 #define DCNTL_IRQM	0x08
    236 #define DCNTL_STD	0x04
    237 #define DCNTL_IRQD	0x02
    238 #define DCNTL_COM	0x01
    239 
    240 #define SIOP_ADDER	0x3C /* adder output sum, RO */
    241 
    242 #define SIOP_SIEN0	0x40 /* SCSI interrupt enable 0, R/W */
    243 #define SIEN0_MA	0x80
    244 #define SIEN0_CMP	0x40
    245 #define SIEN0_SEL	0x20
    246 #define SIEN0_RSL	0x10
    247 #define SIEN0_SGE	0x08
    248 #define SIEN0_UDC	0x04
    249 #define SIEN0_SRT	0x02
    250 #define SIEN0_PAR	0x01
    251 
    252 #define SIOP_SIEN1	0x41 /* SCSI interrupt enable 1, R/W */
    253 #define SIEN1_STO	0x04
    254 #define SIEN1_GEN	0x02
    255 #define SIEN1_HTH	0x01
    256 
    257 #define SIOP_SIST0	0x42 /* SCSI interrupt status 0, RO */
    258 #define SIST0_MA	0x80
    259 #define SIST0_CMP	0x40
    260 #define SIST0_SEL	0x20
    261 #define SIST0_RSL	0x10
    262 #define SIST0_SGE	0x08
    263 #define SIST0_UDC	0x04
    264 #define SIST0_RST	0x02
    265 #define SIST0_PAR	0x01
    266 
    267 #define SIOP_SIST1	0x43 /* SCSI interrut status 1, RO */
    268 #define SIST1_STO	0x04
    269 #define SIST1_GEN	0x02
    270 #define SIST1_HTH	0x01
    271 
    272 #define SIOP_SLPAR	0x44 /* scsi longitudinal parity, R/W */
    273 
    274 #define SIOP_SWIDE	0x45 /* scsi wide residue, RW, 875 only */
    275 
    276 #define SIOP_MACNTL	0x46 /* memory access control, R/W */
    277 
    278 #define SIOP_GPCNTL	0x47 /* General Purpose Pin control, R/W */
    279 #define GPCNTL_ME	0x80	/* 875 only */
    280 #define GPCNTL_FE	0x40	/* 875 only */
    281 #define GPCNTL_IN4	0x10	/* 875 only */
    282 #define GPCNTL_IN3	0x08	/* 875 only */
    283 #define GPCNTL_IN2	0x04	/* 875 only */
    284 #define GPCNTL_IN1	0x02
    285 #define GPCNTL_IN0	0x01
    286 
    287 #define SIOP_STIME0	0x48 /* SCSI timer 0, R/W */
    288 #define STIME0_HTH_SHIFT 4
    289 #define STIME0_HTH_MASK	0xf0
    290 #define STIME0_SEL_SHIFT 0
    291 #define STIME0_SEL_MASK	0x0f
    292 
    293 #define SIOP_STIME1	0x49 /* SCSI timer 1, R/W */
    294 #define STIME1_HTHBA	0x40	/* 875 only */
    295 #define STIME1_GENSF	0x20	/* 875 only */
    296 #define STIME1_HTHSF	0x10	/* 875 only */
    297 #define STIME1_GEN_SHIFT 0
    298 #define STIME1_GEN_MASK	0x0f
    299 
    300 #define SIOP_RESPID0	0x4A /* response ID, R/W */
    301 
    302 #define SIOP_RESPID1	0x4B /* response ID, R/W, 875-only */
    303 
    304 #define SIOP_STEST0	0x4C /* SCSI test 0, RO */
    305 
    306 #define SIOP_STEST1	0x4D /* SCSI test 1, RO, RW on 875 */
    307 #define STEST1_DBLEN	0x08	/* 875-only */
    308 #define STEST1_DBLSEL	0x04	/* 875-only */
    309 
    310 #define SIOP_STEST2	0x4E /* SCSI test 2, RO, R/W on 875 */
    311 #define STEST2_DIF	0x20	/* 875 only */
    312 #define STEST2_EXT	0x02
    313 
    314 #define SIOP_STEST3	0x4F /* SCSI test 3, RO, RW on 875 */
    315 #define STEST3_TE	0x80
    316 
    317 #define SIOP_SIDL	0x50 /* SCSI input data latch, RO */
    318 
    319 #define SIOP_SODL	0x54 /* SCSI output data latch, R/W */
    320 
    321 #define SIOP_SBDL	0x58 /* SCSI bus data lines, RO */
    322 
    323 #define SIOP_SCRATCHB	0x5C /* Scratch register B, R/W */
    324 
    325 #define SIOP_SCRATCHC	0x60 /* Scratch register C, R/W, 875 only */
    326 
    327 #define SIOP_SCRATCHD	0x64 /* Scratch register D, R/W, 875-only */
    328 
    329 #define SIOP_SCRATCHE	0x68 /* Scratch register E, R/W, 875-only */
    330 
    331 #define SIOP_SCRATCHF	0x6c /* Scratch register F, R/W, 875-only */
    332 
    333 #define SIOP_SCRATCHG	0x70 /* Scratch register G, R/W, 875-only */
    334 
    335 #define SIOP_SCRATCHH	0x74 /* Scratch register H, R/W, 875-only */
    336 
    337 #define SIOP_SCRATCHI	0x78 /* Scratch register I, R/W, 875-only */
    338 
    339 #define SIOP_SCRATCHJ	0x7c /* Scratch register J, R/W, 875-only */
    340