summaryrefslogtreecommitdiff
path: root/src/soc/amd
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/amd')
-rw-r--r--src/soc/amd/common/fsp/dmi.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/soc/amd/common/fsp/dmi.c b/src/soc/amd/common/fsp/dmi.c
index b443fe2533..fd2a8e4064 100644
--- a/src/soc/amd/common/fsp/dmi.c
+++ b/src/soc/amd/common/fsp/dmi.c
@@ -23,18 +23,17 @@
*/
static uint16_t ddr_speed_mhz_to_reported_mts(uint16_t ddr_type, uint16_t speed)
{
- switch (ddr_type) {
- case MEMORY_TYPE_DDR4:
+
+ if (CONFIG(USE_DDR4) && ddr_type == MEMORY_TYPE_DDR4)
return ddr4_speed_mhz_to_reported_mts(speed);
- case MEMORY_TYPE_LPDDR4:
+ else if (CONFIG(USE_LPDDR4) && ddr_type == MEMORY_TYPE_LPDDR4)
return lpddr4_speed_mhz_to_reported_mts(speed);
- case MEMORY_TYPE_DDR5:
- case MEMORY_TYPE_LPDDR5:
+ else if (CONFIG(USE_DDR5) && (ddr_type == MEMORY_TYPE_DDR5 ||
+ ddr_type == MEMORY_TYPE_LPDDR5))
return ddr5_speed_mhz_to_reported_mts(speed);
- default:
- printk(BIOS_ERR, "Unknown memory type %x\n", ddr_type);
- return 0;
- }
+
+ printk(BIOS_ERR, "Unknown memory type %x\n", ddr_type);
+ return 0;
}
/**