tlsbreg.h revision 1.4 1 /* $NetBSD: tlsbreg.h,v 1.4 1998/07/08 00:45:52 mjacob 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 /* inclusive */
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 #define TLEPDERR 0x1540 /* C: DIGA error register */
139 #define TLEPMERR 0x1580 /* C: MMG error register */
140 #define TLDMCMD 0x1600 /* C: Data Mover Command */
141 #define TLDMADRA 0x1680 /* C: Data Mover Source */
142 #define TLDMADRB 0x16C0 /* C: Data Mover Destination */
143
144 /*
145 * Registers shared between TurboLaser nodes, offsets from the
146 * TurboLaser Broadcast Base.
147 */
148 #define TLPRIVATE 0x0000 /* CMI: private "global" space */
149 #define TLIPINTR 0x0040 /* C: Interprocessor Int. Register */
150 #define TLIOINTR4 0x0100 /* C: I/O Interrupt Register 4 */
151 #define TLIOINTR5 0x0140 /* C: I/O Interrupt Register 5 */
152 #define TLIOINTR6 0x0180 /* C: I/O Interrupt Register 6 */
153 #define TLIOINTR7 0x01c0 /* C: I/O Interrupt Register 7 */
154 #define TLIOINTR8 0x0200 /* C: I/O Interrupt Register 8 */
155 #define TLWSDQR4 0x0400 /* C: Win Spc Dcr Que Ctr Reg 4 */
156 #define TLWSDQR5 0x0440 /* C: Win Spc Dcr Que Ctr Reg 5 */
157 #define TLWSDQR6 0x0480 /* C: Win Spc Dcr Que Ctr Reg 6 */
158 #define TLWSDQR7 0x04c0 /* C: Win Spc Dcr Que Ctr Reg 7 */
159 #define TLWSDQR8 0x0500 /* C: Win Spc Dcr Que Ctr Reg 8 */
160 #define TLRMDQRX 0x0600 /* C: Mem Chan Dcr Que Ctr Reg X */
161 #define TLRMDQR8 0x0640 /* C: Mem Chan Dcr Que Ctr Reg 8 */
162 #define TLRDRD 0x0800 /* C: CSR Read Data Rtn Data Reg */
163 #define TLRDRE 0x0840 /* C: CSR Read Data Rtn Error Reg */
164 #define TLMCR 0x1880 /* M: Memory Control Register */
165
166 /*
167 * TLDEV - Device Register
168 *
169 * Access: R/W
170 *
171 * Notes:
172 * Register is loaded during initialization with information
173 * that identifies a node. A zero value indicates a non-initialized
174 * (slot empty) node.
175 *
176 * Bits 0-15 contain the hardware device type, bits 16-23
177 * the board's software revision, and bits 24-31 the board's
178 * hardware revision.
179 *
180 * The device type portion is laid out as follows:
181 *
182 * Bit 15: identifies a CPU
183 * Bit 14: identifies a memory board
184 * Bit 13: identifies an I/O board
185 * Bits 0-7: specify the ID of a node type
186 */
187 #define TLDEV_DTYPE_MASK 0x0000ffff
188 #define TLDEV_DTYPE_KFTHA 0x2000 /* KFTHA board, I/O */
189 #define TLDEV_DTYPE_KFTIA 0x2020 /* KFTIA board, I/O */
190 #define TLDEV_DTYPE_MS7CC 0x5000 /* Memory board */
191 #define TLDEV_DTYPE_SCPU4 0x8011 /* 1 CPU, 4mb cache */
192 #define TLDEV_DTYPE_SCPU16 0x8012 /* 1 CPU, 16mb cache */
193 #define TLDEV_DTYPE_DCPU4 0x8014 /* 2 CPU, 4mb cache */
194 #define TLDEV_DTYPE_DCPU16 0x8015 /* 2 CPU, 16mb cache */
195
196 #define TLDEV_DTYPE(_val) ((_val) & TLDEV_DTYPE_MASK)
197 # define TLDEV_ISCPU(_val) (TLDEV_DTYPE(_val) & 0x8000)
198 # define TLDEV_ISMEM(_val) (TLDEV_DTYPE(_val) & 0x4000)
199 # define TLDEV_ISIOPORT(_val) (TLDEV_DTYPE(_val) & 0x2000)
200 #define TLDEV_SWREV(_val) (((_val) >> 16) & 0xff)
201 #define TLDEV_HWREV(_val) (((_val) >> 24) & 0xff)
202
203 /*
204 * TLBER - Bus Error Register
205 *
206 * Access: R/W
207 *
208 * Notes:
209 * This register contains information about TLSB errors detected by
210 * nodes on the TLSB. The register will become locked when:
211 *
212 * * Any error occurs and the "lock on first error"
213 * bit of the Configuration Register is set.
214 *
215 * * Any bit other than 20-23 (DS0-DS3) becomes set.
216 *
217 * and will remain locked until either:
218 *
219 * * All bits in the TLBER are cleared.
220 *
221 * * The "lock on first error" bit is cleared.
222 *
223 * TLBER locking is intended for diagnosic purposes only, and
224 * not for general use.
225 */
226 #define TLBER_ATCE 0x00000001 /* Addr Transmit Ck Error */
227 #define TLBER_APE 0x00000002 /* Addr Parity Error */
228 #define TLBER_BAE 0x00000004 /* Bank Avail Violation Error */
229 #define TLBER_LKTO 0x00000008 /* Bank Lock Timeout */
230 #define TLBER_NAE 0x00000010 /* No Ack Error */
231 #define TLBER_RTCE 0x00000020 /* Read Transmit Ck Error */
232 #define TLBER_ACKTCE 0x00000040 /* Ack Transmit Ck Error */
233 #define TLBER_MMRE 0x00000080 /* Mem Mapping Register Error */
234 #define TLBER_FNAE 0x00000100 /* Fatal No Ack Error */
235 #define TLBER_REQDE 0x00000200 /* Request Deassertion Error */
236 #define TLBER_ATDE 0x00000400 /* Addredd Transmitter During Error */
237 #define TLBER_UDE 0x00010000 /* Uncorrectable Data Error */
238 #define TLBER_CWDE 0x00020000 /* Correctable Write Data Error */
239 #define TLBER_CRDE 0x00040000 /* Correctable Read Data Error */
240 #define TLBER_CRDE2 0x00080000 /* ...ditto... */
241 #define TLBER_DS0 0x00100000 /* Data Synd 0 */
242 #define TLBER_DS1 0x00200000 /* Data Synd 1 */
243 #define TLBER_DS2 0x00400000 /* Data Synd 2 */
244 #define TLBER_DS3 0x00800000 /* Data Synd 3 */
245 #define TLBER_DTDE 0x01000000 /* Data Transmitter During Error */
246 #define TLBER_FDTCE 0x02000000 /* Fatal Data Transmit Ck Error */
247 #define TLBER_UACKE 0x04000000 /* Unexpected Ack Error */
248 #define TLBER_ABTCE 0x08000000 /* Addr Bus Transmit Error */
249 #define TLBER_DCTCE 0x10000000 /* Data Control Transmit Ck Error */
250 #define TLBER_SEQE 0x20000000 /* Sequence Error */
251 #define TLBER_DSE 0x40000000 /* Data Status Error */
252 #define TLBER_DTO 0x80000000 /* Data Timeout Error */
253
254 /*
255 * TLCNR - Configuration Register
256 *
257 * Access: R/W
258 */
259 #define TLCNR_CWDD 0x00000001 /* Corr Write Data Err INTR Dis */
260 #define TLCNR_CRDD 0x00000002 /* Corr Read Data Err INTR Dis */
261 #define TLCNR_LKTOD 0x00000004 /* Bank Lock Timeout Disable */
262 #define TLCNR_DTOD 0x00000008 /* Data Timeout Disable */
263 #define TLCNR_STF_A 0x00001000 /* Self-Test Fail A */
264 #define TLCNR_STF_B 0x00002000 /* Self-Test Fail B */
265 #define TLCNR_HALT_A 0x00100000 /* Halt A */
266 #define TLCNR_HALT_B 0x00200000 /* Halt B */
267 #define TLCNR_RSTSTAT 0x10000000 /* Reset Status */
268 #define TLCNR_NRST 0x40000000 /* Node Reset */
269 #define TLCNR_LOFE 0x80000000 /* Lock On First Error */
270
271 #define TLCNR_NODE_MASK 0x000000f0 /* Node ID mask */
272 #define TLCNR_NODE_SHIFT 4
273
274 #define TLCNR_VCNT_MASK 0x00000f00 /* VCNT mask */
275 #define TLCNR_VCNT_SHIFT 8
276
277 /*
278 * TLVID - Virtual ID Register
279 *
280 * Access: R/W
281 *
282 * Notes:
283 * Virtual units can be CPUs or Memory boards. The units are
284 * are addressed using virtual IDs. These virtual IDs are assigned
285 * by writing to the TLVID register. The upper 24 bits of this
286 * register are reserved and must be written as `0'.
287 */
288 #define TLVID_VIDA_MASK 0x0000000f /* Virtual ID for unit 0 */
289 #define TLVID_VIDA_SHIFT 0
290
291 #define TLVID_VIDB_MASK 0x000000f0 /* Virtual ID for unit 1 */
292 #define TLVID_VIDB_SHIFT 4
293
294 /*
295 * TLMMRn - Memory Mapping Registers
296 *
297 * Access: W
298 *
299 * Notes:
300 * Contains mapping information for doing a bank-decode.
301 */
302 #define TLMMR_INTMASK 0x00000003 /* Valid bits in Interleave */
303 #define TLMMR_ADRMASK 0x000000f0 /* Valid bits in Address */
304 #define TLMMR_SBANK 0x00000800 /* Single-bank indicator */
305 #define TLMMR_VALID 0x80000000 /* Indicated mapping is valid */
306
307 #define TLMMR_INTLV_MASK 0x00000700 /* Mask for interleave value */
308 #define TLMMR_INTLV_SHIFT 8
309
310 #define TLMMR_ADDRESS_MASK 0x03fff000 /* Mask for address value */
311 #define TLMMR_ADDRESS_SHIFT 12
312
313 /*
314 * TLFADRn - Failing Address Registers
315 *
316 * Access: R/W
317 *
318 * Notes:
319 * These registers contain status information for a failed address.
320 * Not all nodes preserve this information. The validation bits
321 * indicate the validity of a given field.
322 */
323
324
325
326 /*
327 * (some of) TurboLaser CPU ADG error register defines.
328 */
329 #define TLEPAERR_IBOX_TMO 0x1800 /* window space read failed */
330 #define TLEPAERR_WSPC_RD 0x0600 /* window space read failed */
331
332 /*
333 * (some of) TurboLaser CPU DIGA error register defines.
334 */
335 #define TLEPDERR_GBTMO 0x4 /* GBus timeout */
336
337 /*
338 * Platform specific uncorrectable machine check logout frame.
339 */
340 struct tlsb_mchk_fatal {
341 u_int64_t rsvdheader;
342 u_int32_t tldev;
343 u_int32_t tlber;
344 u_int32_t tlcnr;
345 u_int32_t tlvid;
346 u_int32_t tlesr0;
347 u_int32_t tlesr1;
348 u_int32_t tlesr2;
349 u_int32_t tlesr3;
350 u_int32_t tlepaerr;
351 u_int32_t tlmodconfig;
352 u_int32_t tlepmerr;
353 u_int32_t tlepderr;
354 u_int32_t tlintrmask0;
355 u_int32_t tlintrmask1;
356 u_int32_t tlintrsum0;
357 u_int32_t tlintrsum1;
358 u_int32_t tlep_vmg;
359 u_int32_t spare[5];
360 };
361 /*
362 * Magic values from Digital Unix- if these bits are set in these
363 * registers in the fatal mcheck frame, then we *don't* take a look
364 * at system TLSB registers.
365 */
366 #define AERR_NO_TLSBSNAP 0x7B /* errors on bits TLEPAERR <6:3,1,0> */
367 #define DERR_NO_TLSBSNAP 0x07 /* errors on bits TLEPDERR <2:0> */
368 #define MERR_NO_TLSBSNAP 0x3F /* errors on bits TLEPMERR <5:0> */
369
370 /*
371 * Platform specific correctable machine check logout frame.
372 */
373 struct tlsb_mchk_soft {
374 u_int64_t rsvdheader;
375 u_int32_t tldev;
376 u_int32_t tlber;
377 u_int32_t tlesr0;
378 u_int32_t tlesr1;
379 u_int32_t tlesr2;
380 u_int32_t tlesr3;
381 };
382