Home | History | Annotate | Line # | Download | only in dev
espreg.h revision 1.2
      1 /*	$NetBSD: espreg.h,v 1.2 1998/07/05 07:53:45 dbj Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1995 Rolf Grossmann. All rights reserved.
      5  * Copyright (c) 1994 Peter Galbavy.  All rights reserved.
      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 Peter Galbavy.
     17  *	This product includes software developed by Rolf Grossmann.
     18  * 4. The name of the author may not be used to endorse or promote products
     19  *    derived from this software without specific prior written permission.
     20  *
     21  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  */
     32 
     33 /*
     34  * Register addresses, relative to some base address
     35  */
     36 
     37 #define ESP_TCL		0x00		/* RW - Transfer Count LSB	*/
     38 #define	ESP_TCM		0x01		/* RW - Transfer Count MSB	*/
     39 
     40 #define	ESP_FIFO	0x02		/* RW - FIFO data		*/
     41 
     42 #define	ESP_CMD		0x03		/* RW - Command (2 deep)	*/
     43 #define  ESPCMD_DMA	0x80		/*	DMA Bit			*/
     44 #define  ESPCMD_NOP	0x00		/*	No Operation		*/
     45 #define  ESPCMD_FLUSH	0x01		/*	Flush FIFO		*/
     46 #define  ESPCMD_RSTCHIP	0x02		/*	Reset Chip		*/
     47 #define  ESPCMD_RSTSCSI	0x03		/*	Reset SCSI Bus		*/
     48 #define  ESPCMD_RESEL	0x40		/*	Reselect Sequence	*/
     49 #define  ESPCMD_SELNATN	0x41		/*	Select without ATN	*/
     50 #define  ESPCMD_SELATN	0x42		/*	Select with ATN		*/
     51 #define  ESPCMD_SELATNS	0x43		/*	Select with ATN & Stop	*/
     52 #define  ESPCMD_ENSEL	0x44		/*	Enable (Re)Selection	*/
     53 #define  ESPCMD_DISSEL	0x45		/*	Disable (Re)Selection	*/
     54 #define  ESPCMD_SELATN3	0x46		/*	Select with ATN3	*/
     55 #define  ESPCMD_RESEL3	0x47		/*	Reselect3 Sequence	*/
     56 #define  ESPCMD_SNDMSG	0x20		/*	Send Message		*/
     57 #define  ESPCMD_SNDSTAT	0x21		/*	Send Status		*/
     58 #define  ESPCMD_SNDDATA	0x22		/*	Send Data		*/
     59 #define  ESPCMD_DISCSEQ	0x23		/*	Disconnect Sequence	*/
     60 #define  ESPCMD_TERMSEQ	0x24		/*	Terminate Sequence	*/
     61 #define  ESPCMD_TCCS	0x25		/*	Target Command Comp Seq	*/
     62 #define  ESPCMD_DISC	0x27		/*	Disconnect		*/
     63 #define  ESPCMD_RECMSG	0x28		/*	Receive Message		*/
     64 #define  ESPCMD_RECCMD	0x29		/*	Receive Command 	*/
     65 #define  ESPCMD_RECDATA	0x2a		/*	Receive Data		*/
     66 #define  ESPCMD_RECCSEQ	0x2b		/*	Receive Command Sequence*/
     67 #define  ESPCMD_ABORT	0x04		/*	Target Abort DMA	*/
     68 #define  ESPCMD_TRANS	0x10		/*	Transfer Information	*/
     69 #define  ESPCMD_ICCS	0x11		/*	Initiator Cmd Comp Seq 	*/
     70 #define  ESPCMD_MSGOK	0x12		/*	Message Accepted	*/
     71 #define  ESPCMD_TRPAD	0x18		/*	Transfer Pad		*/
     72 #define  ESPCMD_SETATN	0x1a		/*	Set ATN			*/
     73 #define  ESPCMD_RSTATN	0x1b		/*	Reset ATN		*/
     74 
     75 #define	ESP_STAT	0x04		/* RO - Status			*/
     76 #define  ESPSTAT_INT	0x80		/*	Interrupt		*/
     77 #define  ESPSTAT_GE	0x40		/*	Gross Error		*/
     78 #define  ESPSTAT_PE	0x20		/*	Parity Error		*/
     79 #define  ESPSTAT_TC	0x10		/*	Terminal Count		*/
     80 #define  ESPSTAT_VGC	0x08		/*	Valid Group Code	*/
     81 #define  ESPSTAT_PHASE	0x07		/*	Phase bits		*/
     82 
     83 #define	ESP_SELID	0x04		/* WO - Select/Reselect Bus ID	*/
     84 
     85 #define	ESP_INTR	0x05		/* RO - Interrupt		*/
     86 #define  ESPINTR_SBR	0x80		/*	SCSI Bus Reset		*/
     87 #define  ESPINTR_ILL	0x40		/*	Illegal Command		*/
     88 #define  ESPINTR_DIS	0x20		/*	Disconnect		*/
     89 #define  ESPINTR_BS	0x10		/*	Bus Service		*/
     90 #define  ESPINTR_FC	0x08		/*	Function Complete	*/
     91 #define  ESPINTR_RESEL	0x04		/*	Reselected		*/
     92 #define  ESPINTR_SELATN	0x02		/*	Select with ATN		*/
     93 #define  ESPINTR_SEL	0x01		/*	Selected		*/
     94 
     95 #define	ESP_TIMEOUT	0x05		/* WO - Select/Reselect Timeout */
     96 
     97 #define	ESP_STEP	0x06		/* RO - Sequence Step		*/
     98 #define  ESPSTEP_MASK	0x07		/*	the last 3 bits		*/
     99 #define  ESPSTEP_DONE	0x04		/*	command went out	*/
    100 
    101 #define	ESP_SYNCTP	0x06		/* WO - Synch Transfer Period	*/
    102 					/*	Default 5 (53C9X)	*/
    103 
    104 #define	ESP_FFLAG	0x07		/* RO - FIFO Flags		*/
    105 #define  ESPFIFO_SS	0xe0		/*	Sequence Step (Dup)	*/
    106 #define  ESPFIFO_FF	0x1f		/*	Bytes in FIFO		*/
    107 
    108 #define	ESP_SYNCOFF	0x07		/* WO - Synch Offset		*/
    109 					/*	0 = ASYNC		*/
    110 					/*	1 - 15 = SYNC bytes	*/
    111 
    112 #define	ESP_CFG1	0x08		/* RW - Configuration #1	*/
    113 #define  ESPCFG1_SLOW	0x80		/*	Slow Cable Mode		*/
    114 #define  ESPCFG1_SRR	0x40		/*	SCSI Reset Rep Int Dis	*/
    115 #define  ESPCFG1_PTEST	0x20		/*	Parity Test Mod		*/
    116 #define  ESPCFG1_PARENB	0x10		/*	Enable Parity Check	*/
    117 #define  ESPCFG1_CTEST	0x08		/*	Enable Chip Test	*/
    118 #define  ESPCFG1_BUSID	0x07		/*	Bus ID			*/
    119 
    120 #define	ESP_CCF		0x09		/* WO -	Clock Conversion Factor	*/
    121 					/*	0 = 35.01 - 40Mhz	*/
    122 					/*	NEVER SET TO 1		*/
    123 					/*	2 = 10Mhz		*/
    124 					/*	3 = 10.01 - 15Mhz	*/
    125 					/*	4 = 15.01 - 20Mhz	*/
    126 					/*	5 = 20.01 - 25Mhz	*/
    127 					/*	6 = 25.01 - 30Mhz	*/
    128 					/*	7 = 30.01 - 35Mhz	*/
    129 
    130 #define	ESP_TEST	0x0a		/* WO - Test (Chip Test Only)	*/
    131 
    132 #define	ESP_CFG2	0x0b		/* RW - Configuration #2	*/
    133 #define	 ESPCFG2_RSVD	0xe0		/*	reserved		*/
    134 #define  ESPCFG2_FE	0x40		/* 	Features Enable		*/
    135 #define  ESPCFG2_DREQ	0x10		/* 	DREQ High Impedance	*/
    136 #define  ESPCFG2_SCSI2	0x08		/* 	SCSI-2 Enable		*/
    137 #define  ESPCFG2_BPA	0x04		/* 	Target Bad Parity Abort	*/
    138 #define  ESPCFG2_RPE	0x02		/* 	Register Parity Error	*/
    139 #define  ESPCFG2_DPE	0x01		/* 	DMA Parity Error	*/
    140 
    141 #define	ESP_DCTL	0x20		/* RW - DMA Control		*/
    142 #define	 ESPDCTL_CLKMSK	0xc0		/*	Clock Selection Bits	*/
    143 #define	 ESPDCTL_10MHZ	0x00		/*	10 MHz Clock		*/
    144 #define	 ESPDCTL_12MHZ	0x40		/*	12.5 MHz Clock		*/
    145 #define	 ESPDCTL_16MHZ	0xc0		/*	16.6 MHz Clock		*/
    146 #define	 ESPDCTL_20MHZ	0x80		/*	20 MHz Clock		*/
    147 #define	 ESPDCTL_INTENB	0x20		/*	Interrupt Enable	*/
    148 #define	 ESPDCTL_DMAMOD	0x10		/*	1 = Enable DMA 		*/
    149 #define	 ESPDCTL_DMARD	0x08		/*	1 = scsi->mem (read)	*/
    150 #define	 ESPDCTL_FLUSH	0x04		/*	Flush Fifo		*/
    151 #define	 ESPDCTL_RESET	0x02		/*	Reset SCSI Chip		*/
    152 #define	 ESPDCTL_WD3392	0x01		/*	0 = NCR 5390		*/
    153 
    154 #define	ESP_DSTAT	0x21		/* RW - DMA Status		*/
    155 #define	 ESPDSTAT_STATE	0xc0		/*	DMA/SCSI Bank State	*/
    156 #define	 ESPDSTAT_D0S0	0x00		/*	DMA rdy b. 0, SCSI b. 0	*/
    157 #define	 ESPDSTAT_D0S1	0x40		/*	DMA req b. 0, SCSI b. 1	*/
    158 #define	 ESPDSTAT_D1S1	0x80		/*	DMA rdy b. 0, SCSI b. 1 */
    159 
    160 
    161 #define ESP_DEVICE_SIZE (ESP_DSTAT+1)
    162