diff options
| author | Guy Sotomayor <gsotomayor@nvidia.com> | 2015-11-04 18:04:43 -0500 |
|---|---|---|
| committer | Alexander Van Brunt <avanbrunt@nvidia.com> | 2015-11-13 13:23:30 -0500 |
| commit | a0a1382ffb02f30e1d035d30dd0cfe2a7e95811f (patch) | |
| tree | fbd50f36704b02c3f244eae05ea4ed7498e63348 /include/linux | |
| parent | 0f409028c84b22c0ae4b39da4794fa7d5ab20b97 (diff) | |
arm64: platform: tegra: support for ARI MCAs
Registers ARI MCA handler and determines
which ARI MCA banks are supported by MCE.
Decodes the ARI MCA registers for each MCA
bank and prints out the raw and decoded
registers.
Added debugfs nodes to allow for query/capture
of ARI MCAs that were captured on the previous
boot.
Removed all ARI MCA code from tegra18_serr.c
which is now only for Denver MCAs.
Change-Id: I7523083810f0b5b696e34456c0e4f705efe5659f
Signed-off-by: Guy Sotomayor <gsotomayor@nvidia.com>
Reviewed-on: http://git-master/r/828024
(cherry picked from commit 763a2dd3c822130ff08659e33125b15e2d155382)
Reviewed-on: http://git-master/r/832242
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/platform/tegra/ari_mca.h | 219 |
1 files changed, 217 insertions, 2 deletions
diff --git a/include/linux/platform/tegra/ari_mca.h b/include/linux/platform/tegra/ari_mca.h index ffddb77b5..a707d2cb6 100644 --- a/include/linux/platform/tegra/ari_mca.h +++ b/include/linux/platform/tegra/ari_mca.h | |||
| @@ -20,8 +20,223 @@ struct ari_mca_bank { | |||
| 20 | struct list_head node; | 20 | struct list_head node; |
| 21 | char *name; | 21 | char *name; |
| 22 | u64 bank; | 22 | u64 bank; |
| 23 | u8 reg_mask; | ||
| 24 | u8 processed; | ||
| 25 | u64 saved_status; | ||
| 26 | u64 saved_addr; | ||
| 27 | u64 saved_msc1; | ||
| 28 | u64 saved_msc2; | ||
| 29 | void (*print_mca)(struct seq_file *file, struct ari_mca_bank *bank); | ||
| 23 | struct ari_mca_error *errors; | 30 | struct ari_mca_error *errors; |
| 24 | }; | 31 | }; |
| 25 | 32 | ||
| 26 | void register_ari_mca_bank(struct ari_mca_bank *bank); | 33 | struct ari_bits { |
| 27 | void unregister_ari_mca_bank(struct ari_mca_bank *bank); | 34 | char *name; |
| 35 | u64 mask; | ||
| 36 | }; | ||
| 37 | |||
| 38 | #define MCA_ARI_BIT(_bit_) (1ULL << (_bit_)) | ||
| 39 | #define MCA_ARI_MASK(_msb_, _lsb_) \ | ||
| 40 | ((MCA_ARI_BIT(_msb_+1) - 1ULL) & ~(MCA_ARI_BIT(_lsb_) - 1ULL)) | ||
| 41 | #define MCA_ARI_EXTRACT(_x_, _msb_, _lsb_) \ | ||
| 42 | ((_x_ & MCA_ARI_MASK(_msb_, _lsb_)) >> _lsb_) | ||
| 43 | |||
| 44 | #define SERRi_STATUS_VAL MCA_ARI_BIT(63) | ||
| 45 | #define SERRi_STATUS_OVF MCA_ARI_BIT(62) | ||
| 46 | #define SERRi_STATUS_UC MCA_ARI_BIT(61) | ||
| 47 | #define SERRi_STATUS_EN MCA_ARI_BIT(60) | ||
| 48 | #define SERRi_STATUS_MV MCA_ARI_BIT(59) | ||
| 49 | #define SERRi_STATUS_AV MCA_ARI_BIT(58) | ||
| 50 | |||
| 51 | #define get_mca_status_error_code(_x_) MCA_ARI_EXTRACT(_x_, 15, 0) | ||
| 52 | |||
| 53 | enum { | ||
| 54 | MCA_ARI_CMD_NOP = 0x00, | ||
| 55 | MCA_ARI_CMD_RD_SERR = 0x01, | ||
| 56 | MCA_ARI_CMD_WR_SERR = 0x02, | ||
| 57 | MCA_ARI_CMD_CLEAR_SERR = 0x04, | ||
| 58 | MCA_ARI_CMD_REPORT_SERR = 0x05, | ||
| 59 | MCA_ARI_CMD_RD_INTSTS = 0x06, | ||
| 60 | MCA_ARI_CMD_WR_INTSTS = 0x07, | ||
| 61 | MCA_ARI_CMD_RD_PREBOOT_SERR = 0x08, | ||
| 62 | }; | ||
| 63 | |||
| 64 | enum { | ||
| 65 | MCA_ARI_IDX_ASERR0 = 0x00, | ||
| 66 | MCA_ARI_IDX_ASERR1 = 0x01, | ||
| 67 | MCA_ARI_IDX_ASERR2 = 0x02, | ||
| 68 | MCA_ARI_IDX_ASERR3 = 0x03, | ||
| 69 | MCA_ARI_IDX_ASERR4 = 0x04, | ||
| 70 | MCA_ARI_IDX_ASERR5 = 0x05, | ||
| 71 | MCA_ARI_IDX_BANKINFO = 0x0f, | ||
| 72 | MCA_ARI_IDX_BANKTEMPLATE = 0x10, | ||
| 73 | MCA_ARI_IDX_SECURE_ACCESS = 0x11 | ||
| 74 | }; | ||
| 75 | |||
| 76 | enum { | ||
| 77 | MCA_ARI_RW_SUBIDX_CTRL = 0, | ||
| 78 | MCA_ARI_RW_SUBIDX_STAT = 1, | ||
| 79 | MCA_ARI_RW_SUBIDX_ADDR = 2, | ||
| 80 | MCA_ARI_RW_SUBIDX_MSC1 = 3, | ||
| 81 | MCA_ARI_RW_SUBIDX_MSC2 = 4, | ||
| 82 | }; | ||
| 83 | |||
| 84 | #define MCA_ARI_CTRL_REG_MASK (1 << MCA_ARI_RW_SUBIDX_CTRL) | ||
| 85 | #define MCA_ARI_STAT_REG_MASK (1 << MCA_ARI_RW_SUBIDX_STAT) | ||
| 86 | #define MCA_ARI_ADDR_REG_MASK (1 << MCA_ARI_RW_SUBIDX_ADDR) | ||
| 87 | #define MCA_ARI_MSC1_REG_MASK (1 << MCA_ARI_RW_SUBIDX_MSC1) | ||
| 88 | #define MCA_ARI_MSC2_REG_MASK (1 << MCA_ARI_RW_SUBIDX_MSC2) | ||
| 89 | |||
| 90 | /* | ||
| 91 | * SYS:DPMU Register layout | ||
| 92 | */ | ||
| 93 | #define MCA_ARI_SYS_DPMU_STAT_DMCE_ERR MCA_ARI_BIT(16) | ||
| 94 | #define MCA_ARI_SYS_DPMU_STAT_CRAB_ERR MCA_ARI_BIT(17) | ||
| 95 | #define MCA_ARI_SYS_DPMU_STAT_RD_WR_N MCA_ARI_BIT(18) | ||
| 96 | #define MCA_ARI_SYS_DPMU_STAT_UCODE_ERR MCA_ARI_BIT(19) | ||
| 97 | |||
| 98 | #define get_mca_sys_dpmu_stat_dmce(_x_) MCA_ARI_EXTRACT(_x_, 23, 20) | ||
| 99 | #define get_mca_sys_dpmu_addr_addr_l(_x_) MCA_ARI_EXTRACT(_x_, 26, 0) | ||
| 100 | #define get_mca_sys_dpmu_addr_addr_h(_x_) MCA_ARI_EXTRACT(_x_, 41, 27) | ||
| 101 | #define get_mca_sys_dpmu_addr_ucode_errcd(_x_) MCA_ARI_EXTRACT(_x_, 52, 42) | ||
| 102 | |||
| 103 | /* | ||
| 104 | * ROC:IOB Register layout | ||
| 105 | */ | ||
| 106 | #define MCA_ARI_ROC_IOB_STAT_MSI_ERR MCA_ARI_BIT(16) | ||
| 107 | #define MCA_ARI_ROC_IOB_STAT_IHI_ERR MCA_ARI_BIT(17) | ||
| 108 | #define MCA_ARI_ROC_IOB_STAT_CRI_ERR MCA_ARI_BIT(18) | ||
| 109 | #define MCA_ARI_ROC_IOB_STAT_MMCRAB_ERR MCA_ARI_BIT(19) | ||
| 110 | #define MCA_ARI_ROC_IOB_STAT_CSI_ERR MCA_ARI_BIT(20) | ||
| 111 | #define MCA_ARI_ROC_IOB_STAT_RD_WR_N MCA_ARI_BIT(21) | ||
| 112 | |||
| 113 | #define get_mca_roc_iob_stat_req_errt(_x_) MCA_ARI_EXTRACT(_x_, 23, 22) | ||
| 114 | #define get_mca_roc_iob_stat_resp_errt(_x_) MCA_ARI_EXTRACT(_x_, 25, 24) | ||
| 115 | #define get_mca_roc_iob_addr_cqx_cmd(_x_) MCA_ARI_EXTRACT(_x_, 35, 32) | ||
| 116 | #define get_mca_roc_iob_addr_cqx_cid(_x_) MCA_ARI_EXTRACT(_x_, 31, 28) | ||
| 117 | #define get_mca_roc_iob_addr_cqx_id(_x_) MCA_ARI_EXTRACT(_x_, 27, 8) | ||
| 118 | #define get_mca_roc_iob_addr_axi_id(_x_) MCA_ARI_EXTRACT(_x_, 7, 0) | ||
| 119 | #define get_mca_roc_iob_msc1_addr(_x_) MCA_ARI_EXTRACT(_x_, 41, 0) | ||
| 120 | |||
| 121 | /* | ||
| 122 | * ROC:MCB Register layout | ||
| 123 | */ | ||
| 124 | #define MCA_ARI_ROC_MCB_STAT_MC_ERR MCA_ARI_BIT(16) | ||
| 125 | #define MCA_ARI_ROC_MCB_STAT_SYSRAM_ERR MCA_ARI_BIT(17) | ||
| 126 | #define MCA_ARI_ROC_MCB_READ_ERROR 0x081E | ||
| 127 | #define MCA_ARI_ROC_MCB_WRITE_ERROR 0x082E | ||
| 128 | |||
| 129 | #define get_mca_roc_mcb_stat_client_id(_x_) MCA_ARI_EXTRACT(_x_, 18, 17) | ||
| 130 | #define get_mca_roc_mcb_addr_id(_x_) MCA_ARI_EXTRACT(_x_, 17, 0) | ||
| 131 | #define get_mca_roc_mcb_addr_cmd(_x_) MCA_ARI_EXTRACT(_x_, 21, 18) | ||
| 132 | #define get_mca_roc_mcb_addr_addr(_x_) MCA_ARI_EXTRACT(_x_, 53, 22) | ||
| 133 | |||
| 134 | /* | ||
| 135 | * ROC:CCE Register layout | ||
| 136 | */ | ||
| 137 | #define MCA_ARI_ROC_CCE_STAT_TO_ERR MCA_ARI_BIT(16) | ||
| 138 | #define MCA_ARI_ROC_CCE_STAT_STAT_ERR MCA_ARI_BIT(17) | ||
| 139 | #define MCA_ARI_ROC_CCE_STAT_DST_ERR MCA_ARI_BIT(18) | ||
| 140 | #define MCA_ARI_ROC_CCE_STAT_UNC_ERR MCA_ARI_BIT(19) | ||
| 141 | #define MCA_ARI_ROC_CCE_STAT_MH_ERR MCA_ARI_BIT(20) | ||
| 142 | #define MCA_ARI_ROC_CCE_STAT_PERR MCA_ARI_BIT(21) | ||
| 143 | #define MCA_ARI_ROC_CCE_STAT_PSN_ERR MCA_ARI_BIT(22) | ||
| 144 | |||
| 145 | #define MCA_ARI_ROC_CCE_MSC1_TO MCA_ARI_BIT(0) | ||
| 146 | #define MCA_ARI_ROC_CCE_MSC1_DIV4 MCA_ARI_BIT(1) | ||
| 147 | |||
| 148 | #define get_mca_roc_cce_addr_cmd(_x_) MCA_ARI_EXTRACT(_x_, 5, 0) | ||
| 149 | #define get_mca_roc_cce_addr_addr(_x_) MCA_ARI_EXTRACT(_x_, 47, 6) | ||
| 150 | #define get_mca_roc_cce_msc1_tlimit(_x_) MCA_ARI_EXTRACT(_x_, 11, 2) | ||
| 151 | #define get_mca_roc_cce_msc1_psn_err(_x_) MCA_ARI_EXTRACT(_x_, 25, 12) | ||
| 152 | #define get_mca_roc_cce_msc2_more_info(_x_) MCA_ARI_EXTRACT(_x_, 17, 0) | ||
| 153 | #define get_mca_roc_cce_msc2_to_info(_x_) MCA_ARI_EXTRACT(_x_, 43, 18) | ||
| 154 | #define get_mca_roc_cce_msc2_src(_x_) MCA_ARI_EXTRACT(_x_, 45, 44) | ||
| 155 | #define get_mca_roc_cce_msc2_tid(_x_) MCA_ARI_EXTRACT(_x_, 52, 46) | ||
| 156 | |||
| 157 | /* | ||
| 158 | * more_info bits | ||
| 159 | */ | ||
| 160 | /* PSN_ERR */ | ||
| 161 | #define get_mca_roc_cce_more_info_poison_info_d1(_x_) MCA_ARI_EXTRACT(_x_, 13, 0) | ||
| 162 | #define MCA_ARI_ROC_CCE_PSN_NOT_DRAM MCA_ARI_BIT(0) | ||
| 163 | #define MCA_ARI_ROC_CCE_PSN_WB_MMIO MCA_ARI_BIT(1) | ||
| 164 | #define MCA_ARI_ROC_CCE_PSN_SYSRAM_RANGE MCA_ARI_BIT(2) | ||
| 165 | #define MCA_ARI_ROC_CCE_PSN_ILL_MTS_ACCESS MCA_ARI_BIT(3) | ||
| 166 | #define MCA_ARI_ROC_CCE_PSN_TZDRAM_VPR_OVERLAP MCA_ARI_BIT(4) | ||
| 167 | #define MCA_ARI_ROC_CCE_PSN_VPR_GSC_OVERLAP MCA_ARI_BIT(5) | ||
| 168 | #define MCA_ARI_ROC_CCE_PSN_GSC_TZDRAM_OVERLAP MCA_ARI_BIT(6) | ||
| 169 | #define MCA_ARI_ROC_CCE_PSN_VPR_READ_FAIL MCA_ARI_BIT(7) | ||
| 170 | #define MCA_ARI_ROC_CCE_PSN_VPR_WRITE_FAIL MCA_ARI_BIT(8) | ||
| 171 | #define MCA_ARI_ROC_CCE_PSN_TZDRAM_READ_FAIL MCA_ARI_BIT(9) | ||
| 172 | #define MCA_ARI_ROC_CCE_PSN_TZDRAM_WRITE_FAIL MCA_ARI_BIT(10) | ||
| 173 | #define MCA_ARI_ROC_CCE_PSN_GSC_READ_FAIL MCA_ARI_BIT(11) | ||
| 174 | #define MCA_ARI_ROC_CCE_PSN_GSC_WRITE_FAIL MCA_ARI_BIT(12) | ||
| 175 | |||
| 176 | /* PERR, MH_ERR, STAT_ERR */ | ||
| 177 | #define MCA_ARI_ROC_CCE_DIR_STATE MCA_ARI_BIT(16) | ||
| 178 | #define MCA_ARI_ROC_CCE_DDIR_HIT MCA_ARI_BIT(13) | ||
| 179 | #define MCA_ARI_ROC_CCE_VDIR_HIT MCA_ARI_BIT(12) | ||
| 180 | |||
| 181 | #define get_mca_roc_cce_more_info_l2_present(_x_) MCA_ARI_EXTRACT(_x_, 15, 14) | ||
| 182 | #define get_mca_roc_cce_more_info_l2dir_way_hit(_x_) MCA_ARI_EXTRACT(_x_, 11, 0) | ||
| 183 | |||
| 184 | /* DST_ERR, TO_ERR */ | ||
| 185 | #define MCA_ARI_ROC_CCE_ART_VLD MCA_ARI_BIT(17) | ||
| 186 | #define MCA_ARI_ROC_CCE_VID_VLD MCA_ARI_BIT(8) | ||
| 187 | |||
| 188 | #define get_mca_roc_cce_more_info_aid(_x_) MCA_ARI_EXTRACT(_x_, 15, 9) | ||
| 189 | #define get_mca_roc_cce_more_info_vid(_x_) MCA_ARI_EXTRACT(_x_, 5, 0) | ||
| 190 | |||
| 191 | /* | ||
| 192 | * to_info bits | ||
| 193 | */ | ||
| 194 | #define MCA_ARI_ROC_CCE_ART_PENDING_CHAINING MCA_ARI_BIT(25) | ||
| 195 | #define MCA_ARI_ROC_CCE_ART_PENDING_TAG_REPLAY MCA_ARI_BIT(24) | ||
| 196 | #define MCA_ARI_ROC_CCE_ART_PENDING_FULL_REPLAY MCA_ARI_BIT(23) | ||
| 197 | #define get_mca_roc_cce_to_info_art_snoop_ack(_x_) MCA_ARI_EXTRACT(_x_, 22, 20) | ||
| 198 | #define get_mca_roc_cce_to_info_art_snoop(_x_) MCA_ARI_EXTRACT(_x_, 19, 17) | ||
| 199 | #define MCA_ARI_ROC_CCE_ART_PENDING_WRITE_ACK MCA_ARI_BIT(16) | ||
| 200 | #define MCA_ARI_ROC_CCE_ART_PENDING_FILL_OWN MCA_ARI_BIT(15) | ||
| 201 | #define MCA_ARI_ROC_CCE_ART_PENDING_WRITE MCA_ARI_BIT(14) | ||
| 202 | #define MCA_ARI_ROC_CCE_ART_PENDING_READ MCA_ARI_BIT(13) | ||
| 203 | #define MCA_ARI_ROC_CCE_VT_PENDING_CHAINING MCA_ARI_BIT(12) | ||
| 204 | #define MCA_ARI_ROC_CCE_TO_RESERVED_1 MCA_ARI_BIT(11) | ||
| 205 | #define MCA_ARI_ROC_CCE_TO_RESERVED_2 MCA_ARI_BIT(10) | ||
| 206 | #define MCA_ARI_ROC_CCE_TO_RESERVED_3 MCA_ARI_BIT(9) | ||
| 207 | #define get_mca_roc_cce_to_info_vt_snoop_ack(_x_) MCA_ARI_EXTRACT(_x_, 8, 7) | ||
| 208 | #define MCA_ARI_ROC_CCE_TO_RESERVED_4 MCA_ARI_BIT(6) | ||
| 209 | #define get_mca_roc_cce_to_info_vt_snoop(_x_) MCA_ARI_EXTRACT(_x_, 5, 4) | ||
| 210 | #define MCA_ARI_ROC_CCE_VT_PENDING_WRITE_ACK MCA_ARI_BIT(3) | ||
| 211 | #define MCA_ARI_ROC_CCE_TO_RESERVED_5 MCA_ARI_BIT(2) | ||
| 212 | #define MCA_ARI_ROC_CCE_VT_PENDING_WRITE MCA_ARI_BIT(1) | ||
| 213 | #define MCA_ARI_ROC_CCE_TO_RESERVED_6 MCA_ARI_BIT(0) | ||
| 214 | |||
| 215 | /* | ||
| 216 | * ROC:CQX Register layout | ||
| 217 | */ | ||
| 218 | #define MCA_ARI_ROC_CQX_STAT_SRC_ERR MCA_ARI_BIT(16) | ||
| 219 | #define MCA_ARI_ROC_CQX_STAT_DST_ERR MCA_ARI_BIT(17) | ||
| 220 | #define MCA_ARI_ROC_CQX_STAT_REQ_ERR MCA_ARI_BIT(18) | ||
| 221 | #define MCA_ARI_ROC_CQX_STAT_RSP_ERR MCA_ARI_BIT(19) | ||
| 222 | |||
| 223 | /* | ||
| 224 | * ROC:CTU Register layout | ||
| 225 | */ | ||
| 226 | #define MCA_ARI_ROC_CTU_STAT_CTU_PAR MCA_ARI_BIT(16) | ||
| 227 | #define MCA_ARI_ROC_CTU_STAT_MULTI MCA_ARI_BIT(17) | ||
| 228 | |||
| 229 | #define get_mca_roc_ctu_addr_src(_x_) MCA_ARI_EXTRACT(_x_, 7, 0) | ||
| 230 | #define get_mca_roc_ctu_addr_id(_x_) MCA_ARI_EXTRACT(_x_, 15, 8) | ||
| 231 | #define get_mca_roc_ctu_addr_data(_x_) MCA_ARI_EXTRACT(_x_, 26, 16) | ||
| 232 | #define get_mca_roc_ctu_addr_cmd(_x_) MCA_ARI_EXTRACT(_x_, 35, 32) | ||
| 233 | #define get_mca_roc_ctu_addr_addr(_x_) MCA_ARI_EXTRACT(_x_, 45, 36) | ||
| 234 | |||
| 235 | #define is_roc_ctu_src_cga_data_array(_x_) ((_x_ & 0xf0) == 0) | ||
| 236 | #define is_roc_ctu_src_cga_tag_array(_x_) ((_x_ >= 0x40) && (_x_ < 0x7f)) | ||
| 237 | |||
| 238 | /* | ||
| 239 | * Decode a 42 bit address | ||
| 240 | */ | ||
| 241 | #define get_mca_addr_type(_x_) MCA_ARI_EXTRACT(_x_, 41, 40) | ||
| 242 | #define get_mca_addr_addr(_x_) MCA_ARI_EXTRACT(_x_, 39, 0) | ||
