diff options
author | Furquan Shaikh <furquan@chromium.org> | 2017-10-13 13:08:34 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2017-10-18 23:14:18 -0700 |
commit | 5bd5f1b1fa005dbe1cc3c763919270e01a38b8d2 (patch) | |
tree | 4190173e20f8a457c79cf67ba356707dfae44ed0 /include/lpc.h | |
parent | 05d59d14c9d89a567bbdaede79f8b1d81e5e7c42 (diff) | |
download | chrome-ec-5bd5f1b1fa005dbe1cc3c763919270e01a38b8d2.tar.gz |
host_event_commands: Add support for always reporting masks
Add a new mask type (ALWAYS_REPORT mask) that is set by default to
certain host events that should always be reported to the host
irrespective of the state of SCI, SMI and wake masks. This mask
includes host events like critical events resulting in shutdown or
reboot, events that are consumed by BIOS, etc.
Now that ALWAYS_REPORT mask is added, this change also updates the way
EC manages set/query operations for host events:
1. During set operation, EC will check if the host event is present in
any of the 4 masks - SCI, SMI, wake and always report. If yes, then it
is set in hostevents.
2. During query operation, EC will extract the lowest set event from
hostevents, clear it and return it back to the host.
In order to reflect the above change in EC behavior, a new feature bit
is used EC_FEATURE_UNIFIED_WAKE_MASKS. This allows the host to decide
when wake mask needs to be set before checking for host events.
BUG=None
BRANCH=None
TEST=make -j buildall. Also verified following:
1. Wake from S3 works as expected. Host is able to log correct wake
sources (Verified power button, lid open, base key press and tablet
mode change on soraka).
2. Wake from S5 works as expected. Host is able to log correct wake
sources (Verified power button, lid open on soraka).
3. Wake from S0ix works as expected (Verified power button, lid open
on soraka).
4. Software method to trigger recovery still works fine:
reboot ap-off
hostevent set 0x4000
powerb
Change-Id: I62e5c1f82247c82348cd019e082883d86ec2688f
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/719578
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'include/lpc.h')
-rw-r--r-- | include/lpc.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/lpc.h b/include/lpc.h index ff9642b6f5..a405e93d59 100644 --- a/include/lpc.h +++ b/include/lpc.h @@ -71,6 +71,7 @@ enum lpc_host_event_type { LPC_HOST_EVENT_SMI = 0, LPC_HOST_EVENT_SCI, LPC_HOST_EVENT_WAKE, + LPC_HOST_EVENT_ALWAYS_REPORT, LPC_HOST_EVENT_COUNT, }; @@ -141,4 +142,11 @@ void lpc_enable_acpi_interrupts(void); */ void lpc_update_host_event_status(void); +/* + * This is a weak function defined in host_events_commands.c to override the + * LPC_HOST_EVENT_ALWAYS_REPORT mask. It can be implemented by boards if there + * is a need to use custom mask. + */ +uint32_t lpc_override_always_report_mask(void); + #endif /* __CROS_EC_LPC_H */ |