diff options
author | Borislav Petkov <borislav.petkov@amd.com> | 2009-07-24 07:51:42 -0400 |
---|---|---|
committer | Borislav Petkov <borislav.petkov@amd.com> | 2009-09-14 12:59:17 -0400 |
commit | 549d042df240dfb4203bab40ad44f9336751b7d6 (patch) | |
tree | af357ed8eaf06c26f19d458686b6c7ea4e425a05 /drivers/edac/edac_mce_amd.h | |
parent | ecaf5606de65cdd04de5f526185fe28fb0df654e (diff) |
x86, mce: pass mce info to EDAC for decoding
Move NB decoder along with required defines to EDAC MCE core. Add
registration routines for further decoding of the MCE info in the AMD64
EDAC module.
CC: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac/edac_mce_amd.h')
-rw-r--r-- | drivers/edac/edac_mce_amd.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/drivers/edac/edac_mce_amd.h b/drivers/edac/edac_mce_amd.h index 39971cdabb51..9114dc62782b 100644 --- a/drivers/edac/edac_mce_amd.h +++ b/drivers/edac/edac_mce_amd.h | |||
@@ -1,3 +1,8 @@ | |||
1 | #ifndef _EDAC_MCE_AMD_H | ||
2 | #define _EDAC_MCE_AMD_H | ||
3 | |||
4 | #include <asm/mce.h> | ||
5 | |||
1 | #define ERROR_CODE(x) ((x) & 0xffff) | 6 | #define ERROR_CODE(x) ((x) & 0xffff) |
2 | #define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) | 7 | #define EXT_ERROR_CODE(x) (((x) >> 16) & 0x1f) |
3 | #define EXT_ERR_MSG(x) ext_msgs[EXT_ERROR_CODE(x)] | 8 | #define EXT_ERR_MSG(x) ext_msgs[EXT_ERROR_CODE(x)] |
@@ -22,6 +27,20 @@ | |||
22 | #define PP(x) (((x) >> 9) & 0x3) | 27 | #define PP(x) (((x) >> 9) & 0x3) |
23 | #define PP_MSG(x) pp_msgs[PP(x)] | 28 | #define PP_MSG(x) pp_msgs[PP(x)] |
24 | 29 | ||
30 | #define K8_NBSH 0x4C | ||
31 | |||
32 | #define K8_NBSH_VALID_BIT BIT(31) | ||
33 | #define K8_NBSH_OVERFLOW BIT(30) | ||
34 | #define K8_NBSH_UC_ERR BIT(29) | ||
35 | #define K8_NBSH_ERR_EN BIT(28) | ||
36 | #define K8_NBSH_MISCV BIT(27) | ||
37 | #define K8_NBSH_VALID_ERROR_ADDR BIT(26) | ||
38 | #define K8_NBSH_PCC BIT(25) | ||
39 | #define K8_NBSH_ERR_CPU_VAL BIT(24) | ||
40 | #define K8_NBSH_CECC BIT(14) | ||
41 | #define K8_NBSH_UECC BIT(13) | ||
42 | #define K8_NBSH_ERR_SCRUBER BIT(8) | ||
43 | |||
25 | extern const char *tt_msgs[]; | 44 | extern const char *tt_msgs[]; |
26 | extern const char *ll_msgs[]; | 45 | extern const char *ll_msgs[]; |
27 | extern const char *rrrr_msgs[]; | 46 | extern const char *rrrr_msgs[]; |
@@ -29,3 +48,22 @@ extern const char *pp_msgs[]; | |||
29 | extern const char *to_msgs[]; | 48 | extern const char *to_msgs[]; |
30 | extern const char *ii_msgs[]; | 49 | extern const char *ii_msgs[]; |
31 | extern const char *ext_msgs[]; | 50 | extern const char *ext_msgs[]; |
51 | |||
52 | /* | ||
53 | * relevant NB regs | ||
54 | */ | ||
55 | struct err_regs { | ||
56 | u32 nbcfg; | ||
57 | u32 nbsh; | ||
58 | u32 nbsl; | ||
59 | u32 nbeah; | ||
60 | u32 nbeal; | ||
61 | }; | ||
62 | |||
63 | |||
64 | void amd_report_gart_errors(bool); | ||
65 | void amd_register_ecc_decoder(void (*f)(int, struct err_regs *, int)); | ||
66 | void amd_unregister_ecc_decoder(void (*f)(int, struct err_regs *, int)); | ||
67 | void amd_decode_nb_mce(int, struct err_regs *, int); | ||
68 | |||
69 | #endif /* _EDAC_MCE_AMD_H */ | ||