blob: f89bc9e3823d07c941b2f6f49639e0fbd4050d1c [file] [log] [blame]
Eric Lai87e27e12021-03-15 11:19:01 +08001/* SPDX-License-Identifier: GPL-2.0-or-later */
2
3#include <acpi/acpi.h>
4#include <amdblocks/gpio_banks.h>
5#include <amdblocks/smi.h>
6#include <ec/google/chromeec/ec.h>
Eric Laie93e6932021-03-18 16:35:56 +08007#include <soc/smi.h>
Eric Lai87e27e12021-03-15 11:19:01 +08008#include <variant/ec.h>
9
Eric Laie93e6932021-03-18 16:35:56 +080010static const struct sci_source espi_sci_sources[] = {
11 {
12 .scimap = SMITYPE_ESPI_SYS,
13 .gpe = GEVENT_24,
14 .direction = SMI_SCI_LVL,
15 .level = SMI_SCI_LVL_HIGH
16 }
17};
18
Eric Lai87e27e12021-03-15 11:19:01 +080019void mainboard_ec_init(void)
20{
21 const struct google_chromeec_event_info info = {
22 .log_events = MAINBOARD_EC_LOG_EVENTS,
23 .sci_events = MAINBOARD_EC_SCI_EVENTS,
24 .s3_wake_events = MAINBOARD_EC_S3_WAKE_EVENTS,
25 .s5_wake_events = MAINBOARD_EC_S5_WAKE_EVENTS,
26 .s0ix_wake_events = MAINBOARD_EC_S0IX_WAKE_EVENTS,
27 };
28
29 google_chromeec_events_init(&info, acpi_is_wakeup_s3());
Eric Laie93e6932021-03-18 16:35:56 +080030
31 /* Configure eSPI VW SCI events */
32 gpe_configure_sci(espi_sci_sources, ARRAY_SIZE(espi_sci_sources));
Eric Lai87e27e12021-03-15 11:19:01 +080033}