hpcreg.h revision 1.11 1 1.11 rumble /* $NetBSD: hpcreg.h,v 1.11 2004/08/17 00:48:08 rumble Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*
4 1.1 thorpej * Copyright (c) 2001 Rafal K. Boni
5 1.1 thorpej * All rights reserved.
6 1.5 simonb *
7 1.1 thorpej * Redistribution and use in source and binary forms, with or without
8 1.1 thorpej * modification, are permitted provided that the following conditions
9 1.1 thorpej * are met:
10 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
11 1.1 thorpej * notice, this list of conditions and the following disclaimer.
12 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
14 1.1 thorpej * documentation and/or other materials provided with the distribution.
15 1.1 thorpej * 3. The name of the author may not be used to endorse or promote products
16 1.1 thorpej * derived from this software without specific prior written permission.
17 1.5 simonb *
18 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19 1.1 thorpej * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20 1.1 thorpej * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 1.1 thorpej * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 1.1 thorpej * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 1.1 thorpej * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 1.1 thorpej * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 1.1 thorpej * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 1.1 thorpej * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 1.1 thorpej * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 1.1 thorpej */
29 1.1 thorpej
30 1.1 thorpej #ifndef _ARCH_SGIMIPS_HPC_HPCREG_H_
31 1.1 thorpej #define _ARCH_SGIMIPS_HPC_HPCREG_H_
32 1.1 thorpej
33 1.10 sekiya /*
34 1.11 rumble * HPC locations are identical across all HPC-supported
35 1.11 rumble * platforms.
36 1.11 rumble */
37 1.11 rumble #define HPC_BASE_ADDRESS_0 0x1fb80000 /* Primary onboard */
38 1.11 rumble #define HPC_BASE_ADDRESS_1 0x1fb00000
39 1.11 rumble #define HPC_BASE_ADDRESS_2 0x1f980000
40 1.11 rumble #define HPC_BASE_ADDRESS_3 0x1f900000
41 1.11 rumble
42 1.11 rumble /*
43 1.10 sekiya * HPC3 descriptor layout.
44 1.10 sekiya */
45 1.1 thorpej struct hpc_dma_desc {
46 1.1 thorpej u_int32_t hdd_bufptr; /* Physical address of buffer */
47 1.1 thorpej u_int32_t hdd_ctl; /* Control flags and byte count */
48 1.1 thorpej u_int32_t hdd_descptr; /* Physical address of next descr. */
49 1.1 thorpej u_int32_t hdd_pad; /* Pad out to quadword alignment */
50 1.1 thorpej };
51 1.1 thorpej
52 1.1 thorpej /*
53 1.10 sekiya * The hdd_bufptr and hdd_ctl fields are swapped between HPC1 and
54 1.10 sekiya * HPC3. These fields are referenced by macro for readability.
55 1.10 sekiya */
56 1.10 sekiya #define hpc1_hdd_ctl hdd_bufptr
57 1.10 sekiya #define hpc1_hdd_bufptr hdd_ctl
58 1.10 sekiya #define hpc3_hdd_ctl hdd_ctl
59 1.10 sekiya #define hpc3_hdd_bufptr hdd_bufptr
60 1.10 sekiya
61 1.10 sekiya /*
62 1.1 thorpej * Control flags
63 1.1 thorpej */
64 1.1 thorpej #define HDD_CTL_EOCHAIN 0x80000000 /* End of descriptor chain */
65 1.1 thorpej #define HDD_CTL_EOPACKET 0x40000000 /* Ethernet: end of packet */
66 1.1 thorpej #define HDD_CTL_INTR 0x20000000 /* Interrupt when finished */
67 1.1 thorpej #define HDD_CTL_XMITDONE 0x00008000 /* Ethernet transmit done */
68 1.1 thorpej #define HDD_CTL_OWN 0x00004000 /* CPU owns this frame */
69 1.1 thorpej
70 1.1 thorpej #define HDD_CTL_BYTECNT(x) ((x) & 0x3fff) /* Byte count: for ethernet
71 1.1 thorpej * rcv channel also doubles as
72 1.5 simonb * length of packet received
73 1.1 thorpej */
74 1.1 thorpej
75 1.5 simonb /*
76 1.5 simonb * HPC memory map, as offsets from HPC base
77 1.1 thorpej *
78 1.1 thorpej * XXXrkb: should each section be used as a base and have the specific
79 1.5 simonb * registers offset from there??
80 1.1 thorpej *
81 1.1 thorpej * XXX: define register values as well as their offsets.
82 1.1 thorpej *
83 1.1 thorpej */
84 1.1 thorpej #define HPC_PBUS_DMAREGS 0x00000000 /* DMA registers for PBus */
85 1.1 thorpej #define HPC_PBUS_DMAREGS_SIZE 0x0000ffff /* channels 0 - 7 */
86 1.1 thorpej
87 1.6 lonewolf #define HPC_PBUS_CH0_BP 0x00000000 /* Chan 0 Buffer Ptr */
88 1.6 lonewolf #define HPC_PBUS_CH0_DP 0x00000004 /* Chan 0 Descriptor Ptr */
89 1.1 thorpej #define HPC_PBUS_CH0_CTL 0x00001000 /* Chan 0 Control Register */
90 1.1 thorpej
91 1.6 lonewolf #define HPC_PBUS_CH1_BP 0x00002000 /* Chan 1 Buffer Ptr */
92 1.6 lonewolf #define HPC_PBUS_CH1_DP 0x00002004 /* Chan 1 Descriptor Ptr */
93 1.1 thorpej #define HPC_PBUS_CH1_CTL 0x00003000 /* Chan 1 Control Register */
94 1.1 thorpej
95 1.6 lonewolf #define HPC_PBUS_CH2_BP 0x00004000 /* Chan 2 Buffer Ptr */
96 1.6 lonewolf #define HPC_PBUS_CH2_DP 0x00004004 /* Chan 2 Descriptor Ptr */
97 1.1 thorpej #define HPC_PBUS_CH2_CTL 0x00005000 /* Chan 2 Control Register */
98 1.1 thorpej
99 1.6 lonewolf #define HPC_PBUS_CH3_BP 0x00006000 /* Chan 3 Buffer Ptr */
100 1.6 lonewolf #define HPC_PBUS_CH3_DP 0x00006004 /* Chan 3 Descriptor Ptr */
101 1.1 thorpej #define HPC_PBUS_CH3_CTL 0x00007000 /* Chan 3 Control Register */
102 1.1 thorpej
103 1.6 lonewolf #define HPC_PBUS_CH4_BP 0x00008000 /* Chan 4 Buffer Ptr */
104 1.6 lonewolf #define HPC_PBUS_CH4_DP 0x00008004 /* Chan 4 Descriptor Ptr */
105 1.1 thorpej #define HPC_PBUS_CH4_CTL 0x00009000 /* Chan 4 Control Register */
106 1.1 thorpej
107 1.6 lonewolf #define HPC_PBUS_CH5_BP 0x0000a000 /* Chan 5 Buffer Ptr */
108 1.6 lonewolf #define HPC_PBUS_CH5_DP 0x0000a004 /* Chan 5 Descriptor Ptr */
109 1.1 thorpej #define HPC_PBUS_CH5_CTL 0x0000b000 /* Chan 5 Control Register */
110 1.1 thorpej
111 1.6 lonewolf #define HPC_PBUS_CH6_BP 0x0000c000 /* Chan 6 Buffer Ptr */
112 1.6 lonewolf #define HPC_PBUS_CH6_DP 0x0000c004 /* Chan 6 Descriptor Ptr */
113 1.1 thorpej #define HPC_PBUS_CH6_CTL 0x0000d000 /* Chan 6 Control Register */
114 1.1 thorpej
115 1.6 lonewolf #define HPC_PBUS_CH7_BP 0x0000e000 /* Chan 7 Buffer Ptr */
116 1.6 lonewolf #define HPC_PBUS_CH7_DP 0x0000e004 /* Chan 7 Descriptor Ptr */
117 1.1 thorpej #define HPC_PBUS_CH7_CTL 0x0000f000 /* Chan 7 Control Register */
118 1.1 thorpej
119 1.1 thorpej #define HPC_SCSI0_REGS 0x00010000 /* SCSI channel 0 registers */
120 1.1 thorpej #define HPC_SCSI0_REGS_SIZE 0x00001fff
121 1.1 thorpej
122 1.4 thorpej #define HPC_SCSI0_CBP 0x00000000 /* Current buffer ptr */
123 1.4 thorpej #define HPC_SCSI0_NDBP 0x00000004 /* Next descriptor ptr */
124 1.1 thorpej
125 1.4 thorpej #define HPC_SCSI0_BC 0x00001000 /* DMA byte count & flags */
126 1.4 thorpej #define HPC_SCSI0_CTL 0x00001004 /* DMA control flags */
127 1.4 thorpej #define HPC_SCSI0_GIO 0x00001008 /* GIO DMA FIFO pointer */
128 1.4 thorpej #define HPC_SCSI0_DEV 0x0000100c /* Device DMA FIFO pointer */
129 1.4 thorpej #define HPC_SCSI0_DMACFG 0x00001010 /* DMA configururation */
130 1.4 thorpej #define HPC_SCSI0_PIOCFG 0x00001014 /* PIO configururation */
131 1.1 thorpej
132 1.1 thorpej #define HPC_SCSI1_REGS 0x00012000 /* SCSI channel 1 registers */
133 1.1 thorpej #define HPC_SCSI1_REGS_SIZE 0x00001fff
134 1.1 thorpej
135 1.1 thorpej #define HPC_SCSI1_CBP 0x00000000 /* Current buffer ptr */
136 1.1 thorpej #define HPC_SCSI1_NDBP 0x00000004 /* Next descriptor ptr */
137 1.1 thorpej
138 1.1 thorpej #define HPC_SCSI1_BC 0x00001000 /* DMA byte count & flags */
139 1.1 thorpej #define HPC_SCSI1_CTL 0x00001004 /* DMA control flags */
140 1.1 thorpej #define HPC_SCSI1_GIO 0x00001008 /* GIO DMA FIFO pointer */
141 1.1 thorpej #define HPC_SCSI1_DEV 0x0000100c /* Device DMA FIFO pointer */
142 1.1 thorpej #define HPC_SCSI1_DMACFG 0x00001010 /* DMA configururation */
143 1.1 thorpej #define HPC_SCSI1_PIOCFG 0x00001014 /* PIO configururation */
144 1.3 wdk
145 1.6 lonewolf /* These are only valid for SCSI/ENETR, PBUS uses different definitions */
146 1.3 wdk #define HPC_DMACTL_IRQ 0x01 /* IRQ asserted, either dma done or parity */
147 1.3 wdk #define HPC_DMACTL_ENDIAN 0x02 /* DMA endian mode, 0=BE, 1=LE */
148 1.3 wdk #define HPC_DMACTL_DIR 0x04 /* DMA direction, 0=dev->mem, 1=mem->dev */
149 1.3 wdk #define HPC_DMACTL_FLUSH 0x08 /* Flush DMA FIFO's */
150 1.3 wdk #define HPC_DMACTL_ACTIVE 0x10 /* DMA channel is active */
151 1.3 wdk #define HPC_DMACTL_AMASK 0x20 /* DMA active inhibits PIO */
152 1.3 wdk #define HPC_DMACTL_RESET 0x40 /* Resets dma channel and external controller */
153 1.3 wdk #define HPC_DMACTL_PERR 0x80 /* Parity error on interface to controller */
154 1.3 wdk
155 1.6 lonewolf /* HPC_PBUS_CHx_CTL read: */
156 1.6 lonewolf #define HPC_PBUS_DMACTL_IRQ 0x01 /* IRQ asserted, DMA done */
157 1.7 lonewolf #define HPC_PBUS_DMACTL_ISACT 0x02 /* DMA channel is active */
158 1.6 lonewolf /* HPC_PBUS_CHx_CTL write: */
159 1.6 lonewolf #define HPC_PBUS_DMACTL_ENDIAN 0x02 /* DMA endianness, 0=BE 1=LE */
160 1.6 lonewolf #define HPC_PBUS_DMACTL_RECEIVE 0x04 /* DMA direction, 1=dev->mem, 0=mem->dev */
161 1.6 lonewolf #define HPC_PBUS_DMACTL_FLUSH 0x08 /* Flush DMA FIFO */
162 1.6 lonewolf #define HPC_PBUS_DMACTL_ACT 0x10 /* Activate DMA channel */
163 1.6 lonewolf #define HPC_PBUS_DMACTL_ACT_LD 0x20 /* Load enable for ACT */
164 1.6 lonewolf #define HPC_PBUS_DMACTL_RT 0x40 /* Enable real time GIO service for DMA */
165 1.6 lonewolf #define HPC_PBUS_DMACTL_HIGHWATER_SHIFT 8
166 1.6 lonewolf #define HPC_PBUS_DMACTL_FIFOBEG_SHIFT 16
167 1.6 lonewolf #define HPC_PBUS_DMACTL_FIFOEND_SHIFT 24
168 1.1 thorpej
169 1.1 thorpej #define HPC_ENET_REGS 0x00014000 /* Ethernet registers */
170 1.1 thorpej #define HPC_ENET_REGS_SIZE 0x00003fff
171 1.1 thorpej
172 1.1 thorpej #define HPC_ENETR_CBP 0x00000000 /* Recv: Current buffer ptr */
173 1.1 thorpej #define HPC_ENETR_NDBP 0x00000004 /* Recv: Next descriptor ptr */
174 1.1 thorpej
175 1.1 thorpej #define HPC_ENETR_BC 0x00001000 /* Recv: DMA byte cnt/flags */
176 1.1 thorpej #define HPC_ENETR_CTL 0x00001004 /* Recv: DMA control flags */
177 1.2 rafal
178 1.2 rafal #define ENETR_CTL_STAT_5_0 0x003f /* Seeq irq status: bits 0-5 */
179 1.2 rafal #define ENETR_CTL_STAT_6 0x0040 /* Irq status: late_rxdc */
180 1.2 rafal #define ENETR_CTL_STAT_7 0x0080 /* Irq status: old/new bit */
181 1.2 rafal #define ENETR_CTL_LENDIAN 0x0100 /* DMA channel endian mode */
182 1.2 rafal #define ENETR_CTL_ACTIVE 0x0200 /* DMA channel active? */
183 1.2 rafal #define ENETR_CTL_ACTIVE_MSK 0x0400 /* DMA channel active? */
184 1.2 rafal #define ENETR_CTL_RBO 0x0800 /* Recv buffer overflow */
185 1.2 rafal
186 1.1 thorpej #define HPC_ENETR_GIO 0x00001008 /* Recv: GIO DMA FIFO ptr */
187 1.1 thorpej #define HPC_ENETR_DEV 0x0000100c /* Recv: Device DMA FIFO ptr */
188 1.1 thorpej #define HPC_ENETR_RESET 0x00001014 /* Recv: Ethernet chip reset */
189 1.2 rafal
190 1.2 rafal #define ENETR_RESET_CH 0x0001 /* Reset controller & chan */
191 1.2 rafal #define ENETR_RESET_CLRINT 0x0002 /* Clear channel interrupt */
192 1.2 rafal #define ENETR_RESET_LOOPBK 0x0004 /* External loopback enable */
193 1.2 rafal #define ENETR_RESET_CLRRBO 0x0008 /* Clear RBO condition (??) */
194 1.2 rafal
195 1.1 thorpej #define HPC_ENETR_DMACFG 0x00001018 /* Recv: DMA configururation */
196 1.1 thorpej
197 1.2 rafal #define ENETR_DMACFG_D1 0x0000f /* DMA D1 state cycles */
198 1.2 rafal #define ENETR_DMACFG_D2 0x000f0 /* DMA D2 state cycles */
199 1.2 rafal #define ENETR_DMACFG_D3 0x00f00 /* DMA D3 state cycles */
200 1.2 rafal #define ENETR_DMACFG_WRCTL 0x01000 /* Enable IPG write */
201 1.2 rafal
202 1.5 simonb /*
203 1.5 simonb * The following three bits work around bugs in the Seeq 8003; if you
204 1.2 rafal * don't set them, the Seeq gets wonky pretty often.
205 1.2 rafal */
206 1.2 rafal #define ENETR_DMACFG_FIX_RXDC 0x02000 /* Clear EOP bits on RXDC */
207 1.2 rafal #define ENETR_DMACFG_FIX_EOP 0x04000 /* Enable rxintr timeout */
208 1.2 rafal #define ENETR_DMACFG_FIX_INTR 0x08000 /* Enable EOP timeout */
209 1.2 rafal #define ENETR_DMACFG_TIMO 0x30000 /* Timeout for above two */
210 1.2 rafal
211 1.1 thorpej #define HPC_ENETR_PIOCFG 0x0000101c /* Recv: PIO configururation */
212 1.1 thorpej
213 1.1 thorpej #define HPC_ENETX_CBP 0x00002000 /* Xmit: Current buffer ptr */
214 1.1 thorpej #define HPC_ENETX_NDBP 0x00002004 /* Xmit: Next descriptor ptr */
215 1.1 thorpej
216 1.1 thorpej #define HPC_ENETX_BC 0x00003000 /* Xmit: DMA byte cnt/flags */
217 1.1 thorpej #define HPC_ENETX_CTL 0x00003004 /* Xmit: DMA control flags */
218 1.2 rafal
219 1.2 rafal #define ENETX_CTL_STAT_5_0 0x003f /* Seeq irq status: bits 0-5 */
220 1.2 rafal #define ENETX_CTL_STAT_6 0x0040 /* Irq status: late_rxdc */
221 1.2 rafal #define ENETX_CTL_STAT_7 0x0080 /* Irq status: old/new bit */
222 1.2 rafal #define ENETX_CTL_LENDIAN 0x0100 /* DMA channel endian mode */
223 1.2 rafal #define ENETX_CTL_ACTIVE 0x0200 /* DMA channel active? */
224 1.2 rafal #define ENETX_CTL_ACTIVE_MSK 0x0400 /* DMA channel active? */
225 1.2 rafal #define ENETX_CTL_RBO 0x0800 /* Recv buffer overflow */
226 1.2 rafal
227 1.1 thorpej #define HPC_ENETX_GIO 0x00003008 /* Xmit: GIO DMA FIFO ptr */
228 1.1 thorpej #define HPC_ENETX_DEV 0x0000300c /* Xmit: Device DMA FIFO ptr */
229 1.1 thorpej
230 1.1 thorpej #define HPC_PBUS_FIFO 0x00020000 /* PBus DMA FIFO */
231 1.1 thorpej #define HPC_PBUS_FIFO_SIZE 0x00007fff /* PBus DMA FIFO size */
232 1.1 thorpej
233 1.1 thorpej #define HPC_SCSI0_FIFO 0x00028000 /* SCSI0 DMA FIFO */
234 1.1 thorpej #define HPC_SCSI0_FIFO_SIZE 0x00001fff /* SCSI0 DMA FIFO size */
235 1.1 thorpej
236 1.1 thorpej #define HPC_SCSI1_FIFO 0x0002a000 /* SCSI1 DMA FIFO */
237 1.1 thorpej #define HPC_SCSI1_FIFO_SIZE 0x00001fff /* SCSI1 DMA FIFO size */
238 1.1 thorpej
239 1.1 thorpej #define HPC_ENETR_FIFO 0x0002c000 /* Ether recv DMA FIFO */
240 1.1 thorpej #define HPC_ENETR_FIFO_SIZE 0x00001fff /* Ether recv DMA FIFO size */
241 1.1 thorpej
242 1.1 thorpej #define HPC_ENETX_FIFO 0x0002e000 /* Ether xmit DMA FIFO */
243 1.1 thorpej #define HPC_ENETX_FIFO_SIZE 0x00001fff /* Ether xmit DMA FIFO size */
244 1.1 thorpej
245 1.5 simonb /*
246 1.1 thorpej * HPCBUG: The interrupt status is split amongst two registers, and they're
247 1.1 thorpej * not even consecutive in the HPC address space. This is documented as a
248 1.1 thorpej * bug by SGI.
249 1.1 thorpej */
250 1.1 thorpej #define HPC_INTRSTAT_40 0x00030000 /* Interrupt stat, bits 4:0 */
251 1.1 thorpej #define HPC_INTRSTAT_95 0x0003000c /* Interrupt stat, bits 9:5 */
252 1.1 thorpej
253 1.1 thorpej #define HPC_GIO_MISC 0x00030004 /* GIO64 misc register */
254 1.1 thorpej
255 1.1 thorpej #define HPC_EEPROM_DATA 0x00030008 /* Serial EEPROM data reg. */
256 1.1 thorpej
257 1.1 thorpej #define HPC_GIO_BUSERR 0x00030010 /* GIO64 bus error intr stat */
258 1.1 thorpej
259 1.1 thorpej #define HPC_SCSI0_DEVREGS 0x00044000 /* SCSI channel 0 chip regs */
260 1.1 thorpej #define HPC_SCSI0_DEVREGS_SIZE 0x000003ff /* Size of chip registers */
261 1.1 thorpej
262 1.1 thorpej #define HPC_SCSI1_DEVREGS 0x0004c000 /* SCSI channel 1 chip regs */
263 1.1 thorpej #define HPC_SCSI1_DEVREGS_SIZE 0x000003ff /* Size of chip registers */
264 1.1 thorpej
265 1.1 thorpej #define HPC_ENET_DEVREGS 0x00054000 /* Ethernet chip registers */
266 1.1 thorpej #define HPC_ENET_DEVREGS_SIZE 0x000004ff /* Size of chip registers */
267 1.1 thorpej
268 1.1 thorpej #define HPC_PBUS_DEVREGS 0x00054000 /* PBus PIO chip registers */
269 1.1 thorpej #define HPC_PBUS_DEVREGS_SIZE 0x000003ff /* PBus PIO chip registers */
270 1.1 thorpej
271 1.1 thorpej #define HPC_PBUS_CH0_DEVREGS 0x00058000 /* PBus ch. 0 chip registers */
272 1.1 thorpej #define HPC_PBUS_CH0_DEVREGS_SIZE 0x03ff
273 1.1 thorpej
274 1.1 thorpej #define HPC_PBUS_CH1_DEVREGS 0x00058400 /* PBus ch. 1 chip registers */
275 1.1 thorpej #define HPC_PBUS_CH1_DEVREGS_SIZE 0x03ff
276 1.1 thorpej
277 1.1 thorpej #define HPC_PBUS_CH2_DEVREGS 0x00058800 /* PBus ch. 2 chip registers */
278 1.1 thorpej #define HPC_PBUS_CH2_DEVREGS_SIZE 0x03ff
279 1.1 thorpej
280 1.1 thorpej #define HPC_PBUS_CH3_DEVREGS 0x00058c00 /* PBus ch. 3 chip registers */
281 1.1 thorpej #define HPC_PBUS_CH3_DEVREGS_SIZE 0x03ff
282 1.1 thorpej
283 1.1 thorpej #define HPC_PBUS_CH4_DEVREGS 0x00059000 /* PBus ch. 4 chip registers */
284 1.1 thorpej #define HPC_PBUS_CH4_DEVREGS_SIZE 0x03ff
285 1.1 thorpej
286 1.1 thorpej #define HPC_PBUS_CH5_DEVREGS 0x00059400 /* PBus ch. 5 chip registers */
287 1.1 thorpej #define HPC_PBUS_CH5_DEVREGS_SIZE 0x03ff
288 1.1 thorpej
289 1.1 thorpej #define HPC_PBUS_CH6_DEVREGS 0x00059800 /* PBus ch. 6 chip registers */
290 1.1 thorpej #define HPC_PBUS_CH6_DEVREGS_SIZE 0x03ff
291 1.1 thorpej
292 1.1 thorpej #define HPC_PBUS_CH7_DEVREGS 0x00059c00 /* PBus ch. 7 chip registers */
293 1.1 thorpej #define HPC_PBUS_CH7_DEVREGS_SIZE 0x03ff
294 1.1 thorpej
295 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS 0x0005a000 /* PBus ch. 8 chip registers */
296 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_SIZE 0x03ff
297 1.1 thorpej
298 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS 0x0005a400 /* PBus ch. 9 chip registers */
299 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_SIZE 0x03ff
300 1.1 thorpej
301 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_2 0x0005a800 /* PBus ch. 8 chip registers */
302 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_2_SIZE 0x03ff
303 1.1 thorpej
304 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_2 0x0005ac00 /* PBus ch. 9 chip registers */
305 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_2_SIZE 0x03ff
306 1.1 thorpej
307 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_3 0x0005b000 /* PBus ch. 8 chip registers */
308 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_3_SIZE 0x03ff
309 1.1 thorpej
310 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_3 0x0005b400 /* PBus ch. 9 chip registers */
311 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_3_SIZE 0x03ff
312 1.1 thorpej
313 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_4 0x0005b800 /* PBus ch. 8 chip registers */
314 1.1 thorpej #define HPC_PBUS_CH8_DEVREGS_4_SIZE 0x03ff
315 1.1 thorpej
316 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_4 0x0005bc00 /* PBus ch. 9 chip registers */
317 1.1 thorpej #define HPC_PBUS_CH9_DEVREGS_4_SIZE 0x03ff
318 1.1 thorpej
319 1.1 thorpej #define HPC_PBUS_CFGDMA_REGS 0x0005c000 /* PBus DMA config registers */
320 1.5 simonb #define HPC_PBUS_CFGDMA_REGS_SIZE 0x0fff
321 1.1 thorpej
322 1.1 thorpej #define HPC_PBUS_CH0_CFGDMA 0x0005c000 /* PBus Ch. 0 DMA config */
323 1.5 simonb #define HPC_PBUS_CH0_CFGDMA_SIZE 0x01ff
324 1.1 thorpej
325 1.1 thorpej #define HPC_PBUS_CH1_CFGDMA 0x0005c200 /* PBus Ch. 1 DMA config */
326 1.5 simonb #define HPC_PBUS_CH1_CFGDMA_SIZE 0x01ff
327 1.1 thorpej
328 1.1 thorpej #define HPC_PBUS_CH2_CFGDMA 0x0005c400 /* PBus Ch. 2 DMA config */
329 1.5 simonb #define HPC_PBUS_CH2_CFGDMA_SIZE 0x01ff
330 1.1 thorpej
331 1.1 thorpej #define HPC_PBUS_CH3_CFGDMA 0x0005c600 /* PBus Ch. 3 DMA config */
332 1.5 simonb #define HPC_PBUS_CH3_CFGDMA_SIZE 0x01ff
333 1.1 thorpej
334 1.1 thorpej #define HPC_PBUS_CH4_CFGDMA 0x0005c800 /* PBus Ch. 4 DMA config */
335 1.5 simonb #define HPC_PBUS_CH4_CFGDMA_SIZE 0x01ff
336 1.1 thorpej
337 1.1 thorpej #define HPC_PBUS_CH5_CFGDMA 0x0005ca00 /* PBus Ch. 5 DMA config */
338 1.5 simonb #define HPC_PBUS_CH5_CFGDMA_SIZE 0x01ff
339 1.1 thorpej
340 1.1 thorpej #define HPC_PBUS_CH6_CFGDMA 0x0005cc00 /* PBus Ch. 6 DMA config */
341 1.5 simonb #define HPC_PBUS_CH6_CFGDMA_SIZE 0x01ff
342 1.1 thorpej
343 1.1 thorpej #define HPC_PBUS_CH7_CFGDMA 0x0005ce00 /* PBus Ch. 7 DMA config */
344 1.5 simonb #define HPC_PBUS_CH7_CFGDMA_SIZE 0x01ff
345 1.1 thorpej
346 1.1 thorpej #define HPC_PBUS_CFGPIO_REGS 0x0005d000 /* PBus PIO config registers */
347 1.1 thorpej #define HPC_PBUS_CFGPIO_REGS_SIZE 0x0fff
348 1.1 thorpej
349 1.1 thorpej #define HPC_PBUS_CH0_CFGPIO 0x0005d000 /* PBus Ch. 0 PIO config */
350 1.1 thorpej #define HPC_PBUS_CH1_CFGPIO 0x0005d100 /* PBus Ch. 1 PIO config */
351 1.1 thorpej #define HPC_PBUS_CH2_CFGPIO 0x0005d200 /* PBus Ch. 2 PIO config */
352 1.1 thorpej #define HPC_PBUS_CH3_CFGPIO 0x0005d300 /* PBus Ch. 3 PIO config */
353 1.1 thorpej #define HPC_PBUS_CH4_CFGPIO 0x0005d400 /* PBus Ch. 4 PIO config */
354 1.1 thorpej #define HPC_PBUS_CH5_CFGPIO 0x0005d500 /* PBus Ch. 5 PIO config */
355 1.1 thorpej #define HPC_PBUS_CH6_CFGPIO 0x0005d600 /* PBus Ch. 6 PIO config */
356 1.1 thorpej #define HPC_PBUS_CH7_CFGPIO 0x0005d700 /* PBus Ch. 7 PIO config */
357 1.1 thorpej #define HPC_PBUS_CH8_CFGPIO 0x0005d800 /* PBus Ch. 8 PIO config */
358 1.1 thorpej #define HPC_PBUS_CH9_CFGPIO 0x0005d900 /* PBus Ch. 9 PIO config */
359 1.1 thorpej #define HPC_PBUS_CH8_CFGPIO_2 0x0005da00 /* PBus Ch. 8 PIO config */
360 1.1 thorpej #define HPC_PBUS_CH9_CFGPIO_2 0x0005db00 /* PBus Ch. 9 PIO config */
361 1.1 thorpej #define HPC_PBUS_CH8_CFGPIO_3 0x0005dc00 /* PBus Ch. 8 PIO config */
362 1.1 thorpej #define HPC_PBUS_CH9_CFGPIO_3 0x0005dd00 /* PBus Ch. 9 PIO config */
363 1.1 thorpej #define HPC_PBUS_CH8_CFGPIO_4 0x0005de00 /* PBus Ch. 8 PIO config */
364 1.1 thorpej #define HPC_PBUS_CH9_CFGPIO_4 0x0005df00 /* PBus Ch. 9 PIO config */
365 1.1 thorpej
366 1.1 thorpej #define HPC_PBUS_PROM_WE 0x0005e000 /* PBus boot-prom write
367 1.5 simonb * enable register
368 1.1 thorpej */
369 1.1 thorpej
370 1.5 simonb #define HPC_PBUS_PROM_SWAP 0x0005e800 /* PBus boot-prom chip-select
371 1.1 thorpej * swap register
372 1.1 thorpej */
373 1.1 thorpej
374 1.1 thorpej #define HPC_PBUS_GEN_OUT 0x0005f000 /* PBus general-purpose output
375 1.5 simonb * register
376 1.1 thorpej */
377 1.1 thorpej
378 1.1 thorpej #define HPC_PBUS_BBRAM 0x00060000 /* PBus battery-backed RAM
379 1.5 simonb * external registers
380 1.1 thorpej */
381 1.8 sekiya
382 1.8 sekiya /* HPC1/HPC1.5 differs from HPC3 in several details. */
383 1.8 sekiya
384 1.9 sekiya #define HPC1_HDD_CTL_EOCHAIN 0x80000000 /* End of descriptor chain */
385 1.9 sekiya #define HPC1_HDD_CTL_EOPACKET 0x80000000 /* Ethernet: end of packet */
386 1.9 sekiya #define HPC1_HDD_CTL_INTR 0x00008000 /* Interrupt when finished */
387 1.9 sekiya #define HPC1_HDD_CTL_OWN 0x40000000 /* CPU owns this frame */
388 1.9 sekiya #define HPC1_HDD_CTL_BYTECNT(x) ((x) & 0x1fff) /* Byte count: for ethernet */
389 1.9 sekiya #define HPC1_BIGENDIAN 0x000000c0 /* Endianness:5 revision:2 */
390 1.9 sekiya #define HPC1_REVSHIFT 0x00000006 /* Revision rshft */
391 1.9 sekiya #define HPC1_REVMASK 0x00000003 /* Revision mask */
392 1.10 sekiya #define HPC1_REV15 0x00000001 /* HPC Revision 1.5 */
393 1.9 sekiya #define HPC1_SCSI0_REGS 0x00000088
394 1.9 sekiya #define HPC1_SCSI0_REGS_SIZE 0x00000018
395 1.9 sekiya #define HPC1_SCSI0_CBP 0x00000004 /* Current buffer ptr */
396 1.9 sekiya #define HPC1_SCSI0_NDBP 0x00000008 /* Next descriptor ptr */
397 1.9 sekiya #define HPC1_SCSI0_BC 0x00000000 /* DMA byte count & flags */
398 1.9 sekiya #define HPC1_SCSI0_CTL 0x0000000c /* DMA control flags */
399 1.9 sekiya #define HPC1_SCSI0_DEV 0x00000014 /* Device DMA FIFO pointer */
400 1.9 sekiya #define HPC1_SCSI0_DMACFG 0x00000010 /* DMA configuration */
401 1.9 sekiya #define HPC1_SCSI0_GIO 0x00001008 /* GIO DMA FIFO pointer */
402 1.9 sekiya #define HPC1_SCSI0_PIOCFG 0x00001014 /* PIO configuration */
403 1.9 sekiya #define HPC1_SCSI1_REGS 0x00012000 /* SCSI channel 1 registers */
404 1.9 sekiya #define HPC1_SCSI1_REGS_SIZE 0x00001fff
405 1.9 sekiya #define HPC1_SCSI1_CBP 0x00000000 /* Current buffer ptr */
406 1.9 sekiya #define HPC1_SCSI1_NDBP 0x00000004 /* Next descriptor ptr */
407 1.9 sekiya #define HPC1_SCSI1_BC 0x00001000 /* DMA byte count & flags */
408 1.9 sekiya #define HPC1_SCSI1_CTL 0x00001004 /* DMA control flags */
409 1.9 sekiya #define HPC1_SCSI1_GIO 0x00001008 /* GIO DMA FIFO pointer */
410 1.9 sekiya #define HPC1_SCSI1_DEV 0x0000100c /* Device DMA FIFO pointer */
411 1.9 sekiya #define HPC1_SCSI1_DMACFG 0x00001010 /* DMA configuration */
412 1.9 sekiya #define HPC1_SCSI1_PIOCFG 0x00001014 /* PIO configuration */
413 1.9 sekiya #define HPC1_DMACTL_RESET 0x01 /* Resets dma channel and external controller */
414 1.9 sekiya #define HPC1_DMACTL_FLUSH 0x02 /* Flush DMA FIFO's */
415 1.9 sekiya #define HPC1_DMACTL_DIR 0x10 /* DMA direction ~HPC3: 1=dev->mem, 0=mem->dev */
416 1.9 sekiya #define HPC1_DMACTL_ACTIVE 0x80 /* DMA channel is active */
417 1.9 sekiya #define HPC1_ENET_REGS 0x00000000 /* Ethernet registers */
418 1.9 sekiya #define HPC1_ENET_REGS_SIZE 0x00000100
419 1.9 sekiya #define HPC1_ENET_INTDELAY 0x0000002c /* Interrupt Delay Count */
420 1.9 sekiya #define HPC1_ENET_INTDELAYVAL 0x01000000
421 1.9 sekiya #define HPC1_ENETR_CBP 0x00000054 /* Recv: Current buffer ptr */
422 1.9 sekiya #define HPC1_ENETR_NDBP 0x00000050 /* Recv: Next descriptor ptr */
423 1.9 sekiya #define HPC1_ENETR_BC 0x00000048 /* Recv: DMA byte cnt/flags */
424 1.9 sekiya #define HPC1_ENETR_CTL 0x00000038 /* Recv: DMA control flags */
425 1.9 sekiya #define HPC1_ENETR_CTL_ACTIVE 0x00004000 /* DMA channel active? */
426 1.9 sekiya #define HPC1_ENETR_RESET 0x0000003c /* Recv: Ethernet chip reset */
427 1.9 sekiya #define HPC1_ENETR_RESET_CH 0x0001 /* Reset controller & chan */
428 1.9 sekiya #define HPC1_ENETR_RESET_CLRINT 0x0002 /* Clear channel interrupt */
429 1.9 sekiya #define HPC1_ENETR_RESET_LOOPBK 0x0004 /* External loopback enable */
430 1.9 sekiya #define HPC1_ENETR_RESET_CLRRBO 0x0008 /* Clear RBO condition (??) */
431 1.9 sekiya #define HPC1_ENETR_PIOCFG 0x0000101c /* Recv: PIO configuration */
432 1.9 sekiya #define HPC1_ENETX_CBP 0x00000020 /* Xmit: Current buffer ptr */
433 1.9 sekiya #define HPC1_ENETX_NDBP 0x00000010 /* Xmit: Next descriptor ptr */
434 1.9 sekiya #define HPC1_ENETX_CFXBP 0x00000024 /* Xmit: Current first buf */
435 1.9 sekiya #define HPC1_ENETX_PFXBP 0x00000028 /* Xmit: Prev. first buf */
436 1.9 sekiya #define HPC1_ENETX_BC 0x00000014 /* Xmit: DMA byte cnt/flags */
437 1.9 sekiya #define HPC1_ENETX_CTL 0x00000034 /* Xmit: DMA control flags */
438 1.9 sekiya #define HPC1_ENETX_CTL_ACTIVE 0x00400000
439 1.9 sekiya #define HPC1_ENETX_GIO 0x00003008 /* Xmit: GIO DMA FIFO ptr */
440 1.9 sekiya #define HPC1_ENETX_DEV 0x0000300c /* Xmit: Device DMA FIFO ptr */
441 1.9 sekiya #define HPC1_PBUS_FIFO 0x00020000 /* PBus DMA FIFO */
442 1.9 sekiya #define HPC1_PBUS_FIFO_SIZE 0x00007fff /* PBus DMA FIFO size */
443 1.9 sekiya #define HPC1_ENETR_FIFO 0x0002c000 /* Ether recv DMA FIFO */
444 1.9 sekiya #define HPC1_ENETR_FIFO_SIZE 0x00001fff /* Ether recv DMA FIFO size */
445 1.9 sekiya #define HPC1_ENETX_FIFO 0x0002e000 /* Ether xmit DMA FIFO */
446 1.9 sekiya #define HPC1_ENETX_FIFO_SIZE 0x00001fff /* Ether xmit DMA FIFO size */
447 1.9 sekiya #define HPC1_SCSI0_DEVREGS 0x0000011f
448 1.9 sekiya #define HPC1_SCSI0_DEVREGS_SIZE 0x00000008
449 1.9 sekiya #define HPC1_ENET_DEVREGS 0x00000100 /* Ethernet chip registers */
450 1.9 sekiya #define HPC1_ENET_DEVREGS_SIZE 0x00000020 /* Size of chip registers */
451 1.9 sekiya #define HPC1_PBUS_BBRAM 0x00000e00 /* PBus battery-backed RAM */
452 1.9 sekiya #define HPC1_LPT_REGS 0x000000a8 /* LPT HPC Registers */
453 1.9 sekiya #define HPC1_LPT_REGS_SIZE 0x00000018
454 1.9 sekiya #define HPC1_LPT_BC 0x00000000 /* Byte Count */
455 1.9 sekiya #define HPC1_LPT_CBP 0x00000004 /* Current Buffer Ptr */
456 1.9 sekiya #define HPC1_LPT_NDBP 0x00000008 /* Next Buffer Ptr */
457 1.9 sekiya #define HPC1_LPT_CTL 0x0000000c /* DMA Control Flags */
458 1.9 sekiya #define HPC1_LPT_DEV 0x00000010 /* DMA Fifo Ptr */
459 1.9 sekiya #define HPC1_LPT_DMACFG 0x00000014 /* DMA Configuration */
460 1.9 sekiya #define HPC1_LPT_DEVREGS 0x00000132 /* Ext. Parallel Registers */
461 1.9 sekiya #define HPC1_LPT_DEVREGS_SIZE 0x00000001 /* Size of External Registers */
462 1.9 sekiya #define HPC1_AUX_REGS 0x1fb801bc /* Serial EEPROM/LED Control */
463 1.9 sekiya #define HPC1_AUX_REGS_SIZE 0x00000001 /* One Byte */
464 1.9 sekiya #define HPC1_AUX_CONSLED 0x01 /* Console LED */
465 1.9 sekiya
466 1.1 thorpej #endif /* _ARCH_SGIMIPS_HPC_HPCREG_H_ */
467