diff options
author | Furquan Shaikh <furquan@google.com> | 2018-10-06 12:03:23 -0700 |
---|---|---|
committer | Furquan Shaikh <furquan@google.com> | 2018-10-11 23:58:18 +0000 |
commit | 6985c90ff44edc07224bf1b71df7f7630f700e25 (patch) | |
tree | 48174bbb9142e880c2170f1346ac7f88c6854d67 /src/mainboard/google/poppy/smihandler.c | |
parent | 8dcfcb31069e0ea6b4a7d0155caef48316d608eb (diff) |
mb/google/poppy: Allow variants to provide event info at runtime
This change adds a variant callback to read google_chromeec_event_info
from variant at runtime to allow override of any events based on
factors like board id.
This callback is used in ramstage and smm to get
google_chromeec_event_info structure for performing various actions
like setting masks and logging wake events from EC.
BUG=b:112366846,b:112112483,b:112111610
Change-Id: If89e904c92372530a0f555952f87702f068e0b03
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://review.coreboot.org/28983
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Enrico Granata <egranata@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/mainboard/google/poppy/smihandler.c')
-rw-r--r-- | src/mainboard/google/poppy/smihandler.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mainboard/google/poppy/smihandler.c b/src/mainboard/google/poppy/smihandler.c index c8ff7499ba..4f45687700 100644 --- a/src/mainboard/google/poppy/smihandler.c +++ b/src/mainboard/google/poppy/smihandler.c @@ -34,20 +34,30 @@ void __weak variant_smi_sleep(u8 slp_typ) {} void mainboard_smi_sleep(u8 slp_typ) { + const struct google_chromeec_event_info *info; + + info = variant_get_event_info(); + variant_smi_sleep(slp_typ); - chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, - MAINBOARD_EC_S5_WAKE_EVENTS); + chromeec_smi_sleep(slp_typ, info->s3_wake_events, info->s5_wake_events); } int mainboard_smi_apmc(u8 apmc) { - chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, - MAINBOARD_EC_SMI_EVENTS); + const struct google_chromeec_event_info *info; + + info = variant_get_event_info(); + + chromeec_smi_apmc(apmc, info->sci_events, info->smi_events); + return 0; } void elog_gsmi_cb_mainboard_log_wake_source(void) { - google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS | - MAINBOARD_EC_S0IX_WAKE_EVENTS); + const struct google_chromeec_event_info *info; + + info = variant_get_event_info(); + + google_chromeec_log_events(info->log_events | info->s0ix_wake_events); } |