Angel Pons | b6636b0 | 2020-04-05 13:21:41 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Maulik V Vaghela | 9f11629 | 2019-02-27 11:20:24 +0530 | [diff] [blame] | 2 | #include <baseboard/variants.h> |
Aamir Bohra | 049ad67 | 2018-12-26 18:50:17 +0530 | [diff] [blame] | 3 | #include <cpu/x86/smm.h> |
V Sowmya | 52d79fb | 2019-03-06 17:50:02 +0530 | [diff] [blame] | 4 | #include <ec/google/chromeec/ec.h> |
Aamir Bohra | 049ad67 | 2018-12-26 18:50:17 +0530 | [diff] [blame] | 5 | #include <ec/google/chromeec/smm.h> |
V Sowmya | 52d79fb | 2019-03-06 17:50:02 +0530 | [diff] [blame] | 6 | #include <elog.h> |
Kyösti Mälkki | 89d7fd8 | 2019-08-13 07:57:34 +0300 | [diff] [blame] | 7 | #include <intelblocks/smihandler.h> |
Aamir Bohra | 049ad67 | 2018-12-26 18:50:17 +0530 | [diff] [blame] | 8 | #include <variant/ec.h> |
| 9 | |
| 10 | void mainboard_smi_espi_handler(void) |
| 11 | { |
| 12 | chromeec_smi_process_events(); |
| 13 | } |
| 14 | |
| 15 | void mainboard_smi_sleep(u8 slp_typ) |
| 16 | { |
Maulik V Vaghela | 9f11629 | 2019-02-27 11:20:24 +0530 | [diff] [blame] | 17 | const struct pad_config *pads; |
| 18 | size_t num; |
| 19 | |
| 20 | pads = variant_sleep_gpio_table(slp_typ, &num); |
| 21 | gpio_configure_pads(pads, num); |
| 22 | |
Aamir Bohra | 049ad67 | 2018-12-26 18:50:17 +0530 | [diff] [blame] | 23 | chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, |
| 24 | MAINBOARD_EC_S5_WAKE_EVENTS); |
| 25 | } |
| 26 | |
| 27 | int mainboard_smi_apmc(u8 apmc) |
| 28 | { |
| 29 | chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, |
| 30 | MAINBOARD_EC_SMI_EVENTS); |
| 31 | return 0; |
| 32 | } |
V Sowmya | 52d79fb | 2019-03-06 17:50:02 +0530 | [diff] [blame] | 33 | |
| 34 | void elog_gsmi_cb_mainboard_log_wake_source(void) |
| 35 | { |
| 36 | google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS | |
| 37 | MAINBOARD_EC_S0IX_WAKE_EVENTS); |
| 38 | } |