summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2019-01-23 13:53:44 -0700
committerchrome-bot <chrome-bot@chromium.org>2019-01-30 13:06:41 -0800
commit9ea99fb8004a8f9da2a13cf0371ffbdae1bef46f (patch)
tree47a59faff626969c03d220421a0f4317756002a6
parent54c06033f3813013296c9945d6ed13cd258a1db8 (diff)
downloadchrome-ec-9ea99fb8004a8f9da2a13cf0371ffbdae1bef46f.tar.gz
cr50: REFRESH+PWR recovery mode state lost to deep sleep
The recovery mode latched state gets lost due to deep sleep if the the Cr50 console is idle prior to capturing the REFRESH+PWR key combo. This change delays sleep so the AP has time to power back on and read the recovery state. BUG=b:123307572 BRANCH=cr50 TEST=make buildall. Verified boot to recovery mode screen with servo disconnected and verified boot to recovery mode with non dev image. Change-Id: Idf744c6967dc83c26a60429134ce3e8a9ab62ea3 Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1432314 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--board/cr50/recovery_button.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/board/cr50/recovery_button.c b/board/cr50/recovery_button.c
index 0ed4b78508..0a5702981f 100644
--- a/board/cr50/recovery_button.c
+++ b/board/cr50/recovery_button.c
@@ -9,6 +9,7 @@
#include "console.h"
#include "extension.h"
#include "registers.h"
+#include "system.h"
#include "timer.h"
#include "u2f_impl.h"
#include "util.h"
@@ -33,6 +34,14 @@ static timestamp_t last_press;
void recovery_button_record(void)
{
last_press = get_time();
+
+ /*
+ * Pressing the power button causes the AP to shutdown, and typically
+ * the Cr50 will enter deep sleep very quickly. Delay deep sleep
+ * so the recovery button state is saved long enough for the AP to
+ * power on and read the recovery button state.
+ */
+ delay_sleep_by(RECOVERY_BUTTON_TIMEOUT);
}
/*