From 70fe2707ba0d9e1e2f51c5ae7e813052ed044a81 Mon Sep 17 00:00:00 2001 From: Arthur Heymans Date: Wed, 7 Apr 2021 15:29:45 +0200 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/52157 Tested-by: build bot (Jenkins) Reviewed-by: Frans Hendriks --- src/drivers/mrc_cache/mrc_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/drivers') 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(®ion, type); -- cgit v1.2.3