From 327f1058d2feaa022407128aa9dac55f408b714c Mon Sep 17 00:00:00 2001 From: Rob Barnes Date: Tue, 1 Sep 2020 10:26:57 -0600 Subject: memory_info: add max_speed_mts and configured_speed_mts ddr_frequency is ambiguous and is interpreted differently in several places. Instead of renaming this field, this deprecates it and adds two new fields with unambiguous naming, max_speed_mts and configured_speed_mts. smbios.c falls back to using ddr_frequency when either of these fields are 0. The same value was being used for both configured memory speed and max memory speed in SMBIOS type 17, which is not accurate when configured speed is not the max speed. BUG=b:167218112 TEST=Boot ezkinil, no change to dmidecode -t17 Change-Id: Iaa75401f9fc33642dbdce6c69bd9b20f96d1cc25 Signed-off-by: Rob Barnes Reviewed-on: https://review.coreboot.org/c/coreboot/+/44549 Reviewed-by: Furquan Shaikh Reviewed-by: Raul Rangel Reviewed-by: Tim Wawrzynczak Reviewed-by: Jack Rosenthal Tested-by: build bot (Jenkins) --- src/arch/x86/smbios.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/arch') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 6c92d03c72..7516305191 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -281,8 +281,14 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm, memset(t, 0, sizeof(struct smbios_type17)); t->memory_type = dimm->ddr_type; - t->clock_speed = dimm->ddr_frequency; - t->speed = dimm->ddr_frequency; + if (dimm->configured_speed_mts != 0) + t->clock_speed = dimm->configured_speed_mts; + else + t->clock_speed = dimm->ddr_frequency; + if (dimm->max_speed_mts != 0) + t->speed = dimm->max_speed_mts; + else + t->speed = dimm->ddr_frequency; t->type = SMBIOS_MEMORY_DEVICE; if (dimm->dimm_size < 0x7fff) { t->size = dimm->dimm_size; -- cgit v1.2.3