Home | History | Annotate | Line # | Download | only in dev
scireg.h revision 1.3
      1  1.3     cgd /*	$NetBSD: scireg.h,v 1.3 1994/10/26 02:04:46 cgd Exp $	*/
      2  1.3     cgd 
      3  1.1  chopps /*
      4  1.1  chopps  * Copyright (c) 1990 The Regents of the University of California.
      5  1.1  chopps  * All rights reserved.
      6  1.1  chopps  *
      7  1.1  chopps  * This code is derived from software contributed to Berkeley by
      8  1.1  chopps  * Van Jacobson of Lawrence Berkeley Laboratory.
      9  1.1  chopps  *
     10  1.1  chopps  * Redistribution and use in source and binary forms, with or without
     11  1.1  chopps  * modification, are permitted provided that the following conditions
     12  1.1  chopps  * are met:
     13  1.1  chopps  * 1. Redistributions of source code must retain the above copyright
     14  1.1  chopps  *    notice, this list of conditions and the following disclaimer.
     15  1.1  chopps  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1  chopps  *    notice, this list of conditions and the following disclaimer in the
     17  1.1  chopps  *    documentation and/or other materials provided with the distribution.
     18  1.1  chopps  * 3. All advertising materials mentioning features or use of this software
     19  1.1  chopps  *    must display the following acknowledgement:
     20  1.1  chopps  *	This product includes software developed by the University of
     21  1.1  chopps  *	California, Berkeley and its contributors.
     22  1.1  chopps  * 4. Neither the name of the University nor the names of its contributors
     23  1.1  chopps  *    may be used to endorse or promote products derived from this software
     24  1.1  chopps  *    without specific prior written permission.
     25  1.1  chopps  *
     26  1.1  chopps  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
     27  1.1  chopps  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     28  1.1  chopps  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     29  1.1  chopps  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
     30  1.1  chopps  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     31  1.1  chopps  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     32  1.1  chopps  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     33  1.1  chopps  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     34  1.1  chopps  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     35  1.1  chopps  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     36  1.1  chopps  * SUCH DAMAGE.
     37  1.1  chopps  *
     38  1.1  chopps  *	@(#)scireg.h	7.3 (Berkeley) 2/5/91
     39  1.1  chopps  */
     40  1.1  chopps 
     41  1.1  chopps /*
     42  1.1  chopps  * NCR 5380 SCSI interface hardware description.
     43  1.1  chopps  *
     44  1.1  chopps  */
     45  1.1  chopps 
     46  1.2  chopps #if 0	/* for reference */
     47  1.1  chopps typedef struct {
     48  1.1  chopps 	unsigned char pad0[1];
     49  1.1  chopps 	volatile unsigned char sci_data;	/* r:  Current data */
     50  1.1  chopps #define	sci_odata sci_data			/* w:  Out data */
     51  1.1  chopps 
     52  1.1  chopps 	unsigned char pad1[1];
     53  1.1  chopps 	volatile unsigned char sci_icmd;	/* rw: Initiator command */
     54  1.1  chopps 
     55  1.1  chopps 	unsigned char pad2[1];
     56  1.1  chopps 	volatile unsigned char sci_mode;	/* rw: Mode */
     57  1.1  chopps 
     58  1.1  chopps 	unsigned char pad3[1];
     59  1.1  chopps 	volatile unsigned char sci_tcmd;	/* rw: Target command */
     60  1.1  chopps 
     61  1.1  chopps 	unsigned char pad4[1];
     62  1.1  chopps 	volatile unsigned char sci_bus_csr;	/* r:  Bus Status */
     63  1.1  chopps #define	sci_sel_enb sci_bus_csr			/* w:  Select enable */
     64  1.1  chopps 
     65  1.1  chopps 	unsigned char pad5[1];
     66  1.1  chopps 	volatile unsigned char sci_csr;		/* r:  Status */
     67  1.1  chopps #define	sci_dma_send sci_csr			/* w:  Start dma send data */
     68  1.1  chopps 
     69  1.1  chopps 	unsigned char pad6[1];
     70  1.1  chopps 	volatile unsigned char sci_idata;	/* r:  Input data */
     71  1.1  chopps #define	sci_trecv sci_idata			/* w:  Start dma receive, target */
     72  1.1  chopps 
     73  1.1  chopps 	unsigned char pad7[1];
     74  1.1  chopps 	volatile unsigned char sci_iack;	/* r:  Interrupt Acknowledge  */
     75  1.1  chopps #define	sci_irecv sci_iack			/* w:  Start dma receive, initiator */
     76  1.1  chopps } sci_regmap_t;
     77  1.2  chopps #endif
     78  1.1  chopps 
     79  1.1  chopps /*
     80  1.1  chopps  * Initiator command register
     81  1.1  chopps  */
     82  1.1  chopps 
     83  1.1  chopps #define SCI_ICMD_DATA		0x01		/* rw: Assert data bus   */
     84  1.1  chopps #define SCI_ICMD_ATN		0x02		/* rw: Assert ATN signal */
     85  1.1  chopps #define SCI_ICMD_SEL		0x04		/* rw: Assert SEL signal */
     86  1.1  chopps #define SCI_ICMD_BSY		0x08		/* rw: Assert BSY signal */
     87  1.1  chopps #define SCI_ICMD_ACK		0x10		/* rw: Assert ACK signal */
     88  1.1  chopps #define SCI_ICMD_LST		0x20		/* r:  Lost arbitration */
     89  1.1  chopps #define SCI_ICMD_DIFF	SCI_ICMD_LST		/* w:  Differential cable */
     90  1.1  chopps #define SCI_ICMD_AIP		0x40		/* r:  Arbitration in progress */
     91  1.1  chopps #define SCI_ICMD_TEST	SCI_ICMD_AIP		/* w:  Test mode */
     92  1.1  chopps #define SCI_ICMD_RST		0x80		/* rw: Assert RST signal */
     93  1.1  chopps 
     94  1.1  chopps 
     95  1.1  chopps /*
     96  1.1  chopps  * Mode register
     97  1.1  chopps  */
     98  1.1  chopps 
     99  1.1  chopps #define SCI_MODE_ARB		0x01		/* rw: Start arbitration */
    100  1.1  chopps #define SCI_MODE_DMA		0x02		/* rw: Enable DMA xfers */
    101  1.1  chopps #define SCI_MODE_MONBSY		0x04		/* rw: Monitor BSY signal */
    102  1.1  chopps #define SCI_MODE_DMA_IE		0x08		/* rw: Enable DMA complete interrupt */
    103  1.1  chopps #define SCI_MODE_PERR_IE	0x10		/* rw: Interrupt on parity errors */
    104  1.1  chopps #define SCI_MODE_PAR_CHK	0x20		/* rw: Check parity */
    105  1.1  chopps #define SCI_MODE_TARGET		0x40		/* rw: Target mode (Initiator if 0) */
    106  1.1  chopps #define SCI_MODE_BLOCKDMA	0x80		/* rw: Block-mode DMA handshake (MBZ) */
    107  1.1  chopps 
    108  1.1  chopps 
    109  1.1  chopps /*
    110  1.1  chopps  * Target command register
    111  1.1  chopps  */
    112  1.1  chopps 
    113  1.1  chopps #define SCI_TCMD_IO		0x01		/* rw: Assert I/O signal */
    114  1.1  chopps #define SCI_TCMD_CD		0x02		/* rw: Assert C/D signal */
    115  1.1  chopps #define SCI_TCMD_MSG		0x04		/* rw: Assert MSG signal */
    116  1.1  chopps #define SCI_TCMD_PHASE_MASK	0x07		/* r:  Mask for current bus phase */
    117  1.1  chopps #define SCI_TCMD_REQ		0x08		/* rw: Assert REQ signal */
    118  1.1  chopps #define	SCI_TCMD_LAST_SENT	0x80		/* ro: Last byte was xferred
    119  1.1  chopps 						 *     (not on 5380/1) */
    120  1.1  chopps 
    121  1.1  chopps #define	SCI_PHASE(x)		((x>>2) & 7)
    122  1.1  chopps 
    123  1.1  chopps /*
    124  1.1  chopps  * Current (SCSI) Bus status
    125  1.1  chopps  */
    126  1.1  chopps 
    127  1.1  chopps #define SCI_BUS_DBP		0x01		/* r:  Data Bus parity */
    128  1.1  chopps #define SCI_BUS_SEL		0x02		/* r:  SEL signal */
    129  1.1  chopps #define SCI_BUS_IO		0x04		/* r:  I/O signal */
    130  1.1  chopps #define SCI_BUS_CD		0x08		/* r:  C/D signal */
    131  1.1  chopps #define SCI_BUS_MSG		0x10		/* r:  MSG signal */
    132  1.1  chopps #define SCI_BUS_REQ		0x20		/* r:  REQ signal */
    133  1.1  chopps #define SCI_BUS_BSY		0x40		/* r:  BSY signal */
    134  1.1  chopps #define SCI_BUS_RST		0x80		/* r:  RST signal */
    135  1.1  chopps 
    136  1.1  chopps #define	SCI_CUR_PHASE(x)	SCSI_PHASE((x)>>2)
    137  1.1  chopps 
    138  1.1  chopps /*
    139  1.1  chopps  * Bus and Status register
    140  1.1  chopps  */
    141  1.1  chopps 
    142  1.1  chopps #define SCI_CSR_ACK		0x01		/* r:  ACK signal */
    143  1.1  chopps #define SCI_CSR_ATN		0x02		/* r:  ATN signal */
    144  1.1  chopps #define SCI_CSR_DISC		0x04		/* r:  Disconnected (BSY==0) */
    145  1.1  chopps #define SCI_CSR_PHASE_MATCH	0x08		/* r:  Bus and SCI_TCMD match */
    146  1.1  chopps #define SCI_CSR_INT		0x10		/* r:  Interrupt request */
    147  1.1  chopps #define SCI_CSR_PERR		0x20		/* r:  Parity error */
    148  1.1  chopps #define SCI_CSR_DREQ		0x40		/* r:  DMA request */
    149  1.1  chopps #define SCI_CSR_DONE		0x80		/* r:  DMA count is zero */
    150  1.1  chopps 
    151