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