summaryrefslogtreecommitdiff
path: root/src/mainboard/google/poppy
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainboard/google/poppy')
-rw-r--r--src/mainboard/google/poppy/Makefile.inc1
-rw-r--r--src/mainboard/google/poppy/ec.c12
-rw-r--r--src/mainboard/google/poppy/smihandler.c22
-rw-r--r--src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h7
4 files changed, 33 insertions, 9 deletions
diff --git a/src/mainboard/google/poppy/Makefile.inc b/src/mainboard/google/poppy/Makefile.inc
index 133317c07e..86754e62eb 100644
--- a/src/mainboard/google/poppy/Makefile.inc
+++ b/src/mainboard/google/poppy/Makefile.inc
@@ -26,6 +26,7 @@ ramstage-y += mainboard.c
ramstage-y += ramstage.c
smm-$(CONFIG_HAVE_SMI_HANDLER) += smihandler.c
+smm-$(CONFIG_EC_GOOGLE_CHROMEEC) += ec.c
subdirs-y += variants/baseboard
CPPFLAGS_common += -I$(src)/mainboard/$(MAINBOARDDIR)/variants/baseboard/include
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());
}
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);
}
diff --git a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
index 3c589713f3..31370aed2b 100644
--- a/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
+++ b/src/mainboard/google/poppy/variants/baseboard/include/baseboard/variants.h
@@ -73,4 +73,11 @@ void variant_nhlt_init(struct nhlt *nhlt);
void variant_nhlt_oem_overrides(const char **oem_id, const char **oem_table_id,
uint32_t *oem_revision);
+struct google_chromeec_event_info;
+/*
+ * Read google_chromeec_event_info structure from variant to set different masks
+ * on the EC e.g. SCI, S3, S5, S0ix, SMI.
+ */
+const struct google_chromeec_event_info *variant_get_event_info(void);
+
#endif /* __BASEBOARD_VARIANTS_H__ */