diff options
Diffstat (limited to 'src/soc')
-rw-r--r-- | src/soc/intel/alderlake/include/soc/meminit.h | 2 | ||||
-rw-r--r-- | src/soc/intel/alderlake/meminit.c | 4 | ||||
-rw-r--r-- | src/soc/intel/common/block/include/intelblocks/meminit.h | 4 | ||||
-rw-r--r-- | src/soc/intel/common/block/memory/meminit.c | 19 | ||||
-rw-r--r-- | src/soc/intel/tigerlake/meminit.c | 3 |
5 files changed, 14 insertions, 18 deletions
diff --git a/src/soc/intel/alderlake/include/soc/meminit.h b/src/soc/intel/alderlake/include/soc/meminit.h index 6af0accb1b..bd75636e9b 100644 --- a/src/soc/intel/alderlake/include/soc/meminit.h +++ b/src/soc/intel/alderlake/include/soc/meminit.h @@ -110,6 +110,6 @@ struct mb_cfg { }; void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, - const struct mem_spd *spd_info, bool half_populated, bool *dimms_changed); + const struct mem_spd *spd_info, bool half_populated); #endif /* _SOC_ALDERLAKE_MEMINIT_H_ */ diff --git a/src/soc/intel/alderlake/meminit.c b/src/soc/intel/alderlake/meminit.c index 2c915ef9ee..d40ee35e73 100644 --- a/src/soc/intel/alderlake/meminit.c +++ b/src/soc/intel/alderlake/meminit.c @@ -236,7 +236,7 @@ static void ddr5_fill_dimm_module_info(FSP_M_CONFIG *mem_cfg, const struct mb_cf } void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, - const struct mem_spd *spd_info, bool half_populated, bool *dimms_changed) + const struct mem_spd *spd_info, bool half_populated) { struct mem_channel_data data; bool dq_dqs_auto_detect = false; @@ -280,7 +280,7 @@ void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, } mem_populate_channel_data(memupd, &soc_mem_cfg[mb_cfg->type], spd_info, half_populated, - &data, dimms_changed); + &data); mem_init_spd_upds(mem_cfg, &data); mem_init_dq_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect); mem_init_dqs_upds(mem_cfg, &data, mb_cfg, dq_dqs_auto_detect); diff --git a/src/soc/intel/common/block/include/intelblocks/meminit.h b/src/soc/intel/common/block/include/intelblocks/meminit.h index 6276a7e294..3ebf5368a1 100644 --- a/src/soc/intel/common/block/include/intelblocks/meminit.h +++ b/src/soc/intel/common/block/include/intelblocks/meminit.h @@ -136,13 +136,11 @@ struct mem_channel_data { * the mainboard. * spd_info : Information about the memory topology. * half_populated: Hint from mainboard if channels are half populated. - * dimms_changed: True if the dimms is changed after caching the spd data. */ void mem_populate_channel_data(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cfg, const struct mem_spd *spd_info, bool half_populated, - struct mem_channel_data *data, - bool *dimms_changed); + struct mem_channel_data *data); /* * Given a channel number and the maximum number of supported channels, this diff --git a/src/soc/intel/common/block/memory/meminit.c b/src/soc/intel/common/block/memory/meminit.c index 272e6a1503..1c6563abc6 100644 --- a/src/soc/intel/common/block/memory/meminit.c +++ b/src/soc/intel/common/block/memory/meminit.c @@ -98,7 +98,7 @@ static void read_spd_md(const struct soc_mem_cfg *soc_mem_cfg, const struct mem_ static bool read_spd_dimm(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cfg, const struct mem_spd *info, bool half_populated, struct mem_channel_data *channel_data, - size_t *spd_len, bool *dimms_changed) + size_t *spd_len) { size_t ch, dimm; struct spd_block blk = { 0 }; @@ -110,7 +110,6 @@ static bool read_spd_dimm(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cf * channel is marked as populated. */ uint32_t pop_mask = 0; - *dimms_changed = false; if (!(info->topo & MEM_TOPO_DIMM_MODULE)) return false; @@ -134,14 +133,15 @@ static bool read_spd_dimm(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cf printk(BIOS_WARNING, "Invalid SPD cache\n"); } else { dimm_changed = check_if_dimm_changed(spd_cache, &blk); - if (dimm_changed) { + if (dimm_changed && memupd->FspmArchUpd.NvsBufferPtr != 0) { /* - * Set flag to indicate that the + * Set FSP-M Arch UPD to indicate that the * mrc_cache need to be invalidated */ - printk(BIOS_INFO, - "DIMM change, invalidate cache.\n"); - *dimms_changed = true; + printk(BIOS_INFO, "DIMM change, invalidate cache.\n"); + memupd->FspmArchUpd.NvsBufferPtr = 0; + memupd->FspmArchUpd.BootMode = + FSP_BOOT_WITH_FULL_CONFIGURATION; } } need_update_cache = true; @@ -187,8 +187,7 @@ static bool read_spd_dimm(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cf void mem_populate_channel_data(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_mem_cfg, const struct mem_spd *spd_info, bool half_populated, - struct mem_channel_data *data, - bool *dimms_changed) + struct mem_channel_data *data) { size_t spd_md_len = 0, spd_dimm_len = 0; bool have_dimms; @@ -197,7 +196,7 @@ void mem_populate_channel_data(FSPM_UPD *memupd, const struct soc_mem_cfg *soc_m read_spd_md(soc_mem_cfg, spd_info, half_populated, data, &spd_md_len); have_dimms = read_spd_dimm(memupd, soc_mem_cfg, spd_info, half_populated, data, - &spd_dimm_len, dimms_changed); + &spd_dimm_len); if (data->ch_population_flags == NO_CHANNEL_POPULATED) die("No channels are populated. Incorrect memory configuration!\n"); diff --git a/src/soc/intel/tigerlake/meminit.c b/src/soc/intel/tigerlake/meminit.c index 10c57a5532..368e071407 100644 --- a/src/soc/intel/tigerlake/meminit.c +++ b/src/soc/intel/tigerlake/meminit.c @@ -151,14 +151,13 @@ void memcfg_init(FSPM_UPD *memupd, const struct mb_cfg *mb_cfg, const struct mem_spd *spd_info, bool half_populated) { struct mem_channel_data data; - bool dimms_changed = false; FSP_M_CONFIG *mem_cfg = &memupd->FspmConfig; if (mb_cfg->type >= ARRAY_SIZE(soc_mem_cfg)) die("Invalid memory type(%x)!\n", mb_cfg->type); mem_populate_channel_data(memupd, &soc_mem_cfg[mb_cfg->type], spd_info, half_populated, - &data, &dimms_changed); + &data); mem_init_spd_upds(mem_cfg, &data); mem_init_dq_upds(mem_cfg, &data, mb_cfg); mem_init_dqs_upds(mem_cfg, &data, mb_cfg); |