Jenny Tc has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/29774
Change subject: hostevent: Enable lazy events for SCI mask ......................................................................
hostevent: Enable lazy events for SCI mask
With Lazy SCI events, dependancy on SMI handler for setting SCI events during boot can be avoided. On boot, coreboot notifies the SCI Lazy mask to EC. Once the EC driver is up in OS, it can notify the EC to convert SCI mask to ACTIVE SCI mask.
Change-Id: I6ff3aea2e7f11f1196d8d9ece03ae000354e884b Signed-off-by: Jenny TC jenny.tc@intel.com --- M src/ec/google/chromeec/ec.c M src/ec/google/chromeec/ec.h M src/ec/google/chromeec/ec_commands.h 3 files changed, 17 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/74/29774/1
diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index d2a0849..f2a68fd 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -65,6 +65,10 @@ [EC_HOST_EVENT_ALWAYS_REPORT_MASK] = { INVALID_HCMD, INVALID_HCMD, INVALID_HCMD, }, + [EC_HOST_EVENT_LAZY_SCI_MASK] = { + EC_CMD_HOST_EVENT_SET_SCI_MASK, INVALID_HCMD, + EC_CMD_HOST_EVENT_GET_SCI_MASK, + }, [EC_HOST_EVENT_ACTIVE_WAKE_MASK] = { EC_CMD_HOST_EVENT_SET_WAKE_MASK, INVALID_HCMD, EC_CMD_HOST_EVENT_GET_WAKE_MASK, @@ -483,11 +487,13 @@ google_chromeec_log_events(info->log_events | info->s5_wake_events);
- if (google_chromeec_is_uhepi_supported()) + if (google_chromeec_is_uhepi_supported()) { google_chromeec_set_lazy_wake_masks (info->s5_wake_events, info->s3_wake_events, info->s0ix_wake_events); + google_chromeec_set_lazy_sci_mask(info->sci_events); + } }
/* Clear wake event mask. */ @@ -819,6 +825,12 @@ return google_chromeec_set_mask(EC_HOST_EVENT_SCI_MASK, mask); }
+int google_chromeec_set_lazy_sci_mask(uint64_t mask) +{ + printk(BIOS_DEBUG, "Chrome EC: Set SCI mask to 0x%016llx\n", mask); + return google_chromeec_set_mask(EC_HOST_EVENT_LAZY_SCI_MASK, mask); +} + int google_chromeec_set_smi_mask(uint64_t mask) { printk(BIOS_DEBUG, "Chrome EC: Set SMI mask to 0x%016llx\n", mask); diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 70b2b52..ea8cec0 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -28,6 +28,7 @@ uint8_t *buffer, int len, int is_read); uint64_t google_chromeec_get_wake_mask(void); int google_chromeec_set_sci_mask(uint64_t mask); +int google_chromeec_set_lazy_sci_mask(uint64_t mask); int google_chromeec_set_smi_mask(uint64_t mask); int google_chromeec_set_wake_mask(uint64_t mask); u8 google_chromeec_get_event(void); diff --git a/src/ec/google/chromeec/ec_commands.h b/src/ec/google/chromeec/ec_commands.h index 140ba5a..daacb33 100644 --- a/src/ec/google/chromeec/ec_commands.h +++ b/src/ec/google/chromeec/ec_commands.h @@ -3465,6 +3465,9 @@ /* Active wake mask */ EC_HOST_EVENT_ACTIVE_WAKE_MASK,
+ /* Lazy SCI Mask */ + EC_HOST_EVENT_LAZY_SCI_MASK, + /* Lazy wake mask for S0ix */ EC_HOST_EVENT_LAZY_WAKE_MASK_S0IX,