summaryrefslogtreecommitdiff
path: root/board/cr50/power_button.c
diff options
context:
space:
mode:
authorDavid Stevens <stevensd@chromium.org>2021-08-25 01:22:24 +0000
committerDavid Stevens <stevensd@chromium.org>2021-08-25 01:24:10 +0000
commit1485393c069ed6c4b9419154664e7407e7022c2e (patch)
treeb46e568e7a7d49966adeaacc1d3d7c2633084a85 /board/cr50/power_button.c
parent5ae1c684271a117539858cb12252959dfe46803c (diff)
downloadchrome-ec-stabilize-14178.B-cr50_stab.tar.gz
Revert "u2f: refactoring to split command processing and crypto"stabilize-14179.B-cr50_stabstabilize-14178.B-cr50_stab
This reverts commit 5ae1c684271a117539858cb12252959dfe46803c. Reason for revert: breaks chromeos-ec-headers BUG=b:197691499 Original change's description: > u2f: refactoring to split command processing and crypto > > Split U2F crypto from U2F command processing by moving all crypto > code into boards/cr50 (platform hooks). > > U2F state management is part of common code and passed to U2F crypto > as a parameter. > > BUG=b:134594373 > TEST=make BOARD=cr50 CRYPTO_TEST=1 > console: u2f_test > test/tpmtest.py > FAFT U2F tests pass > > Signed-off-by: Vadim Sukhomlinov <sukhomlinov@google.com> > Change-Id: I85442cddb2959bd3102f7f6e6047134ede90951b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3034852 > Reviewed-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> > Reviewed-by: Andrey Pronin <apronin@chromium.org> > Tested-by: Vadim Sukhomlinov <sukhomlinov@chromium.org> > Commit-Queue: Vadim Sukhomlinov <sukhomlinov@chromium.org> Bug: b:134594373 Change-Id: I61a965995fcd53b4e155084f5f351574cb84cd1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115930 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Owners-Override: David Stevens <stevensd@chromium.org>
Diffstat (limited to 'board/cr50/power_button.c')
-rw-r--r--board/cr50/power_button.c38
1 files changed, 1 insertions, 37 deletions
diff --git a/board/cr50/power_button.c b/board/cr50/power_button.c
index a13f450031..2d22966273 100644
--- a/board/cr50/power_button.c
+++ b/board/cr50/power_button.c
@@ -15,6 +15,7 @@
#include "system_chip.h"
#include "task.h"
#include "timer.h"
+#include "u2f_impl.h"
#define CPRINTS(format, args...) cprints(CC_RBOX, format, ## args)
#define CPRINTF(format, args...) cprintf(CC_RBOX, format, ## args)
@@ -307,43 +308,6 @@ static void power_button_init(void)
DECLARE_HOOK(HOOK_INIT, power_button_init, HOOK_PRIO_DEFAULT);
#endif /* CONFIG_U2F */
-/* ---- physical presence (using the laptop power button) ---- */
-
-static timestamp_t last_press;
-
-/* how long do we keep the last button press as valid presence */
-#define PRESENCE_TIMEOUT (10 * SECOND)
-
-void power_button_record(void)
-{
- if (ap_is_on() && rbox_powerbtn_is_pressed()) {
- last_press = get_time();
-#ifdef CR50_DEV
- CPRINTS("record pp");
-#endif
- }
-}
-
-enum touch_state pop_check_presence(int consume)
-{
-#ifdef CRYPTO_TEST_SETUP
- return POP_TOUCH_YES;
-#else
- int recent = ((last_press.val > 0) &&
- ((get_time().val - last_press.val) < PRESENCE_TIMEOUT));
-
-#ifdef CR50_DEV
- if (recent)
- CPRINTS("User presence: consumed %d", consume);
-#endif
- if (consume)
- last_press.val = 0;
-
- /* user physical presence on the power button */
- return recent ? POP_TOUCH_YES : POP_TOUCH_NO;
-#endif
-}
-
void board_physical_presence_enable(int enable)
{
#ifndef CONFIG_U2F