summaryrefslogtreecommitdiff
path: root/src/mainboard
diff options
context:
space:
mode:
authorTim Chu <Tim.Chu@quantatw.com>2020-11-12 04:16:34 -0800
committerPatrick Georgi <pgeorgi@google.com>2020-11-25 09:18:25 +0000
commit9b7dc7645db803d34dee314fcd46df77b2935f4f (patch)
tree75cf4d3e453066700e366da2b382b51f510b0996 /src/mainboard
parenta96eaf870015d65eff3120d4e877febb6862088b (diff)
mb/ocp/deltalake: Define SMBIOS type 16 error correction type by
RasModesEnabled Use RasModesEnabled from SystemMemoryMapHob to define SMBIOS type 16 error correction type Tested=Execute "dmidecode -t 16" to check if error correction type is correct. Signed-off-by: Tim Chu <Tim.Chu@quantatw.com> Change-Id: I3636fcc4a874261cf484c10e2db15015ac5d7e68 Reviewed-on: https://review.coreboot.org/c/coreboot/+/47509 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Diffstat (limited to 'src/mainboard')
-rw-r--r--src/mainboard/ocp/deltalake/ramstage.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c
index 52c55b89b0..96b006020b 100644
--- a/src/mainboard/ocp/deltalake/ramstage.c
+++ b/src/mainboard/ocp/deltalake/ramstage.c
@@ -26,6 +26,31 @@
extern struct fru_info_str fru_strings;
static char slot_id_str[SLOT_ID_LEN];
+/* Override SMBIOS type 16 error correction type. */
+unsigned int smbios_memory_error_correction_type(struct memory_info *meminfo)
+{
+ const struct SystemMemoryMapHob *hob;
+
+ hob = get_system_memory_map();
+ assert(hob != NULL);
+
+ switch (hob->RasModesEnabled) {
+ case CH_INDEPENDENT:
+ return MEMORY_ARRAY_ECC_SINGLE_BIT;
+ case FULL_MIRROR_1LM:
+ case PARTIAL_MIRROR_1LM:
+ case FULL_MIRROR_2LM:
+ case PARTIAL_MIRROR_2LM:
+ return MEMORY_ARRAY_ECC_MULTI_BIT;
+ case RK_SPARE:
+ return MEMORY_ARRAY_ECC_SINGLE_BIT;
+ case CH_LOCKSTEP:
+ return MEMORY_ARRAY_ECC_SINGLE_BIT;
+ default:
+ return MEMORY_ARRAY_ECC_MULTI_BIT;
+ }
+}
+
/*
* Update SMBIOS type 0 ec version.
* In deltalake, BMC version is used to represent ec version.