Furquan Shaikh (furquan@google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17241
-gerrit
commit a21804dbefbaa1af50ad3ca57867d949e36be958 Author: Furquan Shaikh furquan@chromium.org Date: Sat Nov 5 23:52:08 2016 -0700
vboot: Add support for recovery mode with forced memory retraining
1. Add new function vboot_recovery_mode_memory_retrain that indicates if recovery mode requires memory retraining to be performed. 2. Add helper functions {get,clear}_recovery_mode_retrain_switch to read memory retrain switch. These are provided as weak functions which should be implemented by mainboard just like {get,clear}_recovery_mode_switch. 3. Additionally, the switch for recovery mode with forced memory training should be cleared when recovery mode switch is cleared.
BUG=chrome-os-partner:59352 BRANCH=None TEST=Verified behavior of recovery mode with forced memory retraining on reef.
Change-Id: I46c10fbf25bc100d9f562c36da3ac646c9dae7d1 Signed-off-by: Furquan Shaikh furquan@chromium.org --- src/include/bootmode.h | 2 ++ src/vboot/bootmode.c | 15 +++++++++++++++ src/vboot/vboot_common.h | 1 + src/vboot/vboot_handoff.c | 1 + 4 files changed, 19 insertions(+)
diff --git a/src/include/bootmode.h b/src/include/bootmode.h index 21aa386..012bc39 100644 --- a/src/include/bootmode.h +++ b/src/include/bootmode.h @@ -22,7 +22,9 @@ int get_write_protect_state(void); int get_sw_write_protect_state(void); int get_developer_mode_switch(void); int get_recovery_mode_switch(void); +int get_recovery_mode_retrain_switch(void); int clear_recovery_mode_switch(void); +int clear_recovery_mode_retrain_switch(void); int get_wipeout_mode_switch(void); int get_lid_switch(void);
diff --git a/src/vboot/bootmode.c b/src/vboot/bootmode.c index 12a4dc0..34377e1 100644 --- a/src/vboot/bootmode.c +++ b/src/vboot/bootmode.c @@ -162,6 +162,21 @@ int vboot_recovery_mode_enabled(void) return !!vboot_check_recovery_request(); }
+int __attribute__((weak)) get_recovery_mode_retrain_switch(void) +{ + return 0; +} + +int __attribute__((weak)) clear_recovery_mode_retrain_switch(void) +{ + return 0; +} + +int vboot_recovery_mode_memory_retrain(void) +{ + return get_recovery_mode_retrain_switch(); +} + int vboot_developer_mode_enabled(void) { if (!IS_ENABLED(CONFIG_VBOOT)) diff --git a/src/vboot/vboot_common.h b/src/vboot/vboot_common.h index 59fd44c..956b54c 100644 --- a/src/vboot/vboot_common.h +++ b/src/vboot/vboot_common.h @@ -107,5 +107,6 @@ void verstage_mainboard_init(void); /* Check boot modes */ int vboot_developer_mode_enabled(void); int vboot_recovery_mode_enabled(void); +int vboot_recovery_mode_memory_retrain(void);
#endif /* __VBOOT_VBOOT_COMMON_H__ */ diff --git a/src/vboot/vboot_handoff.c b/src/vboot/vboot_handoff.c index b0bd04c..a2409cf 100644 --- a/src/vboot/vboot_handoff.c +++ b/src/vboot/vboot_handoff.c @@ -163,6 +163,7 @@ void vboot_fill_handoff(void) * is known to be up. */ clear_recovery_mode_switch(); + clear_recovery_mode_retrain_switch(); }
/*