Commit | Line | Data |
---|---|---|
920dae64 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * Hypervisor Software File: error_defs.h | |
5 | * | |
6 | * Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. | |
7 | * | |
8 | * - Do no alter or remove copyright notices | |
9 | * | |
10 | * - Redistribution and use of this software in source and binary forms, with | |
11 | * or without modification, are permitted provided that the following | |
12 | * conditions are met: | |
13 | * | |
14 | * - Redistribution of source code must retain the above copyright notice, | |
15 | * this list of conditions and the following disclaimer. | |
16 | * | |
17 | * - Redistribution in binary form must reproduce the above copyright notice, | |
18 | * this list of conditions and the following disclaimer in the | |
19 | * documentation and/or other materials provided with the distribution. | |
20 | * | |
21 | * Neither the name of Sun Microsystems, Inc. or the names of contributors | |
22 | * may be used to endorse or promote products derived from this software | |
23 | * without specific prior written permission. | |
24 | * | |
25 | * This software is provided "AS IS," without a warranty of any kind. | |
26 | * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, | |
27 | * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A | |
28 | * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN | |
29 | * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR | |
30 | * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR | |
31 | * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN | |
32 | * OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR | |
33 | * FOR DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE | |
34 | * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, | |
35 | * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF | |
36 | * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. | |
37 | * | |
38 | * You acknowledge that this software is not designed, licensed or | |
39 | * intended for use in the design, construction, operation or maintenance of | |
40 | * any nuclear facility. | |
41 | * | |
42 | * ========== Copyright Header End ============================================ | |
43 | */ | |
44 | /* | |
45 | * Copyright 2007 Sun Microsystems, Inc. All rights reserved. | |
46 | * Use is subject to license terms. | |
47 | */ | |
48 | ||
49 | #ifndef _NIAGARA2_ERROR_DEFS_H | |
50 | #define _NIAGARA2_ERROR_DEFS_H | |
51 | ||
52 | #pragma ident "@(#)error_defs.h 1.5 07/08/17 SMI" | |
53 | ||
54 | #include <sys/htypes.h> | |
55 | #include <sun4v/errs_defs.h> | |
56 | #include <hprivregs.h> | |
57 | #include <config.h> | |
58 | #include <traps.h> | |
59 | #include <cache.h> | |
60 | #include <dram.h> | |
61 | #include <mmu.h> | |
62 | #include <errs_common.h> | |
63 | #include <vpiu_errs_defs.h> | |
64 | ||
65 | #ifdef __cplusplus | |
66 | extern "C" { | |
67 | #endif | |
68 | ||
69 | /* | |
70 | * Error flags for error table entry | |
71 | */ | |
72 | #define ERR_CE (1 << 0) /* correctable error */ | |
73 | #define ERR_UE (1 << 1) /* uncorrectable error */ | |
74 | /* | |
75 | * When ERR_FATAL is set, the hypervisor will never return to the | |
76 | * guest. Instead it will abort after performing its usual error | |
77 | * handling. | |
78 | */ | |
79 | #define ERR_FATAL (1 << 2) | |
80 | #define ERR_STRANDS_PARKED (1 << 3) /* strands parked */ | |
81 | /* | |
82 | * Set when a non-resumable error report (epkt) is to be sent | |
83 | * to the guest for this error type. Note that when this flag | |
84 | * is set, the field err_sun4v_rprt_type in the error_table entry | |
85 | * must be set to a vlaid value and cannot be set to SUN4v_NO_REPORT. | |
86 | */ | |
87 | #define ERR_NON_RESUMABLE (1 << 4) | |
88 | #define ERR_GL_STORED (1 << 5) /* check for GL saturation */ | |
89 | #define ERR_ISSUE_DONE (1 << 6) /* return using DONE */ | |
90 | #define ERR_CHECK_LINE_STATE (1 << 7) /* Check if L2$ line dirty, */ | |
91 | /* if yes - non-resumable */ | |
92 | #define ERR_USE_L2_CACHE_TABLE (1 << 8) /* Use the L2$ error table */ | |
93 | #define ERR_USE_SOC_TABLE (1 << 9) /* Use the SOC error table */ | |
94 | #define ERR_LAST_IN_TABLE (1 << 10) /* Last entry in error table */ | |
95 | #define ERR_IO_PROT (1 << 11) /* I/O protection peek/poke */ | |
96 | #define ERR_USE_DRAM_TABLE (1 << 12) /* Use the DRAM error table */ | |
97 | #define ERR_CLEAR_AMB_ERRORS (1 << 13) /* Clear AMB FBDIMM errors */ | |
98 | #define ERR_CHECK_DAU_TYPE (1 << 14) /* LDAU or DAU ? */ | |
99 | #define ERR_FORCE_SIR (1 << 15) /* Force SIR immediately */ | |
100 | #define ERR_ABORT_ASM (1 << 16) /* Abort from ASM code */ | |
101 | #define ERR_ABORT_C (1 << 17) /* Abort from C code */ | |
102 | #define ERR_NO_DRAM_DUMP (1 << 18) /* No dump or clear of DRAM */ | |
103 | /* ESRs and data */ | |
104 | #define ERR_CLEAR_SOC (1 << 19) /* Clear SOC ESRs */ | |
105 | ||
106 | /* | |
107 | * error flags for strand->err_flags | |
108 | * | |
109 | * STRAND_ERR_FLAG_L2DRAM[7:0] which L2/DRAM banks have a cyclic set | |
110 | * to re-enable CEEN for that bank | |
111 | * STRAND_ERR_FLAG_TICK_CMP[8:8] cyclic for CERER.TCCP/CERER.TCCD on | |
112 | * STRAND_ERR_FLAG_SOC[9:9] cyclic for SOC_ERROR_INTERRUPT_ENABLE on | |
113 | * STRAND_ERR_FLAG_ICACHE[10:10] cyclic for CERER I-Cache CEs | |
114 | * STRAND_ERR_FLAG_DCACHE[11:11] cyclic for CERER D-Cache CEs | |
115 | * STRAND_ERR_FLAG_DCACHE[12:12] cyclic for DERER DRAM CEs | |
116 | * STRAND_ERR_FLAG_PROTECTION[13:13] This error trap happened because we are | |
117 | * retrying an error condition under protection checking for | |
118 | * 'stuck-at' or 'false' error conditions. Treat the error as if | |
119 | * IO-protection was enabled. Note that this should only be used | |
120 | * for error conditions which cause precise traps. Disrupting traps | |
121 | * will be masked by PSTATE.IE while the hypervisor is executing. | |
122 | */ | |
123 | #define STRAND_ERR_FLAG_L2DRAM (1 << 0) | |
124 | #define STRAND_ERR_FLAG_TICK_CMP (1 << 8) | |
125 | #define STRAND_ERR_FLAG_SOC (1 << 9) | |
126 | #define STRAND_ERR_FLAG_ICACHE (1 << 10) | |
127 | #define STRAND_ERR_FLAG_DCACHE (1 << 11) | |
128 | #define STRAND_ERR_FLAG_DRAM (1 << 12) | |
129 | #define STRAND_ERR_FLAG_PROTECTION (1 << 13) | |
130 | ||
131 | /* | |
132 | * statically allocate max. FERG/SUN4V report buffers | |
133 | */ | |
134 | #define MAX_ERROR_REPORT_BUFS 8 | |
135 | ||
136 | /* | |
137 | * Sun4v guest error report types as per Sun4v Error Handling I/F | |
138 | * | |
139 | * We store the shift-value rather than the actual value to keep | |
140 | * within an 8-bit range | |
141 | */ | |
142 | #define SUN4V_NO_REPORT 0xff | |
143 | #define SUN4V_CPU_RPRT 0 /* (1 << 0) */ | |
144 | #define SUN4V_MEM_RPRT 1 /* (1 << 1) */ | |
145 | #define SUN4V_PIO_RPRT 2 /* (1 << 2) */ | |
146 | #define SUN4V_IRF_RPRT 3 /* (1 << 3) */ | |
147 | #define SUN4V_FRF_RPRT 4 /* (1 << 4) */ | |
148 | #define SUN4V_SHT_RPRT 5 /* (1 << 5) */ | |
149 | #define SUN4V_ASR_RPRT 6 /* (1 << 6) */ | |
150 | #define SUN4V_ASI_RPRT 7 /* (1 << 7) */ | |
151 | #define SUN4V_PREG_RPRT 8 /* (1 << 8) */ | |
152 | ||
153 | /* | |
154 | * Invalid Real Address | |
155 | */ | |
156 | #define ERR_INVALID_RA (-1) | |
157 | ||
158 | /* | |
159 | * PCI-E error interrupt to guest | |
160 | */ | |
161 | #define SUN4V_PCIE_RPRT 0xfe | |
162 | ||
163 | /* | |
164 | * Error Descriptor values | |
165 | */ | |
166 | #define EDESC_UNDEF 0x0 | |
167 | #define EDESC_UE_RESUMABLE 0x1 | |
168 | #define EDESC_PRECISE_NONRESUMABLE 0x2 | |
169 | #define EDESC_DEFERRED_NONRESUMABLE 0x3 | |
170 | #define EDESC_WARN_RESUMABLE 0x4 /* Shutdown Warning */ | |
171 | ||
172 | #define EDESC_TYPE_SHIFT 0 | |
173 | #define EDESC_TYPE_MASK 0xf | |
174 | ||
175 | /* | |
176 | * The Sun4v error interface specification requires bit[15] of | |
177 | * the REG value to be set to indicate a valid register value. | |
178 | */ | |
179 | #define SUN4V_VALID_REG (1 << 15) | |
180 | ||
181 | /* | |
182 | * The Sun4v error report MODE, bits [25:24] of the ATTR field | |
183 | * 1 User mode | |
184 | * 2 Privileged mode | |
185 | */ | |
186 | #define ATTR_USER_MODE 1 | |
187 | #define ATTR_PRIV_MODE 2 | |
188 | #define ATTR_MODE_SHIFT 24 | |
189 | ||
190 | /* | |
191 | * N2 error types used to identify the service report type to the FERG | |
192 | */ | |
193 | #define SER_TYPE_UNDEF 0x0 /* Unknown */ | |
194 | #define SER_TYPE_ITLB 0x1 /* I-TLB errors */ | |
195 | #define SER_TYPE_DTLB 0x2 /* D-TLB errors */ | |
196 | #define SER_TYPE_L1C 0x3 /* I-Cache/D-Cache errors */ | |
197 | /* | |
198 | * Internal Processor Errors including | |
199 | * IRF/FRF/Store Buffer/Scratchpad/Tick_compare | |
200 | * Trap Stack Array/MMU Register Array/ | |
201 | * Modular Arithmetic MEMory/Stream Processing Unit | |
202 | */ | |
203 | #define SER_TYPE_CMP 0x4 | |
204 | #define SER_TYPE_L2C 0x5 /* L2 Cache errors */ | |
205 | #define SER_TYPE_DRAM 0x6 /* DRAM errors */ | |
206 | /* Boot ROM Interface errors */ | |
207 | #define SER_TYPE_SSI 0x7 | |
208 | /* System-On-Chip Errors */ | |
209 | #define SER_TYPE_SOC 0x8 | |
210 | #define SER_TYPE_ABORT 0xf /* Hypervisor software abort */ | |
211 | ||
212 | #define SER_TYPE_SHIFT 4 | |
213 | #define SER_TYPE_MASK 0xf | |
214 | ||
215 | /* | |
216 | * Offsets for the various fields on the sun4v ereport sent to | |
217 | * the guest as specified by the Sun4v Hypervisor Error Handling | |
218 | * Interface. We define these separately as there is no quarantee | |
219 | * that we will use an identical struct to store the data locally. | |
220 | */ | |
221 | #define SUN4V_EHDL_OFFSET 0x0 | |
222 | #define SUN4V_TICK_OFFSET 0x8 | |
223 | #define SUN4V_DESC_OFFSET 0x10 | |
224 | #define SUN4V_ATTR_OFFSET 0x14 | |
225 | #define SUN4V_ADDR_OFFSET 0x18 | |
226 | #define SUN4V_SZ_OFFSET 0x20 | |
227 | #define SUN4V_CPUID_OFFSET 0x24 | |
228 | #define SUN4V_SECS_OFFSET 0x26 | |
229 | #define SUN4V_ASI_OFFSET 0x28 | |
230 | #define SUN4V_REG_OFFSET 0x2a | |
231 | #define SUN4V_PAD0_OFFSET 0x2c | |
232 | #define SUN4V_PAD1_OFFSET 0x30 | |
233 | #define SUN4V_PAD2_OFFSET 0x38 | |
234 | ||
235 | #define ERR_NAMELEN 16 | |
236 | #define ERPT_MEM_SIZE L2_LINE_SIZE /* for MEM sun4v reports */ | |
237 | ||
238 | #ifndef TRUE | |
239 | #define TRUE 1 | |
240 | #endif | |
241 | #ifndef FALSE | |
242 | #define FALSE 0 | |
243 | #endif | |
244 | ||
245 | #define REPORT_BUF_FREE 0 /* available for use */ | |
246 | #define REPORT_BUF_IN_USE 1 /* awaiting transmission */ | |
247 | #define REPORT_BUF_PENDING 2 /* data being collected */ | |
248 | ||
249 | /* | |
250 | * For PCI-E error report DESC field | |
251 | * Block Op Phase Cond Dir Flags | |
252 | * 31:28 27:24 23:20 19:16 15:12 11:0 | |
253 | */ | |
254 | #define ERR_SUN4V_PCIE_DESC_FLAGS_SHIFT 0 | |
255 | #define ERR_SUN4V_PCIE_DESC_DIR_SHIFT 12 | |
256 | #define ERR_SUN4V_PCIE_DESC_COND_SHIFT 16 | |
257 | #define ERR_SUN4V_PCIE_DESC_PHASE_SHIFT 20 | |
258 | #define ERR_SUN4V_PCIE_DESC_OP_SHIFT 24 | |
259 | #define ERR_SUN4V_PCIE_DESC_BLOCK_SHIFT 28 | |
260 | ||
261 | /* | |
262 | * The valid DESC field contents are defined in the document | |
263 | * PCI-Express Root Complex Error Handling Interfaces for Sun4v | |
264 | * | |
265 | * DESC | |
266 | * +--------------------------------------+ | |
267 | * |Block| Op| Phase| Cond| Dir| Flags | | |
268 | * |31:28|27:24| 23:20|19:16|15:12| 11:0 | | |
269 | * +--------------------------------------+ | |
270 | */ | |
271 | #define ERR_PCIE_ERPT_DESC(block, op, phase, cond, dir, flags) \ | |
272 | ((block << ERR_SUN4V_PCIE_DESC_BLOCK_SHIFT) | \ | |
273 | (op << ERR_SUN4V_PCIE_DESC_OP_SHIFT) | \ | |
274 | (phase << ERR_SUN4V_PCIE_DESC_PHASE_SHIFT) | \ | |
275 | (cond << ERR_SUN4V_PCIE_DESC_COND_SHIFT) | \ | |
276 | (dir << ERR_SUN4V_PCIE_DESC_DIR_SHIFT) | \ | |
277 | (flags << ERR_SUN4V_PCIE_DESC_FLAGS_SHIFT)) | |
278 | ||
279 | /* | |
280 | * Size of version + info string for abort SER | |
281 | */ | |
282 | #define ABORT_VERSION_INFO_SIZE 64 | |
283 | ||
284 | #ifdef TCA_ECC_ERRATA | |
285 | /* | |
286 | * The TCA diagnostic registers do not return the correct data. | |
287 | * The only option for correcting errors in the TCA is to write | |
288 | * some valid value which will cause an interrupt to be generated. | |
289 | * The interrupt handler must determine whether the interrupt is | |
290 | * spurious. | |
291 | */ | |
292 | #define ERR_TCA_INCREMENT 0x2000 /* ticks */ | |
293 | #endif | |
294 | ||
295 | #ifndef _ASM | |
296 | ||
297 | #define null_fcn (0) | |
298 | ||
299 | ||
300 | /* | |
301 | * Every error will have an error table entry in one of | |
302 | * the error_tables. The error_tables correspond to the | |
303 | * ESRs, so we have sfsr_errors, dsfsr_error, l2_esr_errors, | |
304 | * dfesr_errors, desr_errors | |
305 | */ | |
306 | ||
307 | typedef struct error_table_entry { | |
308 | /* | |
309 | * name of the error from PRM. Used for printing | |
310 | * debug data. | |
311 | */ | |
312 | char err_name[ERR_NAMELEN]; | |
313 | /* | |
314 | * Pointer to function which loads the error-specific | |
315 | * data for this error. If this is non-NULL, a diag_buf | |
316 | * will be allocated to the error and generic error data | |
317 | * stored before calling this function. | |
318 | */ | |
319 | void (*err_report_fcn)(void); | |
320 | /* | |
321 | * Pointer to function which loads the error-specific | |
322 | * sun4v guest report data for this error. | |
323 | */ | |
324 | void (*err_guest_report_fcn)(void); | |
325 | ||
326 | /* | |
327 | * Pointer to function which performs the error-specific | |
328 | * correction for this error. If this is non-NULL, | |
329 | * the function will be called after the report data is | |
330 | * collected. | |
331 | * | |
332 | * Note: This function should clear the ESR for the error | |
333 | */ | |
334 | void (*err_correct_fcn)(void); | |
335 | ||
336 | /* | |
337 | * If this error can cause storms, we will defer re-enabling | |
338 | * the error for a short interval. This function will be passed | |
339 | * to the cyclic system for dealing with a storm. | |
340 | */ | |
341 | void (*err_storm_fcn)(void); | |
342 | ||
343 | /* | |
344 | * function to dump out the error-specific data for DEBUG | |
345 | */ | |
346 | void (*err_print_fcn)(void); | |
347 | ||
348 | /* | |
349 | * flags for this error type, see above | |
350 | */ | |
351 | uint32_t err_flags; | |
352 | ||
353 | /* | |
354 | * If this is set, a Sun4v guest report will be sent | |
355 | * corresponding to the type. | |
356 | */ | |
357 | uint8_t err_sun4v_rprt_type; | |
358 | ||
359 | /* | |
360 | * bits[3:0] Error descriptor value for sun4v guest report | |
361 | * bits[7:4] Service report type for FERG | |
362 | */ | |
363 | uint8_t err_sun4v_edesc; | |
364 | ||
365 | /* | |
366 | * Size of Service Error Report for this error type | |
367 | */ | |
368 | uint32_t err_report_size; | |
369 | ||
370 | } error_table_entry_t; | |
371 | ||
372 | ||
373 | /* | |
374 | * structs for storing diagnostic data | |
375 | */ | |
376 | ||
377 | struct err_way { | |
378 | uint64_t err_tag_and_ecc; /* tag and ecc */ | |
379 | uint64_t err_data_and_ecc[L2_NUM_WAYS]; /* data and ecc */ | |
380 | }; | |
381 | ||
382 | struct err_l2 { | |
383 | uint64_t err_vdbits; /* parity, valid, dirty */ | |
384 | uint64_t err_uabits; /* APARITY | USED bits | ALLOC bits */ | |
385 | struct err_way err_ways[L2_NUM_WAYS]; /* info on all ways */ | |
386 | uint64_t dram_contents[N_LONG_IN_LINE]; | |
387 | }; | |
388 | ||
389 | /* | |
390 | * Size of dram_content[] in bytes | |
391 | */ | |
392 | #define ERR_DRAM_CONTENTS_SIZE (N_LONG_IN_LINE * SIZEOF_UI64) | |
393 | ||
394 | struct err_tlb { | |
395 | uint64_t err_tlb_tag; /* TLB tag */ | |
396 | uint64_t err_tlb_data; /* TLB data */ | |
397 | }; | |
398 | ||
399 | struct err_icache_way { | |
400 | uint64_t err_icache_instr[ICACHE_NUM_OF_WORDS]; | |
401 | uint64_t err_icache_tag; | |
402 | }; | |
403 | struct err_icache { | |
404 | struct err_icache_way err_icache_way[MAX_ICACHE_WAYS]; | |
405 | }; | |
406 | ||
407 | struct err_dcache_way { | |
408 | uint64_t err_dcache_data[DCACHE_NUM_OF_WORDS]; | |
409 | uint64_t err_dcache_tag; | |
410 | }; | |
411 | struct err_dcache { | |
412 | struct err_dcache_way err_dcache_way[MAX_DCACHE_WAYS]; | |
413 | }; | |
414 | ||
415 | struct err_ssi { | |
416 | uint64_t err_ssi_timeout; | |
417 | uint64_t err_ssi_log; | |
418 | }; | |
419 | ||
420 | /* | |
421 | * Store Buffer Diagnostic registers | |
422 | */ | |
423 | struct err_stb { | |
424 | uint64_t err_stb_data; | |
425 | uint64_t err_stb_data_ecc; | |
426 | uint64_t err_stb_parity; | |
427 | uint64_t err_stb_marks; | |
428 | uint64_t err_stb_curr_ptr; | |
429 | }; | |
430 | ||
431 | /* | |
432 | * Scratchpad Diagnostic registers | |
433 | */ | |
434 | struct err_scratchpad { | |
435 | uint64_t err_scratchpad_data; | |
436 | uint64_t err_scratchpad_ecc; | |
437 | }; | |
438 | ||
439 | ||
440 | /* | |
441 | * Tick_compare Diagnostic registers | |
442 | */ | |
443 | struct err_tca { | |
444 | uint64_t err_tca_data; | |
445 | uint64_t err_tca_ecc; | |
446 | }; | |
447 | /* | |
448 | * Trap Stack Diagnostic registers | |
449 | */ | |
450 | struct err_tsa { | |
451 | uint64_t err_tsa_ecc; | |
452 | uint64_t err_tsa_tl; | |
453 | uint64_t err_tsa_tt; | |
454 | uint64_t err_tsa_tstate; | |
455 | uint64_t err_tsa_htstate; | |
456 | uint64_t err_tsa_tpc; | |
457 | uint64_t err_tsa_tnpc; | |
458 | uint64_t err_tsa_cpu_mondo_qhead; | |
459 | uint64_t err_tsa_cpu_mondo_qtail; | |
460 | uint64_t err_tsa_dev_mondo_qhead; | |
461 | uint64_t err_tsa_dev_mondo_qtail; | |
462 | uint64_t err_tsa_res_err_qhead; | |
463 | uint64_t err_tsa_res_err_qtail; | |
464 | uint64_t err_tsa_nonres_err_qhead; | |
465 | uint64_t err_tsa_nonres_err_qtail; | |
466 | }; | |
467 | ||
468 | struct err_mmu_regs { | |
469 | uint8_t err_mmu_parity[MRA_ENTRIES]; | |
470 | uint64_t err_mmu_tsb_cfg_ctx0[MAX_NTSB]; | |
471 | uint64_t err_mmu_tsb_cfg_ctxnz[MAX_NTSB]; | |
472 | uint64_t err_mmu_real_range[MAX_NTSB]; | |
473 | uint64_t err_mmu_phys_offset[MAX_NTSB]; | |
474 | }; | |
475 | ||
476 | struct err_soc { | |
477 | uint64_t err_soc_esr; | |
478 | uint64_t err_soc_eler; | |
479 | uint64_t err_soc_eier; | |
480 | uint64_t err_soc_vcid; /* error steering register */ | |
481 | uint64_t err_soc_feer; | |
482 | uint64_t err_soc_pesr; | |
483 | uint64_t err_soc_eir; | |
484 | uint64_t err_soc_sii_synd; | |
485 | uint64_t err_soc_ncu_synd; | |
486 | }; | |
487 | ||
488 | struct err_mamu { | |
489 | uint64_t err_ma_pa; | |
490 | uint64_t err_ma_addr; | |
491 | uint64_t err_ma_np; | |
492 | uint64_t err_ma_ctl; | |
493 | uint64_t err_ma_sync; | |
494 | }; | |
495 | ||
496 | struct err_trap_regs { | |
497 | uint64_t err_tt; | |
498 | uint64_t err_tpc; | |
499 | uint64_t err_tnpc; | |
500 | uint64_t err_tstate; | |
501 | uint64_t err_htstate; | |
502 | }; | |
503 | ||
504 | /* | |
505 | * For integer/floating point register errors | |
506 | */ | |
507 | struct err_reg { | |
508 | uint64_t err_reg_ecc; | |
509 | }; | |
510 | ||
511 | union err_diag_data { | |
512 | struct err_tlb err_dtlb[DTLB_ENTRIES]; | |
513 | struct err_tlb err_itlb[ITLB_ENTRIES]; | |
514 | struct err_icache err_icache; | |
515 | struct err_dcache err_dcache; | |
516 | struct err_ssi err_ssi_info; | |
517 | struct err_stb err_stb; | |
518 | struct err_scratchpad err_scratchpad; | |
519 | struct err_tsa err_tsa; | |
520 | struct err_mmu_regs err_mmu_regs; | |
521 | struct err_mamu err_mamu; | |
522 | struct err_soc err_soc; | |
523 | struct err_tca err_tca; | |
524 | struct err_reg err_reg; | |
525 | struct err_l2 err_l2_cache; | |
526 | struct err_trap_regs err_trap_registers[MAXTL]; | |
527 | uint8_t err_reg_info; | |
528 | }; | |
529 | ||
530 | typedef struct err_abort_data { | |
531 | /* HV version + info string */ | |
532 | unsigned char err_version[ABORT_VERSION_INFO_SIZE]; | |
533 | /* %pc where abort was initiated */ | |
534 | uint64_t err_pc; | |
535 | /* %cwp where abort was initiated */ | |
536 | uint64_t err_cwp; | |
537 | /* trap stack at time of abort */ | |
538 | struct err_trap_regs err_trap_registers[MAXTL]; | |
539 | /* global registers */ | |
540 | uint64_t err_globals[8 * MAXGL]; | |
541 | /* strand register windows */ | |
542 | uint64_t err_registers[24 * NWINDOWS]; | |
543 | /* | |
544 | * Fill in the rest of the data required for the s/w abort | |
545 | * service error report here | |
546 | */ | |
547 | ||
548 | } err_abort_data_t; | |
549 | ||
550 | typedef struct err_diag_buf { | |
551 | uint64_t err_sparc_isfsr; | |
552 | uint64_t err_sparc_dsfsr; | |
553 | uint64_t err_sparc_dsfar; | |
554 | uint64_t err_sparc_desr; | |
555 | uint64_t err_sparc_dfesr; | |
556 | uint64_t err_l2_cache_esr[NO_L2_BANKS]; | |
557 | uint64_t err_l2_cache_ear[NO_L2_BANKS]; | |
558 | uint64_t err_l2_cache_nd[NO_L2_BANKS]; | |
559 | uint64_t err_dram_esr[NO_DRAM_BANKS]; | |
560 | uint64_t err_dram_ear[NO_DRAM_BANKS]; | |
561 | uint64_t err_dram_cntr[NO_DRAM_BANKS]; | |
562 | uint64_t err_dram_loc[NO_DRAM_BANKS]; | |
563 | uint64_t err_dram_fbd[NO_DRAM_BANKS]; | |
564 | uint64_t err_dram_retry[NO_DRAM_BANKS]; | |
565 | uint64_t err_l2_bank; /* bank in error */ | |
566 | uint64_t err_l2_line_state; | |
567 | uint64_t err_l2_pa; | |
568 | union err_diag_data err_diag_data; | |
569 | /* Note: the in_use flag must not move from here */ | |
570 | uint32_t err_report_in_use; /* in-use flag */ | |
571 | uint32_t err_report_size; /* report diag-data size */ | |
572 | } err_diag_buf_t; | |
573 | ||
574 | /* | |
575 | * Diagnostic error report structure. | |
576 | */ | |
577 | ||
578 | typedef struct err_sun4v_rprt { | |
579 | union { | |
580 | sun4v_cpu_erpt_t sun4v_cpu_erpt; | |
581 | sun4v_pcie_erpt_t sun4v_pcie_erpt; | |
582 | } sun4v_erpt; | |
583 | uint64_t in_use; /* in-use flag */ | |
584 | } err_sun4v_rprt_t; | |
585 | ||
586 | typedef struct err_diag_rprt { | |
587 | uint64_t error_type; /* CPU/MEM or I/O */ | |
588 | uint64_t report_type; /* report type */ | |
589 | uint64_t tod; /* TOD value */ | |
590 | uint64_t ehdl; /* error handle */ | |
591 | uint64_t err_stick; /* value of %stick */ | |
592 | uint64_t cpuver; /* Processor version reg */ | |
593 | uint64_t cpuserial; /* Processor serial reg */ | |
594 | uint64_t tstate; /* Value of %tstate */ | |
595 | uint64_t htstate; /* Value of %htstate */ | |
596 | uint64_t tpc; /* Value of %tpc */ | |
597 | uint16_t cpuid; /* ID of CPU */ | |
598 | uint16_t tt; /* Value of %tt */ | |
599 | uint8_t tl; /* Value of %tl */ | |
600 | union { | |
601 | err_diag_buf_t err_diag; | |
602 | err_abort_data_t err_abort; | |
603 | } err_diag_report_data; | |
604 | } err_diag_rprt_t; | |
605 | ||
606 | #endif /* !_ASM */ | |
607 | ||
608 | ||
609 | /* | |
610 | * ECC Syndromes | |
611 | * | |
612 | * Note: A value of 0:67 indicates a single bit error on the | |
613 | * data bit of that number. The TSA registers can go | |
614 | * up to 132 bits. | |
615 | */ | |
616 | #define ECC_LAST_BIT 67 | |
617 | #define ECC_ne (ECC_LAST_BIT * 2 + 1) /* no error , keep this first) */ | |
618 | #define ECC_C0 (ECC_LAST_BIT * 2 + 2) /* ECC Checkbit 0 error */ | |
619 | #define ECC_C1 (ECC_LAST_BIT * 2 + 3) /* ECC Checkbit 1 error */ | |
620 | #define ECC_C2 (ECC_LAST_BIT * 2 + 4) /* ECC Checkbit 2 error */ | |
621 | #define ECC_C3 (ECC_LAST_BIT * 2 + 5) /* ECC Checkbit 3 error */ | |
622 | #define ECC_C4 (ECC_LAST_BIT * 2 + 6) /* ECC Checkbit 4 error */ | |
623 | #define ECC_C5 (ECC_LAST_BIT * 2 + 7) /* ECC Checkbit 5 error */ | |
624 | #define ECC_C6 (ECC_LAST_BIT * 2 + 8) /* ECC Checkbit 6 error */ | |
625 | #define ECC_C7 (ECC_LAST_BIT * 2 + 9) /* ECC Checkbit 7 error */ | |
626 | /* Uncorrectable double (or 2n) bit error */ | |
627 | #define ECC_U (ECC_LAST_BIT * 2 + 10) | |
628 | /* Triple or worse (2n + 1) bit error */ | |
629 | #define ECC_M (ECC_LAST_BIT * 2 + 11) | |
630 | /* Notdata -or- Triple or worse (2n + 1) bit error */ | |
631 | #define ECC_N_M (ECC_LAST_BIT * 2 + 12) | |
632 | ||
633 | /* | |
634 | * 6 bit syndrome for FRF errors | |
635 | */ | |
636 | #define FRF_SYND6_SHIFT 6 | |
637 | #define FRF_SYND5_MASK 0x3f | |
638 | ||
639 | /* | |
640 | * Number of entries in the frfc_ecc_mask_table | |
641 | */ | |
642 | #define NO_FRF_ECC_MASKS 7 | |
643 | ||
644 | #ifndef _ASM | |
645 | typedef uint8_t ecc_syndrome_table_entry; | |
646 | typedef uint32_t ecc_mask_table_entry; | |
647 | #endif | |
648 | ||
649 | #ifdef __cplusplus | |
650 | } | |
651 | #endif | |
652 | ||
653 | #endif /* _NIAGARA2_ERROR_DEFS_H */ |