| 1 |
|
| 2 |
|
| 3 |
#include <acpi/acpi.h> |
| 4 |
#include <amdblocks/smi.h> |
| 5 |
#include <ec/google/chromeec/ec.h> |
| 6 |
#include <gpio.h> |
| 7 |
#include <soc/smi.h> |
| 8 |
#include <variant/ec.h> |
| 9 |
|
| 10 |
static const struct sci_source espi_sci_sources[] = { |
| 11 |
{ |
| 12 |
.scimap = SMITYPE_ESPI_SCI_B, |
| 13 |
.gpe = EC_SCI_GPI, |
| 14 |
.direction = SMI_SCI_LVL_HIGH, |
| 15 |
.level = SMI_SCI_EDG, |
| 16 |
} |
| 17 |
}; |
| 18 |
|
| 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()); |
| 30 |
|
| 31 |
|
| 32 |
gpe_configure_sci(espi_sci_sources, ARRAY_SIZE(espi_sci_sources)); |
| 33 |
} |