diff options
author | Keith Short <keithshort@chromium.org> | 2021-03-15 12:00:31 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-16 18:54:03 +0000 |
commit | f466ce078261a513ffd561d6deaaa15947424e19 (patch) | |
tree | b5bdb7c32041abca40a578aeb71d7021e23ac5a1 | |
parent | f6bc0dfffca27571f24ba97aa2f67caa7a386fc5 (diff) | |
download | chrome-ec-f466ce078261a513ffd561d6deaaa15947424e19.tar.gz |
zephyr: Fix recovery mode
The Zephyr initialization was missing a call to lpc_int_mask(), which
caused the detected recovery event to be ignored. Add this call before
keyboard_scan_init() to match Chromium EC initialization.
Note - this requires CL:2731180 for recovery mode be detected correctly.
BUG=b:182808955
BRANCH=none
TEST=zmake testall
TEST=Press recovery combo, verify depthcharge starts recovery mode.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: If03a837208d6fc025aef1359e72c09fcf39b5656
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2760805
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | common/main.c | 2 | ||||
-rw-r--r-- | zephyr/app/ec/main.c | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/common/main.c b/common/main.c index 2e9fe5a444..c1626e41fc 100644 --- a/common/main.c +++ b/common/main.c @@ -185,7 +185,7 @@ test_mockable __keep int main(void) /* * Keyboard scan init/Button init can set recovery events to * indicate to host entry into recovery mode. Before this is - * done, lpc always report mask needs to be initialized + * done, LPC_HOST_EVENT_ALWAYS_REPORT mask needs to be initialized * correctly. */ #ifdef CONFIG_HOSTCMD_X86 diff --git a/zephyr/app/ec/main.c b/zephyr/app/ec/main.c index e297dae2d9..58b2b2a51e 100644 --- a/zephyr/app/ec/main.c +++ b/zephyr/app/ec/main.c @@ -10,6 +10,7 @@ #include "ec_tasks.h" #include "hooks.h" #include "keyboard_scan.h" +#include "lpc.h" #include "system.h" #include "vboot.h" #include "watchdog.h" @@ -32,6 +33,16 @@ void main(void) init_reset_log(); } + /* + * Keyboard scan init/Button init can set recovery events to + * indicate to host entry into recovery mode. Before this is + * done, LPC_HOST_EVENT_ALWAYS_REPORT mask needs to be initialized + * correctly. + */ + if (IS_ENABLED(CONFIG_HOSTCMD_X86)) { + lpc_init_mask(); + } + if (IS_ENABLED(HAS_TASK_KEYSCAN)) { keyboard_scan_init(); } |