aboutsummaryrefslogtreecommitdiff
path: root/src/soc/intel/common/mrc_cache.h
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2016-11-05 23:57:02 -0700
committerFurquan Shaikh <furquan@google.com>2016-11-10 00:50:23 +0100
commitcab1c01885e216027086b20c6b0628df7383f487 (patch)
tree04bd15dadb36f52fedc4e0a152fa5947f2157793 /src/soc/intel/common/mrc_cache.h
parent470852bb0898b07630b03d8246b9232fa84fe4de (diff)
mrc: Add support for separate training cache in recovery mode
1. Re-factor MRC cache driver to properly select RW_MRC_CACHE or RECOVERY_MRC_CACHE based on the boot mode. - If normal mode boot, use RW_MRC_CACHE, if available. - If recovery mode boot: - Retrain memory if RECOVERY_MRC_CACHE not present, or recovery is requested explicity with retrain memory request. - Use RECOVERY_MRC_CACHE otherwise. 2. Protect RW and RECOVERY mrc caches in recovery and non-recovery boot modes. Check if both are present under one unified region and protect that region as a whole. Else try protecting individual regions. 3. Update training data in appropriate cache: - Use RW_MRC_CACHE if normal mode. - Use RECOVERY_MRC_CACHE if present in recovery mode. Else use RW_MRC_CACHE. 4. Add proper debug logs to indicate which training data cache is used at any point. BUG=chrome-os-partner:59352 BRANCH=None TEST=Verified that correct cache is used in both normal and recovery mode on reef. Change-Id: Ie79737a1450bd1ff71543e44a5a3e16950e70fb3 Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/17242 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/intel/common/mrc_cache.h')
-rw-r--r--src/soc/intel/common/mrc_cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/soc/intel/common/mrc_cache.h b/src/soc/intel/common/mrc_cache.h
index 9b14c1efd8..850acd6c0a 100644
--- a/src/soc/intel/common/mrc_cache.h
+++ b/src/soc/intel/common/mrc_cache.h
@@ -19,6 +19,10 @@
#include <stddef.h>
#include <stdint.h>
+#define DEFAULT_MRC_CACHE "RW_MRC_CACHE"
+#define RECOVERY_MRC_CACHE "RECOVERY_MRC_CACHE"
+#define UNIFIED_MRC_CACHE "UNIFIED_MRC_CACHE"
+
/* Wrapper object to save MRC information. */
struct mrc_saved_data {
uint32_t signature;
@@ -32,6 +36,9 @@ struct mrc_saved_data {
int mrc_cache_get_current(const struct mrc_saved_data **cache);
int mrc_cache_get_current_with_version(const struct mrc_saved_data **cache,
uint32_t version);
+int mrc_cache_get_current_from_region(const struct mrc_saved_data **cache,
+ uint32_t version,
+ const char *region_name);
/* Stash the resulting MRC data to be saved in non-volatile storage later. */
int mrc_cache_stash_data(const void *data, size_t size);