1*95e1ffb1Schristos /* $NetBSD: scireg.h,v 1.6 2005/12/11 12:16:28 christos Exp $ */ 2ec77f0b3Scgd 375e489c8Schopps /* 475e489c8Schopps * Copyright (c) 1990 The Regents of the University of California. 575e489c8Schopps * All rights reserved. 675e489c8Schopps * 775e489c8Schopps * This code is derived from software contributed to Berkeley by 875e489c8Schopps * Van Jacobson of Lawrence Berkeley Laboratory. 975e489c8Schopps * 1075e489c8Schopps * Redistribution and use in source and binary forms, with or without 1175e489c8Schopps * modification, are permitted provided that the following conditions 1275e489c8Schopps * are met: 1375e489c8Schopps * 1. Redistributions of source code must retain the above copyright 1475e489c8Schopps * notice, this list of conditions and the following disclaimer. 1575e489c8Schopps * 2. Redistributions in binary form must reproduce the above copyright 1675e489c8Schopps * notice, this list of conditions and the following disclaimer in the 1775e489c8Schopps * documentation and/or other materials provided with the distribution. 18aad01611Sagc * 3. Neither the name of the University nor the names of its contributors 1975e489c8Schopps * may be used to endorse or promote products derived from this software 2075e489c8Schopps * without specific prior written permission. 2175e489c8Schopps * 2275e489c8Schopps * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 2375e489c8Schopps * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 2475e489c8Schopps * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2575e489c8Schopps * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 2675e489c8Schopps * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2775e489c8Schopps * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2875e489c8Schopps * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2975e489c8Schopps * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3075e489c8Schopps * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 3175e489c8Schopps * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3275e489c8Schopps * SUCH DAMAGE. 3375e489c8Schopps * 3475e489c8Schopps * @(#)scireg.h 7.3 (Berkeley) 2/5/91 3575e489c8Schopps */ 3675e489c8Schopps 3775e489c8Schopps /* 3875e489c8Schopps * NCR 5380 SCSI interface hardware description. 3975e489c8Schopps * 4075e489c8Schopps */ 4175e489c8Schopps 42fb202207Schopps #if 0 /* for reference */ 4375e489c8Schopps typedef struct { 4475e489c8Schopps unsigned char pad0[1]; 4575e489c8Schopps volatile unsigned char sci_data; /* r: Current data */ 4675e489c8Schopps #define sci_odata sci_data /* w: Out data */ 4775e489c8Schopps 4875e489c8Schopps unsigned char pad1[1]; 4975e489c8Schopps volatile unsigned char sci_icmd; /* rw: Initiator command */ 5075e489c8Schopps 5175e489c8Schopps unsigned char pad2[1]; 5275e489c8Schopps volatile unsigned char sci_mode; /* rw: Mode */ 5375e489c8Schopps 5475e489c8Schopps unsigned char pad3[1]; 5575e489c8Schopps volatile unsigned char sci_tcmd; /* rw: Target command */ 5675e489c8Schopps 5775e489c8Schopps unsigned char pad4[1]; 5875e489c8Schopps volatile unsigned char sci_bus_csr; /* r: Bus Status */ 5975e489c8Schopps #define sci_sel_enb sci_bus_csr /* w: Select enable */ 6075e489c8Schopps 6175e489c8Schopps unsigned char pad5[1]; 6275e489c8Schopps volatile unsigned char sci_csr; /* r: Status */ 631ffa7b76Swiz #define sci_dma_send sci_csr /* w: Start DMA send data */ 6475e489c8Schopps 6575e489c8Schopps unsigned char pad6[1]; 6675e489c8Schopps volatile unsigned char sci_idata; /* r: Input data */ 671ffa7b76Swiz #define sci_trecv sci_idata /* w: Start DMA receive, target */ 6875e489c8Schopps 6975e489c8Schopps unsigned char pad7[1]; 7075e489c8Schopps volatile unsigned char sci_iack; /* r: Interrupt Acknowledge */ 711ffa7b76Swiz #define sci_irecv sci_iack /* w: Start DMA receive, initiator */ 7275e489c8Schopps } sci_regmap_t; 73fb202207Schopps #endif 7475e489c8Schopps 7575e489c8Schopps /* 7675e489c8Schopps * Initiator command register 7775e489c8Schopps */ 7875e489c8Schopps 7975e489c8Schopps #define SCI_ICMD_DATA 0x01 /* rw: Assert data bus */ 8075e489c8Schopps #define SCI_ICMD_ATN 0x02 /* rw: Assert ATN signal */ 8175e489c8Schopps #define SCI_ICMD_SEL 0x04 /* rw: Assert SEL signal */ 8275e489c8Schopps #define SCI_ICMD_BSY 0x08 /* rw: Assert BSY signal */ 8375e489c8Schopps #define SCI_ICMD_ACK 0x10 /* rw: Assert ACK signal */ 8475e489c8Schopps #define SCI_ICMD_LST 0x20 /* r: Lost arbitration */ 8575e489c8Schopps #define SCI_ICMD_DIFF SCI_ICMD_LST /* w: Differential cable */ 8675e489c8Schopps #define SCI_ICMD_AIP 0x40 /* r: Arbitration in progress */ 8775e489c8Schopps #define SCI_ICMD_TEST SCI_ICMD_AIP /* w: Test mode */ 8875e489c8Schopps #define SCI_ICMD_RST 0x80 /* rw: Assert RST signal */ 8975e489c8Schopps 9075e489c8Schopps 9175e489c8Schopps /* 9275e489c8Schopps * Mode register 9375e489c8Schopps */ 9475e489c8Schopps 9575e489c8Schopps #define SCI_MODE_ARB 0x01 /* rw: Start arbitration */ 9675e489c8Schopps #define SCI_MODE_DMA 0x02 /* rw: Enable DMA xfers */ 9775e489c8Schopps #define SCI_MODE_MONBSY 0x04 /* rw: Monitor BSY signal */ 9875e489c8Schopps #define SCI_MODE_DMA_IE 0x08 /* rw: Enable DMA complete interrupt */ 9975e489c8Schopps #define SCI_MODE_PERR_IE 0x10 /* rw: Interrupt on parity errors */ 10075e489c8Schopps #define SCI_MODE_PAR_CHK 0x20 /* rw: Check parity */ 10175e489c8Schopps #define SCI_MODE_TARGET 0x40 /* rw: Target mode (Initiator if 0) */ 10275e489c8Schopps #define SCI_MODE_BLOCKDMA 0x80 /* rw: Block-mode DMA handshake (MBZ) */ 10375e489c8Schopps 10475e489c8Schopps 10575e489c8Schopps /* 10675e489c8Schopps * Target command register 10775e489c8Schopps */ 10875e489c8Schopps 10975e489c8Schopps #define SCI_TCMD_IO 0x01 /* rw: Assert I/O signal */ 11075e489c8Schopps #define SCI_TCMD_CD 0x02 /* rw: Assert C/D signal */ 11175e489c8Schopps #define SCI_TCMD_MSG 0x04 /* rw: Assert MSG signal */ 11275e489c8Schopps #define SCI_TCMD_PHASE_MASK 0x07 /* r: Mask for current bus phase */ 11375e489c8Schopps #define SCI_TCMD_REQ 0x08 /* rw: Assert REQ signal */ 11475e489c8Schopps #define SCI_TCMD_LAST_SENT 0x80 /* ro: Last byte was xferred 11575e489c8Schopps * (not on 5380/1) */ 11675e489c8Schopps 11775e489c8Schopps #define SCI_PHASE(x) ((x>>2) & 7) 11875e489c8Schopps 11975e489c8Schopps /* 12075e489c8Schopps * Current (SCSI) Bus status 12175e489c8Schopps */ 12275e489c8Schopps 12375e489c8Schopps #define SCI_BUS_DBP 0x01 /* r: Data Bus parity */ 12475e489c8Schopps #define SCI_BUS_SEL 0x02 /* r: SEL signal */ 12575e489c8Schopps #define SCI_BUS_IO 0x04 /* r: I/O signal */ 12675e489c8Schopps #define SCI_BUS_CD 0x08 /* r: C/D signal */ 12775e489c8Schopps #define SCI_BUS_MSG 0x10 /* r: MSG signal */ 12875e489c8Schopps #define SCI_BUS_REQ 0x20 /* r: REQ signal */ 12975e489c8Schopps #define SCI_BUS_BSY 0x40 /* r: BSY signal */ 13075e489c8Schopps #define SCI_BUS_RST 0x80 /* r: RST signal */ 13175e489c8Schopps 13275e489c8Schopps #define SCI_CUR_PHASE(x) SCSI_PHASE((x)>>2) 13375e489c8Schopps 13475e489c8Schopps /* 13575e489c8Schopps * Bus and Status register 13675e489c8Schopps */ 13775e489c8Schopps 13875e489c8Schopps #define SCI_CSR_ACK 0x01 /* r: ACK signal */ 13975e489c8Schopps #define SCI_CSR_ATN 0x02 /* r: ATN signal */ 14075e489c8Schopps #define SCI_CSR_DISC 0x04 /* r: Disconnected (BSY==0) */ 14175e489c8Schopps #define SCI_CSR_PHASE_MATCH 0x08 /* r: Bus and SCI_TCMD match */ 14275e489c8Schopps #define SCI_CSR_INT 0x10 /* r: Interrupt request */ 14375e489c8Schopps #define SCI_CSR_PERR 0x20 /* r: Parity error */ 14475e489c8Schopps #define SCI_CSR_DREQ 0x40 /* r: DMA request */ 14575e489c8Schopps #define SCI_CSR_DONE 0x80 /* r: DMA count is zero */ 14675e489c8Schopps 147