soc/amd/common/fsp/dmi: Translate DRAM speeds for (LP)DDR5

Hook up newly-added method to convert from frequency to MT/s so that
boards which use (LP)DDR5 report their capability properly.

BUG=b:239000826
TEST=build/boot google/skyrim, verify SMBIOS Type 17 table reports
DRAM speeds correctly.

Change-Id: I694b6c227a8d8fb40c897053808bc79df330ed0c
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66954
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
This commit is contained in:
Matt DeVillier 2022-08-22 17:30:00 -05:00 committed by Martin L Roth
parent bb9d106eab
commit 32bb6b6500
1 changed files with 4 additions and 0 deletions

View File

@ -16,6 +16,7 @@
#include <dmi_info.h>
#include <device/dram/ddr4.h>
#include <device/dram/lpddr4.h>
#include <device/dram/ddr5.h>
/**
* Convert DDR clock speed (based on memory type) in MHz to the standard reported speed in MT/s
@ -27,6 +28,9 @@ static uint16_t ddr_speed_mhz_to_reported_mts(uint16_t ddr_type, uint16_t speed)
return ddr4_speed_mhz_to_reported_mts(speed);
case MEMORY_TYPE_LPDDR4:
return lpddr4_speed_mhz_to_reported_mts(speed);
case MEMORY_TYPE_DDR5:
case MEMORY_TYPE_LPDDR5:
return ddr5_speed_mhz_to_reported_mts(speed);
default:
printk(BIOS_ERR, "Unknown memory type %x\n", ddr_type);
return 0;