RAS/AMD/ATL: Add MI300 DRAM to normalized address translation support
authorYazen Ghannam <yazen.ghannam@amd.com>
Wed, 31 Jan 2024 16:57:32 +0000 (10:57 -0600)
committerBorislav Petkov (AMD) <bp@alien8.de>
Thu, 1 Feb 2024 15:28:56 +0000 (16:28 +0100)
commit87a61237530769d5a7a750fbc747ac0d1b2e18c1
treef14a96ba3a572f320dcc849f61115d3980368708
parenta7b57372e1c5c848cbe9169574f07a9ee2177a1b
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
drivers/ras/amd/atl/internal.h
drivers/ras/amd/atl/system.c
drivers/ras/amd/atl/umc.c