tlsbreg.h revision 1.2 1 /* $NetBSD: tlsbreg.h,v 1.2 1997/03/12 21:11:09 cgd Exp $ */
2
3 /*
4 * Copyright (c) 1997 by Matthew Jacob
5 * NASA AMES Research Center.
6 * All rights reserved.
7 *
8 * Based in part upon a prototype version by Jason Thorpe
9 * Copyright (c) 1996 by Jason Thorpe.
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice immediately at the beginning of the file, without modification,
16 * this list of conditions, and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution.
20 * 3. The name of the author may not be used to endorse or promote products
21 * derived from this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
27 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 */
35
36 /*
37 * Definitions for the TurboLaser System Bus found on
38 * AlphaServer 8200/8400 systems.
39 */
40
41 /*
42 * There are 9 TurboLaser nodes, 0 though 8. Their uses are defined as
43 * follows:
44 *
45 * Node Module
46 * ---- ------
47 * 0 CPU, Memory
48 * 1 CPU, Memory
49 * 2 CPU, Memory
50 * 3 CPU, Memory
51 * 4 CPU, Memory, I/O
52 * 5 CPU, Memory, I/O
53 * 6 CPU, Memory, I/O
54 * 7 CPU, Memory, I/O
55 * 8 I/O
56 *
57 * A node occurs every 0x00400000 bytes.
58 *
59 * Note, the AlphaServer 8200 only has nodes 4 though 8.
60 */
61
62 #define TLSB_NODE_BASE 0x000000ff88000000 /* Dense */
63 #define TLSB_NODE_SIZE 0x00400000
64 #define TLSB_NODE_MAX 8
65
66 /* Translate a node number to an address. */
67 #define TLSB_NODE_ADDR(_node) \
68 (long)(TLSB_NODE_BASE + ((_node) * TLSB_NODE_SIZE))
69
70 #define TLSB_NODE_REG_ADDR(_node, _reg) \
71 KV((long)TLSB_NODE_ADDR((_node)) + (_reg))
72
73 /* Access the specified register on the specified node. */
74 #define TLSB_GET_NODEREG(_node, _reg) \
75 *(volatile u_int32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg)))
76 #define TLSB_PUT_NODEREG(_node, _reg, _val) \
77 *(volatile u_int32_t *)(TLSB_NODE_REG_ADDR((_node), (_reg))) = (_val)
78
79 /*
80 * Some registers are shared by all TurboLaser nodes, and appear in
81 * the TurboLaser Broadcast space.
82 */
83 #define TLSB_BCAST_BASE 0x000000ff8e000000 /* Dense */
84
85 #define TLSB_BCAST_REG_ADDR(_reg) KV((long)(TLSB_BCASE_BASE + (_reg)))
86
87 /* Access the specified register in the broadcast space. */
88 #define TLSB_GET_BCASTREG(_reg) \
89 *(volatile u_int32_t *)(TLSB_BCAST_REG_ADDR + (_reg))
90 #define TLSB_PUT_BCASTREG(_reg, _val) \
91 *(volatile u_int32_t *)(TLSB_BCAST_REG_ADDR + (_reg)) = (_val)
92
93 /*
94 * Location of the Gbus, the per-CPU bus containing the clock and
95 * console hardware.
96 */
97 #define TLSB_GBUS_BASE 0x000000ff90000000 /* Dense */
98
99 /*
100 * Note that not every module type supports each TurboLaser register.
101 * The following defines the keys used to denote module support for
102 * a given register:
103 *
104 * C Supported by CPU module
105 * M Supported by Memory module
106 * I Supported by I/O module
107 */
108
109 /*
110 * Per-node TurboLaser System Bus registers, offsets from the
111 * base of the node.
112 */
113 #define TLDEV 0x0000 /* CMI: Device Register */
114 #define TLBER 0x0040 /* CMI: Bus Error Register */
115 #define TLCNR 0x0080 /* CMI: Congfiguration Register */
116 #define TLVID 0x00c0 /* CM: Virtual ID Register */
117 #define TLMMR0 0x0200 /* CM: Memory Mapping Register 0 */
118 #define TLMMR1 0x0240 /* CM: Memory Mapping Register 1 */
119 #define TLMMR2 0x0280 /* CM: Memory Mapping Register 2 */
120 #define TLMMR3 0x02c0 /* CM: Memory Mapping Register 3 */
121 #define TLMMR4 0x0300 /* CM: Memory Mapping Register 4 */
122 #define TLMMR5 0x0340 /* CM: Memory Mapping Register 5 */
123 #define TLMMR6 0x0380 /* CM: Memory Mapping Register 6 */
124 #define TLMMR7 0x03c0 /* CM: Memory Mapping Register 7 */
125 #define TLFADR0 0x0600 /* MI: Failing Address Register 0 */
126 #define TLFADR1 0x0640 /* MI: Failing Address Register 1 */
127 #define TLESR0 0x0680 /* CMI: Error Syndrome Register 0 */
128 #define TLESR1 0x06c0 /* CMI: Error Syndrome Register 1 */
129 #define TLESR2 0x0700 /* CMI: Error Syndrome Register 2 */
130 #define TLESR3 0x0740 /* CMI: Error Syndrome Register 3 */
131 #define TLILID0 0x0a00 /* I: Int. Level 0 IDENT Register */
132 #define TLILID1 0x0a40 /* I: Int. Level 1 IDENT Register */
133 #define TLILID2 0x0a80 /* I: Int. Level 2 IDENT Register */
134 #define TLILID3 0x0ac0 /* I: Int. Level 3 IDENT Register */
135 #define TLCPUMASK 0x0b00 /* I: CPU Interrupt Mask Register */
136 #define TLMBPTR 0x0c00 /* I: Mailbox Pointer Register */
137 #define TLEPAERR 0x1500 /* C: ADG error register */
138
139 /*
140 * Registers shared between TurboLaser nodes, offsets from the
141 * TurboLaser Broadcast Base.
142 */
143 #define TLPRIVATE 0x0000 /* CMI: private "global" space */
144 #define TLIPINTR 0x0040 /* C: Interprocessor Int. Register */
145 #define TLIOINTR4 0x0100 /* C: I/O Interrupt Register 4 */
146 #define TLIOINTR5 0x0140 /* C: I/O Interrupt Register 5 */
147 #define TLIOINTR6 0x0180 /* C: I/O Interrupt Register 6 */
148 #define TLIOINTR7 0x01c0 /* C: I/O Interrupt Register 7 */
149 #define TLIOINTR8 0x0200 /* C: I/O Interrupt Register 8 */
150 #define TLWSDQR4 0x0400 /* C: Win Spc Dcr Que Ctr Reg 4 */
151 #define TLWSDQR5 0x0440 /* C: Win Spc Dcr Que Ctr Reg 5 */
152 #define TLWSDQR6 0x0480 /* C: Win Spc Dcr Que Ctr Reg 6 */
153 #define TLWSDQR7 0x04c0 /* C: Win Spc Dcr Que Ctr Reg 7 */
154 #define TLWSDQR8 0x0500 /* C: Win Spc Dcr Que Ctr Reg 8 */
155 #define TLRMDQRX 0x0600 /* C: Mem Chan Dcr Que Ctr Reg X */
156 #define TLRMDQR8 0x0640 /* C: Mem Chan Dcr Que Ctr Reg 8 */
157 #define TLRDRD 0x0800 /* C: CSR Read Data Rtn Data Reg */
158 #define TLRDRE 0x0840 /* C: CSR Read Data Rtn Error Reg */
159 #define TLMCR 0x1880 /* M: Memory Control Register */
160
161 /*
162 * TLDEV - Device Register
163 *
164 * Access: R/W
165 *
166 * Notes:
167 * Register is loaded during initialization with information
168 * that identifies a node. A zero value indicates a non-initialized
169 * (slot empty) node.
170 *
171 * Bits 0-15 contain the hardware device type, bits 16-23
172 * the board's software revision, and bits 24-31 the board's
173 * hardware revision.
174 *
175 * The device type portion is laid out as follows:
176 *
177 * Bit 15: identifies a CPU
178 * Bit 14: identifies a memory board
179 * Bit 13: identifies an I/O board
180 * Bits 0-7: specify the ID of a node type
181 */
182 #define TLDEV_DTYPE_MASK 0x0000ffff
183 #define TLDEV_DTYPE_KFTHA 0x2000 /* KFTHA board, I/O */
184 #define TLDEV_DTYPE_KFTIA 0x2020 /* KFTIA board, I/O */
185 #define TLDEV_DTYPE_MS7CC 0x5000 /* Memory board */
186 #define TLDEV_DTYPE_SCPU4 0x8011 /* 1 CPU, 4mb cache */
187 #define TLDEV_DTYPE_SCPU16 0x8012 /* 1 CPU, 16mb cache */
188 #define TLDEV_DTYPE_DCPU4 0x8014 /* 2 CPU, 4mb cache */
189 #define TLDEV_DTYPE_DCPU16 0x8015 /* 2 CPU, 16mb cache */
190
191 #define TLDEV_DTYPE(_val) ((_val) & TLDEV_DTYPE_MASK)
192 # define TLDEV_ISCPU(_val) (TLDEV_DTYPE(_val) & 0x8000)
193 # define TLDEV_ISMEM(_val) (TLDEV_DTYPE(_val) & 0x4000)
194 # define TLDEV_ISIOPORT(_val) (TLDEV_DTYPE(_val) & 0x2000)
195 #define TLDEV_SWREV(_val) (((_val) >> 16) & 0xff)
196 #define TLDEV_HWREV(_val) (((_val) >> 24) & 0xff)
197
198 /*
199 * TLBER - Bus Error Register
200 *
201 * Access: R/W
202 *
203 * Notes:
204 * This register contains information about TLSB errors detected by
205 * nodes on the TLSB. The register will become locked when:
206 *
207 * * Any error occurs and the "lock on first error"
208 * bit of the Configuration Register is set.
209 *
210 * * Any bit other than 20-23 (DS0-DS3) becomes set.
211 *
212 * and will remain locked until either:
213 *
214 * * All bits in the TLBER are cleared.
215 *
216 * * The "lock on first error" bit is cleared.
217 *
218 * TLBER locking is intended for diagnosic purposes only, and
219 * not for general use.
220 */
221 #define TLBER_ATCE 0x00000001 /* Addr Transmit Ck Error */
222 #define TLBER_APE 0x00000002 /* Addr Parity Error */
223 #define TLBER_BAE 0x00000004 /* Bank Avail Violation Error */
224 #define TLBER_LKTO 0x00000008 /* Bank Lock Timeout */
225 #define TLBER_NAE 0x00000010 /* No Ack Error */
226 #define TLBER_RTCE 0x00000020 /* Read Transmit Ck Error */
227 #define TLBER_ACKTCE 0x00000040 /* Ack Transmit Ck Error */
228 #define TLBER_MMRE 0x00000080 /* Mem Mapping Register Error */
229 #define TLBER_FNAE 0x00000100 /* Fatal No Ack Error */
230 #define TLBER_REQDE 0x00000200 /* Request Deassertion Error */
231 #define TLBER_ATDE 0x00000400 /* Addredd Transmitter During Error */
232 #define TLBER_UDE 0x00010000 /* Uncorrectable Data Error */
233 #define TLBER_CWDE 0x00020000 /* Correctable Write Data Error */
234 #define TLBER_CRDE 0x00040000 /* Correctable Read Data Error */
235 #define TLBER_CRDE2 0x00080000 /* ...ditto... */
236 #define TLBER_DS0 0x00100000 /* Data Synd 0 */
237 #define TLBER_DS1 0x00200000 /* Data Synd 1 */
238 #define TLBER_DS2 0x00400000 /* Data Synd 2 */
239 #define TLBER_DS3 0x00800000 /* Data Synd 3 */
240 #define TLBER_DTDE 0x01000000 /* Data Transmitter During Error */
241 #define TLBER_FDTCE 0x02000000 /* Fatal Data Transmit Ck Error */
242 #define TLBER_UACKE 0x04000000 /* Unexpected Ack Error */
243 #define TLBER_ABTCE 0x08000000 /* Addr Bus Transmit Error */
244 #define TLBER_DCTCE 0x10000000 /* Data Control Transmit Ck Error */
245 #define TLBER_SEQE 0x20000000 /* Sequence Error */
246 #define TLBER_DSE 0x40000000 /* Data Status Error */
247 #define TLBER_DTO 0x80000000 /* Data Timeout Error */
248
249 /*
250 * TLCNR - Configuration Register
251 *
252 * Access: R/W
253 */
254 #define TLCNR_CWDD 0x00000001 /* Corr Write Data Err INTR Dis */
255 #define TLCNR_CRDD 0x00000002 /* Corr Read Data Err INTR Dis */
256 #define TLCNR_LKTOD 0x00000004 /* Bank Lock Timeout Disable */
257 #define TLCNR_DTOD 0x00000008 /* Data Timeout Disable */
258 #define TLCNR_STF_A 0x00001000 /* Self-Test Fail A */
259 #define TLCNR_STF_B 0x00002000 /* Self-Test Fail B */
260 #define TLCNR_HALT_A 0x00100000 /* Halt A */
261 #define TLCNR_HALT_B 0x00200000 /* Halt B */
262 #define TLCNR_RSTSTAT 0x10000000 /* Reset Status */
263 #define TLCNR_NRST 0x40000000 /* Node Reset */
264 #define TLCNR_LOFE 0x80000000 /* Lock On First Error */
265
266 #define TLCNR_NODE_MASK 0x000000f0 /* Node ID mask */
267 #define TLCNR_NODE_SHIFT 4
268
269 #define TLCNR_VCNT_MASK 0x00000f00 /* VCNT mask */
270 #define TLCNR_VCNT_SHIFT 8
271
272 /*
273 * TLVID - Virtual ID Register
274 *
275 * Access: R/W
276 *
277 * Notes:
278 * Virtual units can be CPUs or Memory boards. The units are
279 * are addressed using virtual IDs. These virtual IDs are assigned
280 * by writing to the TLVID register. The upper 24 bits of this
281 * register are reserved and must be written as `0'.
282 */
283 #define TLVID_VIDA_MASK 0x0000000f /* Virtual ID for unit 0 */
284 #define TLVID_VIDA_SHIFT 0
285
286 #define TLVID_VIDB_MASK 0x000000f0 /* Virtual ID for unit 1 */
287 #define TLVID_VIDB_SHIFT 4
288
289 /*
290 * TLMMRn - Memory Mapping Registers
291 *
292 * Access: W
293 *
294 * Notes:
295 * Contains mapping information for doing a bank-decode.
296 */
297 #define TLMMR_INTMASK 0x00000003 /* Valid bits in Interleave */
298 #define TLMMR_ADRMASK 0x000000f0 /* Valid bits in Address */
299 #define TLMMR_SBANK 0x00000800 /* Single-bank indicator */
300 #define TLMMR_VALID 0x80000000 /* Indicated mapping is valid */
301
302 #define TLMMR_INTLV_MASK 0x00000700 /* Mask for interleave value */
303 #define TLMMR_INTLV_SHIFT 8
304
305 #define TLMMR_ADDRESS_MASK 0x03fff000 /* Mask for address value */
306 #define TLMMR_ADDRESS_SHIFT 12
307
308 /*
309 * TLFADRn - Failing Address Registers
310 *
311 * Access: R/W
312 *
313 * Notes:
314 * These registers contain status information for a failed address.
315 * Not all nodes preserve this information. The validation bits
316 * indicate the validity of a given field.
317 */
318
319