mb/google/eve: Implement EC device events for S3 wake

Add support for waking from and logging device events that
originate in the Embedded Controller.  As this device uses
Deep S3 it relies on the EC to wake the AP from the trackpad
and DSP wake sources.

BUG=b:30624430
TEST=manual testing on Eve: wake from Deep S3 via trackpad and
DSP and verify the event log contains the expected device event.

Change-Id: I0d6a9c5bfd4cea85e13446ffaa6fe3dab0db96a2
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://review.coreboot.org/20428
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
Duncan Laurie 2017-06-29 23:57:13 -07:00
parent 7378a1792a
commit af81a9132a
3 changed files with 12 additions and 0 deletions

View File

@ -24,6 +24,10 @@ void mainboard_ec_init(void)
google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS |
MAINBOARD_EC_S3_WAKE_EVENTS);
/* Log and clear device events that may wake the system */
google_chromeec_log_device_events(
MAINBOARD_EC_S3_DEVICE_EVENTS);
/* Disable SMI and wake events */
google_chromeec_set_smi_mask(0);

View File

@ -48,6 +48,7 @@
/* EC can wake from S3 with lid or power button or key press */
#define MAINBOARD_EC_S3_WAKE_EVENTS \
(MAINBOARD_EC_S5_WAKE_EVENTS |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_DEVICE) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_KEY_PRESSED))
/* Log EC wake events plus EC shutdown events */
@ -56,6 +57,11 @@
EC_HOST_EVENT_MASK(EC_HOST_EVENT_BATTERY_SHUTDOWN) |\
EC_HOST_EVENT_MASK(EC_HOST_EVENT_PANIC))
/* EC device events to enable and log in S3 */
#define MAINBOARD_EC_S3_DEVICE_EVENTS \
(EC_DEVICE_EVENT_MASK(EC_DEVICE_EVENT_TRACKPAD) |\
EC_DEVICE_EVENT_MASK(EC_DEVICE_EVENT_DSP))
/*
* ACPI related definitions for ASL code.
*/

View File

@ -36,6 +36,8 @@ void mainboard_smi_sleep(u8 slp_typ)
{
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS,
MAINBOARD_EC_S5_WAKE_EVENTS);
chromeec_smi_device_event_sleep(slp_typ,
MAINBOARD_EC_S3_DEVICE_EVENTS, 0);
mainboard_gpio_smi_sleep(slp_typ);
}