From 6724ba4f045cbbe2326463cbeaf59becfb01342e Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Sun, 31 Jan 2021 15:06:59 +0100 Subject: memory_info.h: Store SMBIOS error correction type There are platforms that support error correction types other than single-bit ECC. Extend meminfo to accomodate additional ECC types. It is assumed that `struct memory_info` is packed to save space. Thus, use `uint8_t` instead of an enum type (which are usually 4 bytes wide). Change-Id: I863f8e34c84841d931dfb8d7067af0f12a437e36 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/50178 Reviewed-by: Nico Huber Reviewed-by: Paul Menzel Reviewed-by: Patrick Rudolph Tested-by: build bot (Jenkins) --- src/soc/intel/common/block/systemagent/systemagent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/soc/intel/common/block') diff --git a/src/soc/intel/common/block/systemagent/systemagent.c b/src/soc/intel/common/block/systemagent/systemagent.c index ec26fce5ba..7d42fe1641 100644 --- a/src/soc/intel/common/block/systemagent/systemagent.c +++ b/src/soc/intel/common/block/systemagent/systemagent.c @@ -48,9 +48,9 @@ __weak uint32_t soc_systemagent_max_chan_capacity_mib(u8 capid0_a_ddrsz) return 32768; /* 32 GiB per channel */ } -static bool sa_supports_ecc(const uint32_t capid0_a) +static uint8_t sa_get_ecc_type(const uint32_t capid0_a) { - return !(capid0_a & CAPID_ECCDIS); + return capid0_a & CAPID_ECCDIS ? MEMORY_ARRAY_ECC_NONE : MEMORY_ARRAY_ECC_SINGLE_BIT; } static size_t sa_slots_per_channel(const uint32_t capid0_a) @@ -73,7 +73,7 @@ static void sa_soc_systemagent_init(struct device *dev) const uint32_t capid0_a = pci_read_config32(dev, CAPID0_A); - m->ecc_capable = sa_supports_ecc(capid0_a); + m->ecc_type = sa_get_ecc_type(capid0_a); m->max_capacity_mib = soc_systemagent_max_chan_capacity_mib(CAPID_DDRSZ(capid0_a)) * sa_number_of_channels(capid0_a); m->number_of_devices = sa_slots_per_channel(capid0_a) * -- cgit v1.2.3