summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMary Ruthven <mruthven@chromium.org>2022-02-11 19:33:54 -0600
committerCommit Bot <commit-bot@chromium.org>2022-02-21 04:41:26 +0000
commit1a1168ed6db553356b8c02d4fa0f086d69f8e502 (patch)
treede46f2d3940e27e1599db8cf9cf95118974eea9d
parent43fa560eb5c519f1a5afabe1fb2374943fe88013 (diff)
downloadchrome-ec-1a1168ed6db553356b8c02d4fa0f086d69f8e502.tar.gz
cr50: reset the ec efs boot_mode after the key combo0 is pressed
Cr50 resets the EC when key_combo0 is pressed, so it can clear the ec boot mode. BUG=b:219102909 TEST=none Change-Id: I3d024b5a16d5658cf259b5513513e7734aa62d31 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3457894 Reviewed-by: Andrey Pronin <apronin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--board/cr50/board.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/board/cr50/board.c b/board/cr50/board.c
index 323b7d4d71..567ef45d27 100644
--- a/board/cr50/board.c
+++ b/board/cr50/board.c
@@ -987,9 +987,10 @@ static void board_init(void)
/*
* Enable interrupt handler for RBOX key combo so it can be used to
- * store the recovery request.
+ * store the recovery request and reset ec_efs.
*/
- if (board_uses_closed_source_set1()) {
+ if (board_uses_closed_source_set1() ||
+ board_has_ec_cr50_comm_support()) {
/* Enable interrupt handler for reset button combo */
task_enable_irq(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO0_RDY_INT);
GWRITE_FIELD(RBOX, INT_ENABLE, INTR_BUTTON_COMBO0_RDY, 1);
@@ -1201,8 +1202,18 @@ void board_reboot_ec_deferred(int32_t usec_delay)
static void key_combo0_irq(void)
{
GWRITE_FIELD(RBOX, INT_STATE, INTR_BUTTON_COMBO0_RDY, 1);
- recovery_button_record();
- hook_call_deferred(&board_reboot_ec_data, 0);
+
+ if (board_has_ec_cr50_comm_support()) {
+ /* Hardware resets the EC. Clear boot_mode */
+ CPRINTS("combo0 efs rst");
+ ec_efs_reset();
+ }
+ /* Recovery_button_record is only used for closed_source_set1 */
+ if (board_uses_closed_source_set1()) {
+ recovery_button_record();
+ hook_call_deferred(&board_reboot_ec_data, 0);
+ }
+
CPRINTS("Recovery Requested");
}
DECLARE_IRQ(GC_IRQNUM_RBOX0_INTR_BUTTON_COMBO0_RDY_INT, key_combo0_irq, 0);