1 /* Layout and contents of the HardWare Resource Parameter Block (HWRPB). 2 3 This file is copied intact from the Linux kernel. As such, it is 4 covered by the GNU General Public License, v2.0. 5 6 You should have received a copy of the GNU General Public License 7 along with this program; see the file COPYING. If not see 8 <http://www.gnu.org/licenses/>. */ 9 10 #ifndef __ALPHA_HWRPB_H 11 #define __ALPHA_HWRPB_H 12 13 #define INIT_HWRPB ((struct hwrpb_struct *) 0x10000000) 14 15 /* 16 * DEC processor types for Alpha systems. Found in HWRPB. 17 * These values are architected. 18 */ 19 20 #define EV3_CPU 1 /* EV3 */ 21 #define EV4_CPU 2 /* EV4 (21064) */ 22 #define LCA4_CPU 4 /* LCA4 (21066/21068) */ 23 #define EV5_CPU 5 /* EV5 (21164) */ 24 #define EV45_CPU 6 /* EV4.5 (21064/xxx) */ 25 #define EV56_CPU 7 /* EV5.6 (21164) */ 26 #define EV6_CPU 8 /* EV6 (21264) */ 27 #define PCA56_CPU 9 /* PCA56 (21164PC) */ 28 #define PCA57_CPU 10 /* PCA57 (notyet) */ 29 #define EV67_CPU 11 /* EV67 (21264A) */ 30 #define EV68CB_CPU 12 /* EV68CB (21264C) */ 31 #define EV68AL_CPU 13 /* EV68AL (21264B) */ 32 #define EV68CX_CPU 14 /* EV68CX (21264D) */ 33 #define EV7_CPU 15 /* EV7 (21364) */ 34 #define EV79_CPU 16 /* EV79 (21364??) */ 35 #define EV69_CPU 17 /* EV69 (21264/EV69A) */ 36 37 /* 38 * DEC system types for Alpha systems. Found in HWRPB. 39 * These values are architected. 40 */ 41 42 #define ST_ADU 1 /* Alpha ADU systype */ 43 #define ST_DEC_4000 2 /* Cobra systype */ 44 #define ST_DEC_7000 3 /* Ruby systype */ 45 #define ST_DEC_3000_500 4 /* Flamingo systype */ 46 #define ST_DEC_2000_300 6 /* Jensen systype */ 47 #define ST_DEC_3000_300 7 /* Pelican systype */ 48 #define ST_DEC_2100_A500 9 /* Sable systype */ 49 #define ST_DEC_AXPVME_64 10 /* AXPvme system type */ 50 #define ST_DEC_AXPPCI_33 11 /* NoName system type */ 51 #define ST_DEC_TLASER 12 /* Turbolaser systype */ 52 #define ST_DEC_2100_A50 13 /* Avanti systype */ 53 #define ST_DEC_MUSTANG 14 /* Mustang systype */ 54 #define ST_DEC_ALCOR 15 /* Alcor (EV5) systype */ 55 #define ST_DEC_1000 17 /* Mikasa systype */ 56 #define ST_DEC_EB64 18 /* EB64 systype */ 57 #define ST_DEC_EB66 19 /* EB66 systype */ 58 #define ST_DEC_EB64P 20 /* EB64+ systype */ 59 #define ST_DEC_BURNS 21 /* laptop systype */ 60 #define ST_DEC_RAWHIDE 22 /* Rawhide systype */ 61 #define ST_DEC_K2 23 /* K2 systype */ 62 #define ST_DEC_LYNX 24 /* Lynx systype */ 63 #define ST_DEC_XL 25 /* Alpha XL systype */ 64 #define ST_DEC_EB164 26 /* EB164 systype */ 65 #define ST_DEC_NORITAKE 27 /* Noritake systype */ 66 #define ST_DEC_CORTEX 28 /* Cortex systype */ 67 #define ST_DEC_MIATA 30 /* Miata systype */ 68 #define ST_DEC_XXM 31 /* XXM systype */ 69 #define ST_DEC_TAKARA 32 /* Takara systype */ 70 #define ST_DEC_YUKON 33 /* Yukon systype */ 71 #define ST_DEC_TSUNAMI 34 /* Tsunami systype */ 72 #define ST_DEC_WILDFIRE 35 /* Wildfire systype */ 73 #define ST_DEC_CUSCO 36 /* CUSCO systype */ 74 #define ST_DEC_EIGER 37 /* Eiger systype */ 75 #define ST_DEC_TITAN 38 /* Titan systype */ 76 #define ST_DEC_MARVEL 39 /* Marvel systype */ 77 78 /* UNOFFICIAL!!! */ 79 #define ST_UNOFFICIAL_BIAS 100 80 #define ST_DTI_RUFFIAN 101 /* RUFFIAN systype */ 81 82 /* Alpha Processor, Inc. systems */ 83 #define ST_API_BIAS 200 84 #define ST_API_NAUTILUS 201 /* UP1000 systype */ 85 86 struct pcb_struct { 87 unsigned long ksp; 88 unsigned long usp; 89 unsigned long ptbr; 90 unsigned int pcc; 91 unsigned int asn; 92 unsigned long unique; 93 unsigned long flags; 94 unsigned long res1, res2; 95 }; 96 97 struct percpu_struct { 98 unsigned long hwpcb[16]; 99 unsigned long flags; 100 unsigned long pal_mem_size; 101 unsigned long pal_scratch_size; 102 unsigned long pal_mem_pa; 103 unsigned long pal_scratch_pa; 104 unsigned long pal_revision; 105 unsigned long type; 106 unsigned long variation; 107 unsigned long revision; 108 unsigned long serial_no[2]; 109 unsigned long logout_area_pa; 110 unsigned long logout_area_len; 111 unsigned long halt_PCBB; 112 unsigned long halt_PC; 113 unsigned long halt_PS; 114 unsigned long halt_arg; 115 unsigned long halt_ra; 116 unsigned long halt_pv; 117 unsigned long halt_reason; 118 unsigned long res; 119 unsigned long ipc_buffer[21]; 120 unsigned long palcode_avail[16]; 121 unsigned long compatibility; 122 unsigned long console_data_log_pa; 123 unsigned long console_data_log_length; 124 unsigned long bcache_info; 125 }; 126 127 struct procdesc_struct { 128 unsigned long weird_vms_stuff; 129 unsigned long address; 130 }; 131 132 struct vf_map_struct { 133 void *va; 134 unsigned long pa; 135 unsigned long count; 136 }; 137 138 struct crb_struct { 139 struct procdesc_struct * dispatch_va; 140 unsigned long dispatch_pa; 141 struct procdesc_struct * fixup_va; 142 unsigned long fixup_pa; 143 /* virtual->physical map */ 144 unsigned long map_entries; 145 unsigned long map_pages; 146 struct vf_map_struct map[1]; 147 }; 148 149 struct ctb_struct { 150 unsigned long type; 151 unsigned long unit; 152 unsigned long res0; 153 unsigned long len; 154 unsigned long ipl; 155 unsigned long tintr_vec; 156 unsigned long rintr_vec; 157 unsigned long term_type; 158 unsigned long keybd_type; 159 unsigned long keybd_trans; 160 unsigned long keybd_map; 161 unsigned long keybd_state; 162 unsigned long keybd_last; 163 unsigned long font_us; 164 unsigned long font_mcs; 165 unsigned long font_width; 166 unsigned long font_height; 167 unsigned long mon_width; 168 unsigned long mon_height; 169 unsigned long dpi; 170 unsigned long planes; 171 unsigned long cur_width; 172 unsigned long cur_height; 173 unsigned long head_cnt; 174 unsigned long opwindow; 175 unsigned long head_offset; 176 unsigned long putchar; 177 unsigned long io_state; 178 unsigned long listen_state; 179 unsigned long xaddr; 180 unsigned long turboslot; 181 unsigned long server_off; 182 unsigned long line_off; 183 unsigned char csd; 184 }; 185 186 #define CTB_NONE 0x00 187 #define CTB_PRINTERPORT 0x02 188 #define CTB_GRAPHICS 0x03 189 #define CTB_MULTIPURPOSE 0x04 190 191 /* 192 * Format of the Console Terminal Block MULTIPURPOSE `turboslot' field: 193 * 194 * 63 40 39 32 31 24 23 16 15 8 7 0 195 * | reserved | channel | hose | bus type | bus | slot | 196 */ 197 198 #define CTB_TURBOSLOT_TYPE_TC 0 /* TURBOchannel */ 199 #define CTB_TURBOSLOT_TYPE_ISA 1 /* ISA */ 200 #define CTB_TURBOSLOT_TYPE_EISA 2 /* EISA */ 201 #define CTB_TURBOSLOT_TYPE_PCI 3 /* PCI */ 202 203 struct memclust_struct { 204 unsigned long start_pfn; 205 unsigned long numpages; 206 unsigned long numtested; 207 unsigned long bitmap_va; 208 unsigned long bitmap_pa; 209 unsigned long bitmap_chksum; 210 unsigned long usage; 211 }; 212 213 struct memdesc_struct { 214 unsigned long chksum; 215 unsigned long optional_pa; 216 unsigned long numclusters; 217 struct memclust_struct cluster[0]; 218 }; 219 220 struct dsr_struct { 221 long smm; /* SMM nubber used by LMF */ 222 unsigned long lurt_off; /* offset to LURT table */ 223 unsigned long sysname_off; /* offset to sysname char count */ 224 }; 225 226 struct hwrpb_struct { 227 unsigned long phys_addr; /* check: physical address of the hwrpb */ 228 unsigned long id; /* check: "HWRPB\0\0\0" */ 229 unsigned long revision; 230 unsigned long size; /* size of hwrpb */ 231 unsigned long cpuid; 232 unsigned long pagesize; /* 8192, I hope */ 233 unsigned long pa_bits; /* number of physical address bits */ 234 unsigned long max_asn; 235 unsigned char ssn[16]; /* system serial number: big bother is watching */ 236 unsigned long sys_type; 237 unsigned long sys_variation; 238 unsigned long sys_revision; 239 unsigned long intr_freq; /* interval clock frequency * 4096 */ 240 unsigned long cycle_freq; /* cycle counter frequency */ 241 unsigned long vptb; /* Virtual Page Table Base address */ 242 unsigned long res1; 243 unsigned long tbhb_offset; /* Translation Buffer Hint Block */ 244 unsigned long nr_processors; 245 unsigned long processor_size; 246 unsigned long processor_offset; 247 unsigned long ctb_nr; 248 unsigned long ctb_size; /* console terminal block size */ 249 unsigned long ctbt_offset; /* console terminal block table offset */ 250 unsigned long crb_offset; /* console callback routine block */ 251 unsigned long mddt_offset; /* memory data descriptor table */ 252 unsigned long cdb_offset; /* configuration data block (or NULL) */ 253 unsigned long frut_offset; /* FRU table (or NULL) */ 254 void (*save_terminal)(unsigned long); 255 unsigned long save_terminal_data; 256 void (*restore_terminal)(unsigned long); 257 unsigned long restore_terminal_data; 258 void (*CPU_restart)(unsigned long); 259 unsigned long CPU_restart_data; 260 unsigned long res2; 261 unsigned long res3; 262 unsigned long chksum; 263 unsigned long rxrdy; 264 unsigned long txrdy; 265 unsigned long dsr_offset; /* "Dynamic System Recognition Data Block Table" */ 266 }; 267 268 269 static inline void hwrpb_update_checksum(struct hwrpb_struct * h)270hwrpb_update_checksum(struct hwrpb_struct *h) 271 { 272 unsigned long sum = 0, *l; 273 for (l = (unsigned long *) h; l < (unsigned long *) &h->chksum; ++l) 274 sum += *l; 275 h->chksum = sum; 276 } 277 278 #endif /* __ALPHA_HWRPB_H */ 279