1 /* $NetBSD: rpb.h,v 1.20 1998/04/15 00:47:33 mjacob Exp $ */
5 * Copyright (c) 1994, 1995, 1996 Carnegie-Mellon University.
8 * Author: Keith Bostic, Chris G. Demetriou
10 * Permission to use, copy, modify and distribute this software and
11 * its documentation is hereby granted, provided that both the copyright
12 * notice and this permission notice appear in all copies of the
13 * software, derivative works or modified versions, and any portions
14 * thereof, and that both notices appear in supporting documentation.
16 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
17 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
18 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
20 * Carnegie Mellon requests users of this software to return to
22 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
23 * School of Computer Science
24 * Carnegie Mellon University
25 * Pittsburgh PA 15213-3890
27 * any improvements or extensions that they make and grant Carnegie the
28 * rights to redistribute these changes.
32 * From DEC 3000 300/400/500/600/700/800/900 System Programmer's Manual,
37 * HWRPB (Hardware Restart Parameter Block).
39 #define HWRPB_ADDR 0x10000000 /* virtual address, at boot */
43 u_int64_t rpb_phys; /* 0: HWRPB phys. address. */
44 char rpb_magic[8]; /* 8: "HWRPB" (in ASCII) */
45 u_int64_t rpb_version; /* 10 */
46 u_int64_t rpb_size; /* 18: HWRPB size in bytes */
47 u_int64_t rpb_primary_cpu_id; /* 20 */
48 u_int64_t rpb_page_size; /* 28: (8192) */
49 u_int64_t rpb_phys_addr_size; /* 30: (34) */
50 u_int64_t rpb_max_asn; /* 38: (16) */
51 char rpb_ssn[16]; /* 40: only first 10 valid */
53 #define ST_ADU 1 /* Alpha Demo. Unit (?) */
54 #define ST_DEC_4000 2 /* "Cobra" (?) */
55 #define ST_DEC_7000 3 /* "Ruby" (?) */
56 #define ST_DEC_3000_500 4 /* "Flamingo" family (TC) */
57 #define ST_DEC_2000_300 6 /* "Jensen" (EISA/ISA) */
58 #define ST_DEC_3000_300 7 /* "Pelican" (TC) */
59 #define ST_AVALON_A12 8 /* XXX Avalon Multicomputer */
60 #define ST_DEC_2100_A500 9 /* "Sable" (?) */
61 #define ST_DEC_APXVME_64 10 /* "AXPvme" (VME?) */
62 #define ST_DEC_AXPPCI_33 11 /* "NoName" (PCI/ISA) */
63 #define ST_DEC_21000 12 /* "TurboLaser" (PCI/EISA) */
64 #define ST_DEC_2100_A50 13 /* "Avanti" (PCI/ISA) */
65 #define ST_DEC_MUSTANG 14 /* "Mustang" (?) */
66 #define ST_DEC_KN20AA 15 /* kn20aa (PCI/EISA) */
67 #define ST_DEC_1000 17 /* "Mikasa" (PCI/ISA?) */
68 #define ST_EB66 19 /* EB66 (PCI/ISA?) */
69 #define ST_EB64P 20 /* EB64+ (PCI/ISA?) */
70 #define ST_ALPHABOOK1 21 /* Alphabook (?) */
71 #define ST_DEC_4100 22 /* "Rawhide" (PCI/EISA) */
72 #define ST_DEC_EV45_PBP 23 /* "Lego" (?) */
73 #define ST_DEC_2100A_A500 24 /* "Lynx" (?) */
74 #define ST_EB164 26 /* EB164 (PCI/ISA) */
75 #define ST_DEC_1000A 27 /* "Noritake" (?) */
76 #define ST_DEC_ALPHAVME_224 28 /* "Cortex" (?) */
77 #define ST_DEC_550 30 /* "Miata" (PCI/ISA) */
78 #define ST_DEC_EV56_PBP 32 /* "Takara" (?) */
79 #define ST_DEC_ALPHAVME_320 33 /* "Yukon" (VME?) */
80 #define ST_DEC_6600 34 /* "Monet/Goldrush" */
82 u_int64_t rpb_type; /* 50: */
84 #define SV_MPCAP 0x00000001 /* multiprocessor capable */
86 #define SV_CONSOLE 0x0000001e /* console hardware mask */
87 #define SV_CONSOLE_DETACHED 0x00000002
88 #define SV_CONSOLE_EMBEDDED 0x00000004
90 #define SV_POWERFAIL 0x000000e0 /* powerfail mask */
91 #define SV_PF_UNITED 0x00000020
92 #define SV_PF_SEPARATE 0x00000040
93 #define SV_PF_BBACKUP 0x00000060
94 #define SV_PF_ACTION 0x00000100 /* powerfail restart */
96 #define SV_GRAPHICS 0x00000200 /* graphic engine present */
98 #define SV_ST_MASK 0x0000fc00 /* system type mask */
99 #define SV_ST_RESERVED 0x00000000 /* RESERVED */
102 * System types for the DEC 3000/500 (Flamingo) Family
104 #define SV_ST_SANDPIPER 0x00000400 /* Sandpiper; 3000/400 */
105 #define SV_ST_FLAMINGO 0x00000800 /* Flamingo; 3000/500 */
106 #define SV_ST_HOTPINK 0x00000c00 /* "Hot Pink"; 3000/500X */
107 #define SV_ST_FLAMINGOPLUS 0x00001000 /* Flamingo+; 3000/800 */
108 #define SV_ST_ULTRA 0x00001400 /* "Ultra", aka Flamingo+ */
109 #define SV_ST_SANDPLUS 0x00001800 /* Sandpiper+; 3000/600 */
110 #define SV_ST_SANDPIPER45 0x00001c00 /* Sandpiper45; 3000/700 */
111 #define SV_ST_FLAMINGO45 0x00002000 /* Flamingo45; 3000/900 */
116 #define SV_ST_SABLE 0x00000400 /* Sable (?) */
119 * System types for the DEC 3000/300 (Pelican) Family
121 #define SV_ST_PELICAN 0x00000000 /* Pelican; 3000/300 */
122 #define SV_ST_PELICA 0x00000400 /* Pelica; 3000/300L */
123 #define SV_ST_PELICANPLUS 0x00000800 /* Pelican+; 3000/300X */
124 #define SV_ST_PELICAPLUS 0x00000c00 /* Pelica+; 3000/300LX */
127 * System types for the AlphaStation Family
129 #define SV_ST_AVANTI 0x00000000 /* Avanti; 400 4/233 */
130 #define SV_ST_MUSTANG2_4_166 0x00000800 /* Mustang II; 200 4/166 */
131 #define SV_ST_MUSTANG2_4_233 0x00001000 /* Mustang II; 200 4/233 */
132 #define SV_ST_AVANTI_XXX 0x00001400 /* also Avanti; 400 4/233 */
133 #define SV_ST_AVANTI_4_266 0x00002000
134 #define SV_ST_MUSTANG2_4_100 0x00002400 /* Mustang II; 200 4/100 */
135 #define SV_ST_AVANTI_4_233 0x0000a800 /* AlphaStation 255/233 */
137 #define SV_ST_KN20AA 0x00000400 /* AlphaStation 500/600 */
140 * System types for the AXPvme Family
142 #define SV_ST_AXPVME_64 0x00000000 /* 21068, 64MHz */
143 #define SV_ST_AXPVME_160 0x00000400 /* 21066, 160MHz */
144 #define SV_ST_AXPVME_100 0x00000c00 /* 21066A, 99MHz */
145 #define SV_ST_AXPVME_230 0x00001000 /* 21066A, 231MHz */
146 #define SV_ST_AXPVME_66 0x00001400 /* 21066A, 66MHz */
147 #define SV_ST_AXPVME_166 0x00001800 /* 21066A, 165MHz */
148 #define SV_ST_AXPVME_264 0x00001c00 /* 21066A, 264MHz */
151 * System types for the EB164 Family
153 #define SV_ST_EB164_266 0x00000400 /* EB164, 266MHz */
154 #define SV_ST_EB164_300 0x00000800 /* EB164, 300MHz */
155 #define SV_ST_ALPHAPC164_366 0x00000c00 /* AlphaPC164, 366MHz */
156 #define SV_ST_ALPHAPC164_400 0x00001000 /* AlphaPC164, 400MHz */
157 #define SV_ST_ALPHAPC164_433 0x00001400 /* AlphaPC164, 433MHz */
158 #define SV_ST_ALPHAPC164_466 0x00001800 /* AlphaPC164, 466MHz */
159 #define SV_ST_ALPHAPC164_500 0x00001c00 /* AlphaPC164, 500MHz */
160 #define SV_ST_ALPHAPC164LX_400 0x00002000 /* AlphaPC164LX, 400MHz */
161 #define SV_ST_ALPHAPC164LX_466 0x00002400 /* AlphaPC164LX, 466MHz */
162 #define SV_ST_ALPHAPC164LX_533 0x00002800 /* AlphaPC164LX, 533MHz */
163 #define SV_ST_ALPHAPC164LX_600 0x00002c00 /* AlphaPC164LX, 600MHz */
164 #define SV_ST_ALPHAPC164SX_400 0x00003000 /* AlphaPC164SX, 400MHz */
165 #define SV_ST_ALPHAPC164SX_466 0x00003400 /* AlphaPC164SX, 433MHz */
166 #define SV_ST_ALPHAPC164SX_533 0x00003800 /* AlphaPC164SX, 533MHz */
167 #define SV_ST_ALPHAPC164SX_600 0x00003c00 /* AlphaPC164SX, 600MHz */
170 * System types for the Digital Personal Workstation (Miata) Family
171 * XXX These are not very complete!
173 #define SV_ST_MIATA_1_5 0x00004c00 /* Miata 1.5 */
175 u_int64_t rpb_variation; /* 58 */
177 char rpb_revision[8]; /* 60; only first 4 valid */
178 u_int64_t rpb_intr_freq; /* 68; scaled by 4096 */
179 u_int64_t rpb_cc_freq; /* 70: cycle cntr frequency */
180 vm_offset_t rpb_vptb; /* 78: */
181 u_int64_t rpb_reserved_arch; /* 80: */
182 vm_offset_t rpb_tbhint_off; /* 88: */
183 u_int64_t rpb_pcs_cnt; /* 90: */
184 u_int64_t rpb_pcs_size; /* 98; pcs size in bytes */
185 vm_offset_t rpb_pcs_off; /* A0: offset to pcs info */
186 u_int64_t rpb_ctb_cnt; /* A8: console terminal */
187 u_int64_t rpb_ctb_size; /* B0: ctb size in bytes */
188 vm_offset_t rpb_ctb_off; /* B8: offset to ctb */
189 vm_offset_t rpb_crb_off; /* C0: offset to crb */
190 vm_offset_t rpb_memdat_off; /* C8: memory data offset */
191 vm_offset_t rpb_condat_off; /* D0: config data offset */
192 vm_offset_t rpb_fru_off; /* D8: FRU table offset */
193 u_int64_t rpb_save_term; /* E0: terminal save */
194 u_int64_t rpb_save_term_val; /* E8: */
195 u_int64_t rpb_rest_term; /* F0: terminal restore */
196 u_int64_t rpb_rest_term_val; /* F8: */
197 u_int64_t rpb_restart; /* 100: restart */
198 u_int64_t rpb_restart_val; /* 108: */
199 u_int64_t rpb_reserve_os; /* 110: */
200 u_int64_t rpb_reserve_hw; /* 118: */
201 u_int64_t rpb_checksum; /* 120: HWRPB checksum */
202 u_int64_t rpb_rxrdy; /* 128: receive ready */
203 u_int64_t rpb_txrdy; /* 130: transmit ready */
204 vm_offset_t rpb_dsrdb_off; /* 138: HWRPB + DSRDB offset */
205 u_int64_t rpb_tbhint[8]; /* 149: TB hint block */
208 #define LOCATE_PCS(h,cpunumber) ((struct pcs *) \
209 ((char *)(h) + (h)->rpb_pcs_off + ((cpunumber) * (h)->rpb_pcs_size)))
212 * PCS: Per-CPU information.
215 u_int8_t pcs_hwpcb[128]; /* 0: PAL dependent */
217 #define PCS_BIP 0x000001 /* boot in progress */
218 #define PCS_RC 0x000002 /* restart possible */
219 #define PCS_PA 0x000004 /* processor available */
220 #define PCS_PP 0x000008 /* processor present */
221 #define PCS_OH 0x000010 /* user halted */
222 #define PCS_CV 0x000020 /* context valid */
223 #define PCS_PV 0x000040 /* PALcode valid */
224 #define PCS_PMV 0x000080 /* PALcode memory valid */
225 #define PCS_PL 0x000100 /* PALcode loaded */
227 #define PCS_HALT_REQ 0xff0000 /* halt request mask */
228 #define PCS_HALT_DEFAULT 0x000000
229 #define PCS_HALT_SAVE_EXIT 0x010000
230 #define PCS_HALT_COLD_BOOT 0x020000
231 #define PCS_HALT_WARM_BOOT 0x030000
232 #define PCS_HALT_STAY_HALTED 0x040000
233 #define PCS_mbz 0xffffffffff000000 /* 24:63 -- must be zero */
234 u_int64_t pcs_flags; /* 80: */
236 u_int64_t pcs_pal_memsize; /* 88: PAL memory size */
237 u_int64_t pcs_pal_scrsize; /* 90: PAL scratch size */
238 vm_offset_t pcs_pal_memaddr; /* 98: PAL memory addr */
239 vm_offset_t pcs_pal_scraddr; /* A0: PAL scratch addr */
242 minorrev : 8, /* alphabetic char 'a' - 'z' */
243 majorrev : 8, /* alphabetic char 'a' - 'z' */
244 #define PAL_TYPE_STANDARD 0
245 #define PAL_TYPE_VMS 1
246 #define PAL_TYPE_OSF1 2
247 pal_type : 8, /* PALcode type:
251 * 3-127 DIGITAL reserv.
252 * 128-255 non-DIGITAL reserv.
255 compatibility : 16, /* Compatibility revision */
256 proc_cnt : 16; /* Processor count */
257 } pcs_pal_rev; /* A8: */
258 #define pcs_minorrev pcs_pal_rev.minorrev
259 #define pcs_majorrev pcs_pal_rev.majorrev
260 #define pcs_pal_type pcs_pal_rev.pal_type
261 #define pcs_compatibility pcs_pal_rev.compatibility
262 #define pcs_proc_cnt pcs_pal_rev.proc_cnt
264 u_int64_t pcs_proc_type; /* B0: processor type */
266 #define PCS_PROC_MAJOR 0x00000000ffffffff
267 #define PCS_PROC_MAJORSHIFT 0
269 #define PCS_PROC_EV3 1 /* EV3 */
270 #define PCS_PROC_EV4 2 /* EV4: 21064 */
271 #define PCS_PROC_SIMULATION 3 /* Simulation */
272 #define PCS_PROC_LCA4 4 /* LCA4: 2106[68] */
273 #define PCS_PROC_EV5 5 /* EV5: 21164 */
274 #define PCS_PROC_EV45 6 /* EV45: 21064A */
275 #define PCS_PROC_EV56 7 /* EV56: 21164A */
276 #define PCS_PROC_EV6 8 /* EV6: 21264 */
277 #define PCS_PROC_PCA56 9 /* PCA256: 21164PC */
279 #define PCS_PROC_MINOR 0xffffffff00000000
280 #define PCS_PROC_MINORSHIFT 32
282 /* Minor number interpretation is processor specific. See cpu.c. */
284 u_int64_t pcs_proc_var; /* B8: processor variation. */
286 #define PCS_VAR_VAXFP 0x0000000000000001 /* VAX FP support */
287 #define PCS_VAR_IEEEFP 0x0000000000000002 /* IEEE FP support */
288 #define PCS_VAR_PE 0x0000000000000004 /* Primary Eligible */
289 #define PCS_VAR_RESERVED 0xfffffffffffffff8 /* Reserved */
291 char pcs_proc_revision[8]; /* C0: only first 4 valid */
292 char pcs_proc_sn[16]; /* C8: only first 10 valid */
293 vm_offset_t pcs_machcheck; /* D8: mach chk phys addr. */
294 u_int64_t pcs_machcheck_len; /* E0: length in bytes */
295 vm_offset_t pcs_halt_pcbb; /* E8: phys addr of halt PCB */
296 vm_offset_t pcs_halt_pc; /* F0: halt PC */
297 u_int64_t pcs_halt_ps; /* F8: halt PS */
298 u_int64_t pcs_halt_r25; /* 100: halt argument list */
299 u_int64_t pcs_halt_r26; /* 108: halt return addr list */
300 u_int64_t pcs_halt_r27; /* 110: halt procedure value */
302 #define PCS_HALT_RESERVED 0
303 #define PCS_HALT_POWERUP 1
304 #define PCS_HALT_CONSOLE_HALT 2
305 #define PCS_HALT_CONSOLE_CRASH 3
306 #define PCS_HALT_KERNEL_MODE 4
307 #define PCS_HALT_KERNEL_STACK_INVALID 5
308 #define PCS_HALT_DOUBLE_ERROR_ABORT 6
309 #define PCS_HALT_SCBB 7
310 #define PCS_HALT_PTBR 8 /* 9-FF: reserved */
311 u_int64_t pcs_halt_reason; /* 118: */
313 u_int64_t pcs_reserved_soft; /* 120: preserved software */
314 u_int64_t pcs_buffer[21]; /* 128: console buffers */
316 #define PALvar_reserved 0
317 #define PALvar_OpenVMS 1
318 #define PALvar_OSF1 2
319 u_int64_t pcs_palrevisions[16]; /* 1D0: PALcode revisions */
321 u_int64_t pcs_reserved_arch[6]; /* 250: reserved arch */
325 * CTB: Console Terminal Block
328 u_int64_t ctb_type; /* 0: always 4 */
329 u_int64_t ctb_unit; /* 8: */
330 u_int64_t ctb_reserved; /* 16: */
331 u_int64_t ctb_len; /* 24: bytes of info */
332 u_int64_t ctb_ipl; /* 32: console ipl level */
333 vm_offset_t ctb_tintr_vec; /* 40: transmit vec (0x800) */
334 vm_offset_t ctb_rintr_vec; /* 48: receive vec (0x800) */
336 #define CTB_GRAPHICS 3 /* graphics device */
337 #define CTB_NETWORK 0xC0 /* network device */
338 #define CTB_PRINTERPORT 2 /* printer port on the SCC */
339 u_int64_t ctb_term_type; /* 56: terminal type */
341 u_int64_t ctb_keybd_type; /* 64: keyboard nationality */
342 vm_offset_t ctb_keybd_trans; /* 72: trans. table addr */
343 vm_offset_t ctb_keybd_map; /* 80: map table addr */
344 u_int64_t ctb_keybd_state; /* 88: keyboard flags */
345 u_int64_t ctb_keybd_last; /* 96: last key entered */
346 vm_offset_t ctb_font_us; /* 104: US font table addr */
347 vm_offset_t ctb_font_mcs; /* 112: MCS font table addr */
348 u_int64_t ctb_font_width; /* 120: font width, height */
349 u_int64_t ctb_font_height; /* 128: in pixels */
350 u_int64_t ctb_mon_width; /* 136: monitor width, height */
351 u_int64_t ctb_mon_height; /* 144: in pixels */
352 u_int64_t ctb_dpi; /* 152: monitor dots per inch */
353 u_int64_t ctb_planes; /* 160: # of planes */
354 u_int64_t ctb_cur_width; /* 168: cursor width, height */
355 u_int64_t ctb_cur_height; /* 176: in pixels */
356 u_int64_t ctb_head_cnt; /* 184: # of heads */
357 u_int64_t ctb_opwindow; /* 192: opwindow on screen */
358 vm_offset_t ctb_head_offset; /* 200: offset to head info */
359 vm_offset_t ctb_putchar; /* 208: output char to TURBO */
360 u_int64_t ctb_io_state; /* 216: I/O flags */
361 u_int64_t ctb_listen_state; /* 224: listener flags */
362 vm_offset_t ctb_xaddr; /* 232: extended info addr */
363 u_int64_t ctb_turboslot; /* 248: TURBOchannel slot # */
364 u_int64_t ctb_server_off; /* 256: offset to server info */
365 u_int64_t ctb_line_off; /* 264: line parameter offset */
366 u_int8_t ctb_csd; /* 272: console specific data */
370 * CRD: Console Routine Descriptor
378 * CRB: Console Routine Block
381 struct crd *crb_v_dispatch; /* 0: virtual dispatch addr */
382 vm_offset_t crb_p_dispatch; /* 8: phys dispatch addr */
383 struct crd *crb_v_fixup; /* 10: virtual fixup addr */
384 vm_offset_t crb_p_fixup; /* 18: phys fixup addr */
385 u_int64_t crb_map_cnt; /* 20: phys/virt map entries */
386 u_int64_t crb_page_cnt; /* 28: pages to be mapped */
390 * MDDT: Memory Data Descriptor Table
393 int64_t mddt_cksum; /* 0: 7-N checksum */
394 vm_offset_t mddt_physaddr; /* 8: bank config addr
395 * IMPLEMENTATION SPECIFIC
397 u_int64_t mddt_cluster_cnt; /* 10: memory cluster count */
398 struct mddt_cluster {
399 vm_offset_t mddt_pfn; /* 0: starting PFN */
400 u_int64_t mddt_pg_cnt; /* 8: 8KB page count */
401 u_int64_t mddt_pg_test; /* 10: tested page count */
402 vm_offset_t mddt_v_bitaddr; /* 18: bitmap virt addr */
403 vm_offset_t mddt_p_bitaddr; /* 20: bitmap phys addr */
404 int64_t mddt_bit_cksum; /* 28: bitmap checksum */
406 #define MDDT_NONVOLATILE 0x10 /* cluster is non-volatile */
407 #define MDDT_PALCODE 0x01 /* console and PAL only */
408 #define MDDT_SYSTEM 0x00 /* system software only */
409 #define MDDT_mbz 0xfffffffffffffffc /* 2:63 -- must be zero */
410 int64_t mddt_usage; /* 30: bitmap permissions */
411 } mddt_clusters[1]; /* variable length array */
415 * DSR: Dynamic System Recognition. We're interested in the sysname
416 * offset. The data pointed to by sysname is:
418 * [8 bytes: length of system name][N bytes: system name string]
420 * The system name string is NUL-terminated.
423 int64_t dsr_smm; /* 0: SMM number */
424 u_int64_t dsr_lurt_off; /* 8: LURT table offset */
425 u_int64_t dsr_sysname_off; /* 16: offset to sysname */
429 * The DSR appeared in version 5 of the HWRPB.
431 #define HWRPB_DSRDB_MINVERS 5
433 #endif /* ASSEMBLER */