summaryrefslogtreecommitdiff
path: root/src/mainboard/google/poppy/ec.c
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-10-06 12:03:23 -0700
committerFurquan Shaikh <furquan@google.com>2018-10-11 23:58:18 +0000
commit6985c90ff44edc07224bf1b71df7f7630f700e25 (patch)
tree48174bbb9142e880c2170f1346ac7f88c6854d67 /src/mainboard/google/poppy/ec.c
parent8dcfcb31069e0ea6b4a7d0155caef48316d608eb (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/ec.c')
-rw-r--r--src/mainboard/google/poppy/ec.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mainboard/google/poppy/ec.c b/src/mainboard/google/poppy/ec.c
index 7b9b9a7b33..71327be385 100644
--- a/src/mainboard/google/poppy/ec.c
+++ b/src/mainboard/google/poppy/ec.c
@@ -14,13 +14,14 @@
*/
#include <arch/acpi.h>
+#include <baseboard/variants.h>
#include <ec/google/chromeec/ec.h>
#include <variant/ec.h>
-void mainboard_ec_init(void)
+__weak const struct google_chromeec_event_info *variant_get_event_info(void)
{
- const struct google_chromeec_event_info info = {
+ static const struct google_chromeec_event_info info = {
.log_events = MAINBOARD_EC_LOG_EVENTS,
.sci_events = MAINBOARD_EC_SCI_EVENTS,
.s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS,
@@ -28,6 +29,11 @@ void mainboard_ec_init(void)
.s0ix_wake_events = MAINBOARD_EC_S0IX_WAKE_EVENTS,
};
- google_chromeec_events_init(&info, acpi_is_wakeup_s3());
+ return &info;
+}
+void mainboard_ec_init(void)
+{
+ google_chromeec_events_init(variant_get_event_info(),
+ acpi_is_wakeup_s3());
}