From fc62ffab4824b6685fad95e164bb68cad70f84b1 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Wed, 27 Aug 2025 16:09:28 -0500 Subject: [PATCH] soc/amd/common/fsp/dmi: Skip parsing when memory type UNKNOWN FSP sets the MemoryType to 0x2 (MEMORY_TYPE_UNKNOWN) when a DIMM is not present in a given slot, so skip parsing of any DMI records with that type set. TEST=build/boot out-of-tree Starlabs Cezanne-based board with a single sodimm installed, verify the DMI record for the empty slot is not parsed/inserted into the SMBIOS tables. Change-Id: I683c7bf65cc261b6a4fc4cb74e7b4b5f96283f61 Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/88974 Reviewed-by: Martin L Roth Tested-by: build bot (Jenkins) --- src/soc/amd/common/fsp/dmi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/soc/amd/common/fsp/dmi.c b/src/soc/amd/common/fsp/dmi.c index f820e73139..fa630ff02e 100644 --- a/src/soc/amd/common/fsp/dmi.c +++ b/src/soc/amd/common/fsp/dmi.c @@ -218,9 +218,12 @@ static void prepare_dmi_16_17(void *unused) for (unsigned int channel = 0; channel < AGESA_STRUCT_CHANNELS_PER_SOCKET; channel++) { for (unsigned int dimm = 0; dimm < AGESA_STRUCT_DIMMS_PER_CHANNEL; dimm++) { type17_dmi_info = &dmi_table->T17[0][channel][dimm]; - /* DIMMs that are present will have a non-zero - handle. */ - if (type17_dmi_info->Handle == 0) + /* + * DIMMs that are present will always have a non-zero handle. + * FSP will set the MemoryType to UNKNOWN if DIMM not present. + */ + if (type17_dmi_info->Handle == 0 || + type17_dmi_info->MemoryType == MEMORY_TYPE_UNKNOWN) continue; print_dmi_info(type17_dmi_info); dimm_info = &mem_info->dimm[dimm_cnt];