Joel Kitching has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/39343 )
Change subject: vboot: remove extraneous vboot_recovery_mode_memory_retrain ......................................................................
vboot: remove extraneous vboot_recovery_mode_memory_retrain
Just call get_recovery_mode_retrain_switch() directly.
BUG=b:124141368 TEST=make clean && make test-abuild BRANCH=none
Change-Id: Icb88d6862db1782e0218276984e527638b21fd3a Signed-off-by: Joel Kitching kitching@google.com --- M src/drivers/intel/fsp2_0/memory_init.c M src/drivers/mrc_cache/mrc_cache.c M src/security/vboot/bootmode.c M src/security/vboot/vboot_common.h M src/soc/mediatek/mt8183/memory.c 5 files changed, 4 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/39343/1
diff --git a/src/drivers/intel/fsp2_0/memory_init.c b/src/drivers/intel/fsp2_0/memory_init.c index 455dfa5..004b9e4 100644 --- a/src/drivers/intel/fsp2_0/memory_init.c +++ b/src/drivers/intel/fsp2_0/memory_init.c @@ -117,10 +117,10 @@ * 1. Recovery cache is not supported, or * 2. Memory retrain switch is set. */ - if (vboot_recovery_mode_enabled()) { + if (get_recovery_mode_retrain_switch()) { if (!CONFIG(HAS_RECOVERY_MRC_CACHE)) return; - if (vboot_recovery_mode_memory_retrain()) + if (get_recovery_mode_retrain_switch()) return; }
diff --git a/src/drivers/mrc_cache/mrc_cache.c b/src/drivers/mrc_cache/mrc_cache.c index 2881a6f..565feb8 100644 --- a/src/drivers/mrc_cache/mrc_cache.c +++ b/src/drivers/mrc_cache/mrc_cache.c @@ -516,7 +516,7 @@ /* Invalidate only on recovery mode with retraining enabled. */ if (!vboot_recovery_mode_enabled()) return; - if (!vboot_recovery_mode_memory_retrain()) + if (!get_recovery_mode_retrain_switch()) return;
if (fmap_locate_area_as_rdev_rw(name, &rdev) < 0) { diff --git a/src/security/vboot/bootmode.c b/src/security/vboot/bootmode.c index 55c1e79..c20117e 100644 --- a/src/security/vboot/bootmode.c +++ b/src/security/vboot/bootmode.c @@ -75,8 +75,3 @@ */ BOOT_STATE_INIT_ENTRY(BS_WRITE_TABLES, BS_ON_ENTRY, do_clear_recovery_mode_switch, NULL); - -int vboot_recovery_mode_memory_retrain(void) -{ - return get_recovery_mode_retrain_switch(); -} diff --git a/src/security/vboot/vboot_common.h b/src/security/vboot/vboot_common.h index 57f3475..8be9d2a 100644 --- a/src/security/vboot/vboot_common.h +++ b/src/security/vboot/vboot_common.h @@ -67,14 +67,12 @@ #if CONFIG(VBOOT) int vboot_developer_mode_enabled(void); int vboot_recovery_mode_enabled(void); -int vboot_recovery_mode_memory_retrain(void); int vboot_can_enable_udc(void); void vboot_run_logic(void); int vboot_locate_cbfs(struct region_device *rdev); #else /* !CONFIG_VBOOT */ static inline int vboot_developer_mode_enabled(void) { return 0; } static inline int vboot_recovery_mode_enabled(void) { return 0; } -static inline int vboot_recovery_mode_memory_retrain(void) { return 0; } /* If VBOOT is not enabled, we are okay enabling USB device controller (UDC). */ static inline int vboot_can_enable_udc(void) { return 1; } static inline void vboot_run_logic(void) {} diff --git a/src/soc/mediatek/mt8183/memory.c b/src/soc/mediatek/mt8183/memory.c index 78890ea..9b496fd 100644 --- a/src/soc/mediatek/mt8183/memory.c +++ b/src/soc/mediatek/mt8183/memory.c @@ -174,7 +174,7 @@ /* Load calibration params from flash and run fast calibration */ if (recovery_mode) { printk(BIOS_WARNING, "Skip loading cached calibration data\n"); - if (vboot_recovery_mode_memory_retrain() || + if (get_recovery_mode_retrain_switch() || vboot_check_recovery_request() == VB2_RECOVERY_TRAIN_AND_REBOOT) { printk(BIOS_WARNING, "Retrain memory in next boot\n"); /* Use 0xFF as erased flash data. */