summaryrefslogtreecommitdiff
path: root/drivers/ras/amd/atl/system.c
diff options
context:
space:
mode:
authorYazen Ghannam <yazen.ghannam@amd.com>2024-01-31 10:57:32 -0600
committerBorislav Petkov (AMD) <bp@alien8.de>2024-02-01 16:28:56 +0100
commit87a61237530769d5a7a750fbc747ac0d1b2e18c1 (patch)
treef14a96ba3a572f320dcc849f61115d3980368708 /drivers/ras/amd/atl/system.c
parenta7b57372e1c5c848cbe9169574f07a9ee2177a1b (diff)
RAS/AMD/ATL: Add MI300 DRAM to normalized address translation support
Zen-based AMD systems report DRAM ECC errors through Unified Memory Controller (UMC) MCA banks. The value provided in MCA_ADDR is a "normalized" address which represents the UMC's view of its managed memory. The normalized address must be translated to a system physical address for software to take action. MI300 systems, uniquely, do not provide a normalized address in MCA_ADDR for DRAM ECC errors. Rather, the "DRAM" address is reported. This value includes identifiers for the bank, row, column, pseudochannel and stack of the memory location. The DRAM address must be converted to a normalized address in order to be further translated to a system physical address. Add helper functions to do the DRAM to normalized translation for MI300 systems. The method is based on the fixed hardware layout of the on-chip memory. [ bp: Massage commit message, decapitalize some, rename function. ] Signed-off-by: Yazen Ghannam <yazen.ghannam@amd.com> Co-developed-by: Muralidhara M K <muralidhara.mk@amd.com> Signed-off-by: Muralidhara M K <muralidhara.mk@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Tested-by: Muralidhara M K <muralidhara.mk@amd.com> Link: https://lore.kernel.org/r/20240131165732.88297-1-yazen.ghannam@amd.com
Diffstat (limited to 'drivers/ras/amd/atl/system.c')
-rw-r--r--drivers/ras/amd/atl/system.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/ras/amd/atl/system.c b/drivers/ras/amd/atl/system.c
index 46493ed405d6..701349e84942 100644
--- a/drivers/ras/amd/atl/system.c
+++ b/drivers/ras/amd/atl/system.c
@@ -124,9 +124,13 @@ static int df4_determine_df_rev(u32 reg)
if (reg == DF_FUNC0_ID_ZEN4_SERVER)
df_cfg.flags.socket_id_shift_quirk = 1;
- if (reg == DF_FUNC0_ID_MI300)
+ if (reg == DF_FUNC0_ID_MI300) {
df_cfg.flags.heterogeneous = 1;
+ if (get_addr_hash_mi300())
+ return -EINVAL;
+ }
+
return df4_get_fabric_id_mask_registers();
}