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 <matt.devillier@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/88974
Reviewed-by: Martin L Roth <gaumless@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Matt DeVillier 2025-08-27 16:09:28 -05:00
commit fc62ffab48

View file

@ -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 channel = 0; channel < AGESA_STRUCT_CHANNELS_PER_SOCKET; channel++) {
for (unsigned int dimm = 0; dimm < AGESA_STRUCT_DIMMS_PER_CHANNEL; dimm++) { for (unsigned int dimm = 0; dimm < AGESA_STRUCT_DIMMS_PER_CHANNEL; dimm++) {
type17_dmi_info = &dmi_table->T17[0][channel][dimm]; type17_dmi_info = &dmi_table->T17[0][channel][dimm];
/* DIMMs that are present will have a non-zero /*
handle. */ * DIMMs that are present will always have a non-zero handle.
if (type17_dmi_info->Handle == 0) * 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; continue;
print_dmi_info(type17_dmi_info); print_dmi_info(type17_dmi_info);
dimm_info = &mem_info->dimm[dimm_cnt]; dimm_info = &mem_info->dimm[dimm_cnt];