diff options
author | Matt DeVillier <matt.devillier@amd.corp-partner.google.com> | 2022-08-23 11:54:50 -0500 |
---|---|---|
committer | Martin L Roth <gaumless@gmail.com> | 2022-08-25 01:03:04 +0000 |
commit | 17144bc521c27d427fefe9882d0407565166128e (patch) | |
tree | fe351130bccae78aa66087c8eb48db128088d37a /src | |
parent | b4a5ef4ffe179bdcfe9a14efa9dc0a8f2acec225 (diff) |
soc/amd/common/fsp/dmi: Set dimm voltage based on memory type
Voltage set based on standard configuration for each type.
TEST=build/boot google/skyrim, verify output in cbmem console log,
DMI type 17 table.
Change-Id: I9b1e68a9417e43cbb9c55b4c471664f3f9090342
Signed-off-by: Matt DeVillier <matt.devillier@amd.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/66981
Reviewed-by: Fred Reitberger <reitbergerfred@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Reviewed-by: Marshall Dawson <marshalldawson3rd@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/soc/amd/common/fsp/dmi.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/soc/amd/common/fsp/dmi.c b/src/soc/amd/common/fsp/dmi.c index e3b6fad221..b443fe2533 100644 --- a/src/soc/amd/common/fsp/dmi.c +++ b/src/soc/amd/common/fsp/dmi.c @@ -38,6 +38,25 @@ static uint16_t ddr_speed_mhz_to_reported_mts(uint16_t ddr_type, uint16_t speed) } /** + * Return DDR voltage (in mV) based on memory type + */ +static uint16_t ddr_get_voltage(uint16_t ddr_type) +{ + switch (ddr_type) { + case MEMORY_TYPE_DDR4: + return 1200; + case MEMORY_TYPE_LPDDR4: + case MEMORY_TYPE_DDR5: + return 1100; + case MEMORY_TYPE_LPDDR5: + return 1050; + default: + printk(BIOS_ERR, "Unknown memory type %x\n", ddr_type); + return 0; + } +} + +/** * Populate dimm_info using AGESA TYPE17_DMI_INFO. */ static void transfer_memory_info(const TYPE17_DMI_INFO *dmi17, @@ -67,6 +86,8 @@ static void transfer_memory_info(const TYPE17_DMI_INFO *dmi17, dimm->bank_locator = 0; + dimm->vdd_voltage = ddr_get_voltage(dmi17->MemoryType); + strncpy((char *)dimm->module_part_number, dmi17->PartNumber, sizeof(dimm->module_part_number) - 1); } @@ -79,6 +100,7 @@ static void print_dimm_info(const struct dimm_info *dimm) " ddr_type: 0x%hx\n" " max_speed_mts: %hu\n" " config_speed_mts: %hu\n" + " vdd_voltage: %hu\n" " rank_per_dimm: %hhu\n" " channel_num: %hhu\n" " dimm_num: %hhu\n" @@ -92,6 +114,7 @@ static void print_dimm_info(const struct dimm_info *dimm) dimm->ddr_type, dimm->max_speed_mts, dimm->configured_speed_mts, + dimm->vdd_voltage, dimm->rank_per_dimm, dimm->channel_num, dimm->dimm_num, |