diff options
author | Joel Kitching <kitching@chromium.org> | 2018-06-25 18:48:07 +0000 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2018-06-25 18:51:39 +0000 |
commit | b22b8446939095a5d19cc099c3ec2bad5c0d8344 (patch) | |
tree | 3cf3e3d47dc1f6d3462aeed66aef7f1529533bcd | |
parent | 1386dcfe7637ba4850497ff0c16d3b9b421c402c (diff) | |
download | chrome-ec-b22b8446939095a5d19cc099c3ec2bad5c0d8344.tar.gz |
Revert "host_event: Perform lpc_init_mask before keyboard/button init"
This reverts commit 61cb81aed63dec095af4a7590bcfa23b7bd8c89d.
Reason for revert: Re-using 32-bit host events instead. See b/110292722
Original change's description:
> host_event: Perform lpc_init_mask before keyboard/button init
>
> keyboard/button init are responsible for checking if user requested
> manual recovery. However, by this time, hook init is not run and hence
> host event set operation for manual recovery is dropped. This change
> adds a call to lpc_init_mask before keyboard/button init operations
> are performed.
>
> BUG=b:68189465
> BRANCH=None
> TEST=Verified that manual recovery works fine. Recovery using software
> command works too:
> reboot ap-off
> hostevent set 0x4000
> powerb
>
> Change-Id: I4ba4ac480f78daafb2006a2b77250687b19a838d
> Signed-off-by: Furquan Shaikh <furquan@chromium.org>
> Reviewed-on: https://chromium-review.googlesource.com/735799
> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
> Reviewed-by: Shawn N <shawnn@chromium.org>
> (cherry picked from commit 708f6f1f21d4cee970c6bf7dadefee3936af228d)
> Reviewed-on: https://chromium-review.googlesource.com/989865
> Reviewed-by: Joel Kitching <kitching@chromium.org>
> Commit-Queue: Joel Kitching <kitching@chromium.org>
> Tested-by: Joel Kitching <kitching@chromium.org>
> Trybot-Ready: Joel Kitching <kitching@chromium.org>
Bug: b:68189465
Change-Id: I9213094aff40edf03aa5b7e8ffdf3d43e5aea708
Reviewed-on: https://chromium-review.googlesource.com/1113785
Reviewed-by: Joel Kitching <kitching@chromium.org>
Commit-Queue: Joel Kitching <kitching@chromium.org>
Tested-by: Joel Kitching <kitching@chromium.org>
Trybot-Ready: Joel Kitching <kitching@chromium.org>
-rw-r--r-- | common/host_event_commands.c | 8 | ||||
-rw-r--r-- | common/main.c | 11 | ||||
-rw-r--r-- | include/lpc.h | 3 |
3 files changed, 7 insertions, 15 deletions
diff --git a/common/host_event_commands.c b/common/host_event_commands.c index 917ce78e03..d2fa584855 100644 --- a/common/host_event_commands.c +++ b/common/host_event_commands.c @@ -144,7 +144,7 @@ uint32_t __attribute__((weak)) lpc_override_always_report_mask(void) return LPC_HOST_EVENT_ALWAYS_REPORT_DEFAULT_MASK; } -void lpc_init_mask(void) +static void lpc_init_mask(void) { /* * First check if masks were stashed before sysjump. If no masks were @@ -156,6 +156,12 @@ void lpc_init_mask(void) lpc_override_always_report_mask(); } +/* + * This hook is required to run before chip gets to initialize LPC because + * update host events will need the masks to be correctly restored. + */ +DECLARE_HOOK(HOOK_INIT, lpc_init_mask, HOOK_PRIO_INIT_LPC - 1); + #endif /* diff --git a/common/main.c b/common/main.c index 8d43967c3f..c1f4bbdce6 100644 --- a/common/main.c +++ b/common/main.c @@ -17,7 +17,6 @@ #include "gpio.h" #include "hooks.h" #include "jtag.h" -#include "lpc.h" #include "keyboard_scan.h" #ifdef CONFIG_MPU #include "mpu.h" @@ -156,16 +155,6 @@ test_mockable __keep int main(void) #ifdef CONFIG_EEPROM eeprom_init(); #endif - - /* - * 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 - * correctly. - */ -#ifdef CONFIG_LPC - lpc_init_mask(); -#endif #ifdef HAS_TASK_KEYSCAN keyboard_scan_init(); #endif diff --git a/include/lpc.h b/include/lpc.h index 05b8d660e3..a405e93d59 100644 --- a/include/lpc.h +++ b/include/lpc.h @@ -149,7 +149,4 @@ void lpc_update_host_event_status(void); */ uint32_t lpc_override_always_report_mask(void); -/* Initialize LPC masks. */ -void lpc_init_mask(void); - #endif /* __CROS_EC_LPC_H */ |