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