summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block/memory
diff options
context:
space:
mode:
authorSubrata Banik <subratabanik@google.com>2022-03-10 19:12:02 +0530
committerSubrata Banik <subratabanik@google.com>2022-03-15 10:18:28 +0000
commit4703edc943985ad1429d48866cf8c070541df713 (patch)
tree1bb5edc7b089b1217bb65105ca3ad866191960f2 /src/soc/intel/common/block/memory
parent47b836af96186af3cf207b0a2bc4d99ac832680d (diff)
{mb, soc}: Move mrc_cache invalidating logic into `memory` common code
Commit hash b8b40964 ( mb, soc: Add the SPD_CACHE_ENABLE) introduced per mainboard logic to invalidate the mrc_cache. This patch moves mrc_cache invalidating logic into IA common code and cleans up the code to remove unused argument `dimms_changed` from SoC and mainboard directory. BUG=b:200243989 BRANCH=firmware-brya-14505.B TEST=Able to build and boot redrix without any visible failure/errors. Signed-off-by: Subrata Banik <subratabanik@google.com> Change-Id: I6f18e18adc6572571871dd6da1698186e4e3d671 Reviewed-on: https://review.coreboot.org/c/coreboot/+/62738 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Eric Lai <eric_lai@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@google.com>
Diffstat (limited to 'src/soc/intel/common/block/memory')
-rw-r--r--src/soc/intel/common/block/memory/meminit.c19
1 files changed, 9 insertions, 10 deletions
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");