summaryrefslogtreecommitdiff
path: root/common/host_event_commands.c
diff options
context:
space:
mode:
authorDaisuke Nojiri <dnojiri@chromium.org>2021-07-01 10:38:06 -0700
committerCommit Bot <commit-bot@chromium.org>2021-07-05 18:14:31 +0000
commit23a542566b89d5f00dbd3f5442e63f6d0cbf7477 (patch)
treed7208941f38d7553cd9fcd9070056fe70b28dee9 /common/host_event_commands.c
parent3c8257a31ea4ab522e65721ad20f133e86d0c955 (diff)
downloadchrome-ec-23a542566b89d5f00dbd3f5442e63f6d0cbf7477.tar.gz
System: Add SYSTEM_IN_MANUAL_RECOVERY flag
This patch adds SYSTEM_IN_MANUAL_RECOVERY, which indicates the system is in recovery mode. It's set when EC_HOST_EVENT_KEYBOARD_RECOVERY is set and cleared when the system shuts down (not when the host event flag is cleared). BUG=b:188242794 BRANCH=None TEST=Verify sysinfo command prints 'Recovery: yes' in recovery screen. TEST=Verify sysinfo command prints 'Recovery: no' after shutting down from recovery screen. Change-Id: I357e25fa4072cb4549dbe2c6bd476b0a93ccbb38 Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001190
Diffstat (limited to 'common/host_event_commands.c')
-rw-r--r--common/host_event_commands.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c
index ae2026efaf..1856c88c37 100644
--- a/common/host_event_commands.c
+++ b/common/host_event_commands.c
@@ -330,6 +330,10 @@ void host_set_events(host_event_t mask)
HOST_EVENT_CPRINTS("event set", mask);
+ if (!IS_ENABLED(CONFIG_ZTEST) &&
+ (mask & EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEYBOARD_RECOVERY)))
+ system_enter_manual_recovery();
+
host_events_atomic_or(&events, mask);
host_events_atomic_or(&events_copy_b, mask);