Eric Lai | 87e27e1 | 2021-03-15 11:19:01 +0800 | [diff] [blame] | 1 | /* 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 Lai | e93e693 | 2021-03-18 16:35:56 +0800 | [diff] [blame^] | 7 | #include <soc/smi.h> |
Eric Lai | 87e27e1 | 2021-03-15 11:19:01 +0800 | [diff] [blame] | 8 | #include <variant/ec.h> |
| 9 | |
Eric Lai | e93e693 | 2021-03-18 16:35:56 +0800 | [diff] [blame^] | 10 | static 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 Lai | 87e27e1 | 2021-03-15 11:19:01 +0800 | [diff] [blame] | 19 | void 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 Lai | e93e693 | 2021-03-18 16:35:56 +0800 | [diff] [blame^] | 30 | |
| 31 | /* Configure eSPI VW SCI events */ |
| 32 | gpe_configure_sci(espi_sci_sources, ARRAY_SIZE(espi_sci_sources)); |
Eric Lai | 87e27e1 | 2021-03-15 11:19:01 +0800 | [diff] [blame] | 33 | } |