diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2021-07-15 13:51:35 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-07-23 08:46:51 +0000 |
commit | 2e3d89e009584037331a50a07540fa5fcd49e89f (patch) | |
tree | 7dd6ae6b938ba9c5a4ef944d3e411f5c8a58274c | |
parent | 7dd06acce250fc3d40db2c7615bf556de5c0ee5b (diff) | |
download | chrome-ec-2e3d89e009584037331a50a07540fa5fcd49e89f.tar.gz |
zephyr: fix MKBP_HOST_EVENT_WAKEUP_MASK
MKBP_HOST_EVENT_WAKEUP_MASK is right-shifted by 1 bit, so adjust
defining it in the dts.
The bug is impacting the waking up DUT with a host event, e.g.
EC_HOST_EVENT_RTC which is used during the firmware_EventLog test.
BUG=b:193495066
BRANCH=none
TEST=Suspend DUT with powerd_dbus_suspend, and make sure the EC command
"hostevent set 0x0000000002000000" wakes up the board.
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I253d0dc36cf216fe50a6473c3640fe906ef565e3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3031542
Reviewed-by: Simon Glass <sjg@chromium.org>
-rw-r--r-- | zephyr/boards/arm/trogdor/trogdor.dts | 21 | ||||
-rw-r--r-- | zephyr/dts/bindings/cros_mkbp_event/ec-mkbp-event.yaml | 13 | ||||
-rw-r--r-- | zephyr/include/dt-bindings/wake_mask_event_defines.h | 2 |
3 files changed, 26 insertions, 10 deletions
diff --git a/zephyr/boards/arm/trogdor/trogdor.dts b/zephyr/boards/arm/trogdor/trogdor.dts index 4bfbaca14d..f5e50d9466 100644 --- a/zephyr/boards/arm/trogdor/trogdor.dts +++ b/zephyr/boards/arm/trogdor/trogdor.dts @@ -39,20 +39,21 @@ ec-mkbp-host-event-wakeup-mask { compatible = "ec-wake-mask-event"; - wakeup-mask = <(HOST_EVENT_LID_OPEN | \ - HOST_EVENT_POWER_BUTTON | \ - HOST_EVENT_AC_CONNECTED | \ - HOST_EVENT_AC_DISCONNECTED | \ - HOST_EVENT_HANG_DETECT | \ - HOST_EVENT_RTC | \ - HOST_EVENT_MODE_CHANGE | \ - HOST_EVENT_DEVICE)>; + wakeup-mask = <( + HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | + HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | + HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | + HOST_EVENT_MASK(HOST_EVENT_RTC) | + HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE) | + HOST_EVENT_MASK(HOST_EVENT_DEVICE))>; }; ec-mkbp-event-wakeup-mask { compatible = "ec-wake-mask-event"; - wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | \ - MKBP_EVENT_HOST_EVENT | \ + wakeup-mask = <(MKBP_EVENT_KEY_MATRIX | + MKBP_EVENT_HOST_EVENT | MKBP_EVENT_SENSOR_FIFO)>; }; diff --git a/zephyr/dts/bindings/cros_mkbp_event/ec-mkbp-event.yaml b/zephyr/dts/bindings/cros_mkbp_event/ec-mkbp-event.yaml index c8f5a0c376..73f0e8fdca 100644 --- a/zephyr/dts/bindings/cros_mkbp_event/ec-mkbp-event.yaml +++ b/zephyr/dts/bindings/cros_mkbp_event/ec-mkbp-event.yaml @@ -14,3 +14,16 @@ properties: description: Define the MKBP or host events that will wake up the application processor from suspend mode. + HOST_EVENT_MASK should be used for ec-mkbp-host-event-wakeup-mask e.g. + ec-mkbp-host-event-wakeup-mask { + compatible = "ec-wake-mask-event"; + wakeup-mask = <( + HOST_EVENT_MASK(HOST_EVENT_LID_OPEN) | + HOST_EVENT_MASK(HOST_EVENT_POWER_BUTTON) | + HOST_EVENT_MASK(HOST_EVENT_AC_CONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_AC_DISCONNECTED) | + HOST_EVENT_MASK(HOST_EVENT_HANG_DETECT) | + HOST_EVENT_MASK(HOST_EVENT_RTC) | + HOST_EVENT_MASK(HOST_EVENT_MODE_CHANGE) | + HOST_EVENT_MASK(HOST_EVENT_DEVICE))>; + }; diff --git a/zephyr/include/dt-bindings/wake_mask_event_defines.h b/zephyr/include/dt-bindings/wake_mask_event_defines.h index 80be063279..0413fa249c 100644 --- a/zephyr/include/dt-bindings/wake_mask_event_defines.h +++ b/zephyr/include/dt-bindings/wake_mask_event_defines.h @@ -33,6 +33,8 @@ #define MKBP_EVENT_ONLINE_CALIBRATION BIT(11) #define MKBP_EVENT_PCHG BIT(12) +#define HOST_EVENT_MASK(event) ((event) >> 1) + #define HOST_EVENT_NONE BIT(0) #define HOST_EVENT_LID_CLOSED BIT(1) #define HOST_EVENT_LID_OPEN BIT(2) |