summaryrefslogtreecommitdiff
path: root/src/drivers/mrc_cache/mrc_cache.c
diff options
context:
space:
mode:
authorArthur Heymans <arthur@aheymans.xyz>2021-04-07 15:29:45 +0200
committerPatrick Georgi <pgeorgi@google.com>2021-04-09 06:18:20 +0000
commit70fe2707ba0d9e1e2f51c5ae7e813052ed044a81 (patch)
treeba7f3b9e303819af05f1629e67199c6edce5384f /src/drivers/mrc_cache/mrc_cache.c
parent58e1e0aee938a5a539c35ae52bfe718e41f7b224 (diff)
drivers/mrc_cache: Fix with VBOOT & VBOOT_STARTS_IN_ROMSTAGE
This guards code accessing the vboot context which does not exist if vboot starts after romstage. Change-Id: I2a38daa00d6d18df9c5e22858530814e23bb3e00 Signed-off-by: Arthur Heymans <arthur@aheymans.xyz> Reviewed-on: https://review.coreboot.org/c/coreboot/+/52157 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Frans Hendriks <fhendriks@eltan.com>
Diffstat (limited to 'src/drivers/mrc_cache/mrc_cache.c')
-rw-r--r--src/drivers/mrc_cache/mrc_cache.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/drivers/mrc_cache/mrc_cache.c b/src/drivers/mrc_cache/mrc_cache.c
index 8b26ea5905..f97031dadd 100644
--- a/src/drivers/mrc_cache/mrc_cache.c
+++ b/src/drivers/mrc_cache/mrc_cache.c
@@ -285,7 +285,8 @@ static int mrc_cache_find_current(int type, uint32_t version,
* In recovery mode, force retraining if the memory retrain
* switch is set.
*/
- if (vboot_recovery_mode_enabled() && get_recovery_mode_retrain_switch())
+ if (CONFIG(VBOOT_STARTS_IN_BOOTBLOCK) && vboot_recovery_mode_enabled()
+ && get_recovery_mode_retrain_switch())
return -1;
cr = lookup_region(&region, type);