summaryrefslogtreecommitdiff
path: root/board/cr50/recovery_button.h
diff options
context:
space:
mode:
authorDuncan Laurie <dlaurie@google.com>2018-12-21 15:03:01 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-22 21:05:23 -0800
commitca8b915b59822f9d464862b599ade8e35712abc3 (patch)
treea4469987d5275d029217737e58bd6301c0130fd5 /board/cr50/recovery_button.h
parent34ad90fb651e650f41194df4ff483af6daecd808 (diff)
downloadchrome-ec-ca8b915b59822f9d464862b599ade8e35712abc3.tar.gz
cr50: REFRESH+PWR combinatinon to enter recovery mode
Add support for entering recovery mode via the REFRESH_PWR key combination. This is needed on a platform with a closed source EC when the EC cannot be trusted to handle the normal ESC+REFRRESH+PWR combination. Add an interrupt handler for the RBOX key combo and when it is detected, generate an EC reset pulse via RBOX. The recovery state is latched into NVMEM so it can be queried by coreboot/verstage on the next boot. This change also ensures that all EC resets initiated by the Cr50 have a minimum pulse width of 30 ms to meet the EC requirement. BUG=b:122715254,b:119275910, BRANCH=cr50 TEST=make buildall. Verified boot to recovery mode screen after pressing REFRESH+PWR. Verified recovery mode entry from S0 and S5 states. Change-Id: I840ee1024bbfba00e47050eeb8b1ede244148c05 Signed-off-by: Duncan Laurie <dlaurie@google.com> Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1389061 Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
Diffstat (limited to 'board/cr50/recovery_button.h')
-rw-r--r--board/cr50/recovery_button.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/board/cr50/recovery_button.h b/board/cr50/recovery_button.h
new file mode 100644
index 0000000000..4a237a776a
--- /dev/null
+++ b/board/cr50/recovery_button.h
@@ -0,0 +1,17 @@
+/*
+ * Copyright 2019 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __EC_BOARD_CR50_RECOVERY_BUTTON_H
+#define __EC_BOARD_CR50_RECOVERY_BUTTON_H
+
+/**
+ * Latch a recovery button sequence. This state is latched for
+ * RECOVERY_BUTTON_TIMEOUT or until the AP requests the recovery button
+ * state.
+ */
+void recovery_button_record(void);
+
+#endif /* ! __EC_BOARD_CR50_RECOVERY_BUTTON_H */