summaryrefslogtreecommitdiff
path: root/board/cr50/power_button.c
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2020-04-24 18:43:45 -0700
committerCommit Bot <commit-bot@chromium.org>2020-05-29 04:42:17 +0000
commit85d2ae0a9056859a0c159406121fc586c99d98e1 (patch)
treeed48f8ccc51fd3be879421c6d093415c3d100c32 /board/cr50/power_button.c
parent000c22149838ac3ffcb2b6115d5442432c028416 (diff)
downloadchrome-ec-85d2ae0a9056859a0c159406121fc586c99d98e1.tar.gz
Plug in the AP RO verification implementation
This adds plumbing necessary to invoke the AP RO verification function in response to the operator entering the 'magic sequence' of holding the power button pressed and pressing/releasing the refresh button three times within five seconds. The code used during the 'Open box RMA' verification process is used, with the physical presence confirmation phase bypassed. This patch also makes sure that attempts to use CCD to program AP or EC flash while AP RO verification is in progress would fail. BUG=b:153764696, b:154966209 TEST=with the next patch applied, generated AP integrity verification data using the ap_ro_hash.py script and then ran the verification procedure, observing the 'hash match' message on the Cr50 console. Also verified that the Open Box RMA procedure still succeeds. Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: Ic101fb892554ebb05f9ebe6d1546bfb439f74043 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2171399 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
Diffstat (limited to 'board/cr50/power_button.c')
-rw-r--r--board/cr50/power_button.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/board/cr50/power_button.c b/board/cr50/power_button.c
index a7d3634a00..bff6c4890c 100644
--- a/board/cr50/power_button.c
+++ b/board/cr50/power_button.c
@@ -3,6 +3,7 @@
* found in the LICENSE file.
*/
+#include "ap_ro_integrity_check.h"
#include "console.h"
#include "extension.h"
#include "gpio.h"
@@ -145,11 +146,13 @@ static int rctd_poll_handler(void)
if (!ref_last_state)
return 1;
- CPRINTS("Esc press registered");
- if (++ref_press_count != PRESS_COUNT)
+ if (++ref_press_count != PRESS_COUNT) {
+ CPRINTS("Refresh press registered");
return 1;
+ }
CPRINTS("RO Validation triggered");
+ validate_ap_ro();
return 0;
}