Jon Murphy | 2a7445a | 2022-02-16 06:46:47 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
| 2 | |
Raul E Rangel | e6c677c | 2022-04-25 13:45:26 -0600 | [diff] [blame^] | 3 | #include <amdblocks/gpio.h> |
Jon Murphy | 2a7445a | 2022-02-16 06:46:47 -0700 | [diff] [blame] | 4 | #include <baseboard/variants.h> |
| 5 | #include <console/console.h> |
| 6 | #include <cpu/x86/smm.h> |
| 7 | #include <ec/google/chromeec/ec.h> |
| 8 | #include <ec/google/chromeec/smm.h> |
Jon Murphy | f79cc51 | 2022-02-17 16:15:45 -0700 | [diff] [blame] | 9 | #include <elog.h> |
Jon Murphy | 2a7445a | 2022-02-16 06:46:47 -0700 | [diff] [blame] | 10 | #include <variant/ec.h> |
| 11 | |
| 12 | void mainboard_smi_sleep(u8 slp_typ) |
| 13 | { |
| 14 | size_t num_gpios; |
| 15 | const struct soc_amd_gpio *gpios; |
| 16 | |
| 17 | chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); |
| 18 | |
| 19 | variant_sleep_gpio_table(&gpios, &num_gpios); |
Raul E Rangel | e6c677c | 2022-04-25 13:45:26 -0600 | [diff] [blame^] | 20 | gpio_configure_pads(gpios, num_gpios); |
Jon Murphy | 2a7445a | 2022-02-16 06:46:47 -0700 | [diff] [blame] | 21 | } |
| 22 | |
| 23 | int mainboard_smi_apmc(u8 apmc) |
| 24 | { |
| 25 | chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, MAINBOARD_EC_SMI_EVENTS); |
| 26 | |
| 27 | return 0; |
| 28 | } |
Jon Murphy | f79cc51 | 2022-02-17 16:15:45 -0700 | [diff] [blame] | 29 | |
| 30 | void elog_gsmi_cb_mainboard_log_wake_source(void) |
| 31 | { |
| 32 | google_chromeec_log_events(MAINBOARD_EC_LOG_EVENTS | MAINBOARD_EC_S0IX_WAKE_EVENTS); |
| 33 | } |