diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/include/dimm_info_util.h | 2 | ||||
-rw-r--r-- | src/include/spd.h | 1 | ||||
-rw-r--r-- | src/lib/dimm_info_util.c | 8 | ||||
-rw-r--r-- | src/soc/amd/common/fsp/dmi.c | 4 | ||||
-rw-r--r-- | src/soc/amd/common/pi/amd_late_init.c | 4 | ||||
-rw-r--r-- | src/soc/intel/common/smbios.c | 2 |
6 files changed, 13 insertions, 8 deletions
diff --git a/src/include/dimm_info_util.h b/src/include/dimm_info_util.h index d20e8cddfc..04e9336179 100644 --- a/src/include/dimm_info_util.h +++ b/src/include/dimm_info_util.h @@ -12,7 +12,7 @@ * Use this when setting dimm_info.bus_width if the raw SPD values are not * available. */ -uint8_t smbios_bus_width_to_spd_width(uint16_t total_width, +uint8_t smbios_bus_width_to_spd_width(uint8_t ddr_type, uint16_t total_width, uint16_t data_width); /** diff --git a/src/include/spd.h b/src/include/spd.h index ec5296ec2f..af3072e8ec 100644 --- a/src/include/spd.h +++ b/src/include/spd.h @@ -209,5 +209,6 @@ enum spd_memory_type { #define SPD_MINI_UDIMM 0x20 #define SPD_ECC_8BIT (1<<3) +#define SPD_ECC_8BIT_LP5_DDR5 (1<<4) #endif diff --git a/src/lib/dimm_info_util.c b/src/lib/dimm_info_util.c index fb8e06f149..0e7cc12f18 100644 --- a/src/lib/dimm_info_util.c +++ b/src/lib/dimm_info_util.c @@ -5,7 +5,8 @@ #include <spd.h> #include <console/console.h> -uint8_t smbios_bus_width_to_spd_width(uint16_t total_width, uint16_t data_width) +uint8_t smbios_bus_width_to_spd_width(uint8_t ddr_type, uint16_t total_width, + uint16_t data_width) { uint8_t out; @@ -38,7 +39,10 @@ uint8_t smbios_bus_width_to_spd_width(uint16_t total_width, uint16_t data_width) switch (extension_bits) { case 8: - out |= SPD_ECC_8BIT; + if (ddr_type == MEMORY_TYPE_DDR5 || ddr_type == MEMORY_TYPE_LPDDR5) + out |= SPD_ECC_8BIT_LP5_DDR5; + else + out |= SPD_ECC_8BIT; break; case 0: /* No extension bits */ diff --git a/src/soc/amd/common/fsp/dmi.c b/src/soc/amd/common/fsp/dmi.c index 61d43f7aae..223cce1577 100644 --- a/src/soc/amd/common/fsp/dmi.c +++ b/src/soc/amd/common/fsp/dmi.c @@ -54,8 +54,8 @@ static void transfer_memory_info(const TYPE17_DMI_INFO *dmi17, dimm->mod_type = smbios_form_factor_to_spd_mod_type(dmi17->FormFactor); - dimm->bus_width = - smbios_bus_width_to_spd_width(dmi17->TotalWidth, dmi17->DataWidth); + dimm->bus_width = smbios_bus_width_to_spd_width(dmi17->MemoryType, dmi17->TotalWidth, + dmi17->DataWidth); dimm->mod_id = dmi17->ManufacturerIdCode; diff --git a/src/soc/amd/common/pi/amd_late_init.c b/src/soc/amd/common/pi/amd_late_init.c index 25aaea37bf..3714404590 100644 --- a/src/soc/amd/common/pi/amd_late_init.c +++ b/src/soc/amd/common/pi/amd_late_init.c @@ -38,8 +38,8 @@ static void transfer_memory_info(TYPE17_DMI_INFO *dmi17, dimm->mod_type = smbios_form_factor_to_spd_mod_type(dmi17->FormFactor); - dimm->bus_width = - smbios_bus_width_to_spd_width(dmi17->TotalWidth, dmi17->DataWidth); + dimm->bus_width = smbios_bus_width_to_spd_width(dmi17->MemoryType, dmi17->TotalWidth, + dmi17->DataWidth); dimm->mod_id = dmi17->ManufacturerIdCode; diff --git a/src/soc/intel/common/smbios.c b/src/soc/intel/common/smbios.c index a2b4a0be0d..213be6578b 100644 --- a/src/soc/intel/common/smbios.c +++ b/src/soc/intel/common/smbios.c @@ -65,5 +65,5 @@ void dimm_info_fill(struct dimm_info *dimm, u32 dimm_capacity, u8 ddr_type, if (ecc_support) total_width += EXTENSION_BUS_WIDTH_8BITS; - dimm->bus_width = smbios_bus_width_to_spd_width(total_width, data_width); + dimm->bus_width = smbios_bus_width_to_spd_width(ddr_type, total_width, data_width); } |