aboutsummaryrefslogtreecommitdiff
path: root/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
diff options
context:
space:
mode:
authorTimothy Pearson <tpearson@raptorengineeringinc.com>2015-06-10 10:46:17 -0500
committerStefan Reinauer <stefan.reinauer@coreboot.org>2015-11-12 00:51:23 +0100
commitf70946ff4d70d763ce75bf3876bc94dc708275b1 (patch)
treeb75f957e19a6cc75a8f86c5a480d8f3348baeaad /src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
parentab87c4db30acda329d010ac9e91d0bb8b9c6c1cc (diff)
northbridge/amd/amdmct: Verify MCT NVRAM options before skipping training
Change-Id: If26e5d148a906d63bd1407b8ffa58f08ae6b4275 Signed-off-by: Timothy Pearson <tpearson@raptorengineeringinc.com> Reviewed-on: http://review.coreboot.org/11986 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/northbridge/amd/amdmct/mct_ddr3/mct_d.c')
-rw-r--r--src/northbridge/amd/amdmct/mct_ddr3/mct_d.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
index 2d8ab34c61..2841b18c6d 100644
--- a/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
+++ b/src/northbridge/amd/amdmct/mct_ddr3/mct_d.c
@@ -4134,7 +4134,7 @@ static void mct_preInitDCT(struct MCTStatStruc *pMCTstat,
#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
calculate_and_store_spd_hashes(pMCTstat, pDCTstat);
- if (load_spd_hashes_from_nvram(pDCTstat) < 0) {
+ if (load_spd_hashes_from_nvram(pMCTstat, pDCTstat) < 0) {
pDCTstat->spd_data.nvram_spd_match = 0;
}
else {
@@ -4149,6 +4149,13 @@ static void mct_preInitDCT(struct MCTStatStruc *pMCTstat,
if (get_option(&nvram, "allow_spd_nvram_cache_restore") == CB_SUCCESS)
allow_config_restore = !!nvram;
+#if IS_ENABLED(CONFIG_HAVE_ACPI_RESUME)
+ if (pMCTstat->nvram_checksum != calculate_nvram_mct_hash())
+ allow_config_restore = 0;
+#else
+ allow_config_restore = 0;
+#endif
+
if (!allow_config_restore)
pDCTstat->spd_data.nvram_spd_match = 0;
}