Andrey Petrov (andrey.petrov@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17165
-gerrit
commit 8dc96256bb9d132cd7301c95bafe8050000c49c0 Author: Andrey Petrov andrey.petrov@intel.com Date: Thu Oct 27 10:12:22 2016 -0700
drivers/intel/fsp2_0: Allow use of MRC cache data in recovery
Add a configuration option to allow using MRC cache in recovery boot, off by default. This can be overridden by Chrome EC if it requests retrain.
BUG=chrome-os-partner:56643 BRANCH=none TEST=invoke power-alt-refresh key combination, notice memory is retrained in recovery
Change-Id: I31a87afc8a70c17e488c06e42da4acbb2dde3f5d Signed-off-by: Andrey Petrov andrey.petrov@intel.com --- src/drivers/intel/fsp2_0/Kconfig | 7 +++++++ src/drivers/intel/fsp2_0/memory_init.c | 9 +++++++-- src/soc/intel/apollolake/Kconfig | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/drivers/intel/fsp2_0/Kconfig b/src/drivers/intel/fsp2_0/Kconfig index c653148..75e3901 100644 --- a/src/drivers/intel/fsp2_0/Kconfig +++ b/src/drivers/intel/fsp2_0/Kconfig @@ -94,4 +94,11 @@ config RESET_ON_INVALID_RAMSTAGE_CACHE bool "Reset the system on S3 wake when ramstage cache invalid." default n
+config FSP_RECOVERY_USE_MRCCACHE + bool "Use MRC cache in recovery boot" + depends on CACHE_MRC_SETTINGS + default n + help + Select yes if you want recovery boot to use MRC cache. + endif diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index d0a22ce..70379c3 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -113,12 +113,17 @@ static void fsp_fill_mrc_cache(FSPM_ARCH_UPD *arch_upd, bool s3wake, if (!IS_ENABLED(CONFIG_CACHE_MRC_SETTINGS)) return;
- /* Don't use saved training data when recovery mode is enabled. */ - if (vboot_recovery_mode_enabled()) { + if (!IS_ENABLED(CONFIG_FSP_RECOVERY_USE_MRCCACHE)) { printk(BIOS_SPEW, "Recovery mode. Not using MRC cache.\n"); return; }
+ /* If recovery with full retrain is requested do not load cache */ + if (vboot_recovery_mode_memory_retrain()) { + printk(BIOS_SPEW, "Recovery with forced memory retrain.\n"); + return; + } + if (mrc_cache_get_current_with_version(&mrc_cache, fsp_version)) { printk(BIOS_SPEW, "MRC cache was not found\n"); return; diff --git a/src/soc/intel/apollolake/Kconfig b/src/soc/intel/apollolake/Kconfig index 187214a..b6fbcb4 100644 --- a/src/soc/intel/apollolake/Kconfig +++ b/src/soc/intel/apollolake/Kconfig @@ -260,4 +260,8 @@ config SMM_RESERVED_SIZE hex default 0x100000
+config CONFIG_FSP_RECOVERY_USE_MRCCACHE + bool + default y + endif