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>
This commit is contained in:
Arthur Heymans 2021-04-07 15:29:45 +02:00 committed by Patrick Georgi
parent 58e1e0aee9
commit 70fe2707ba
1 changed files with 2 additions and 1 deletions

View File

@ -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);