| 1 |
|
| 2 |
|
| 3 |
#include <baseboard/variants.h> |
| 4 |
#include <cpu/x86/smm.h> |
| 5 |
#include <ec/google/chromeec/smm.h> |
| 6 |
#include <intelblocks/smihandler.h> |
| 7 |
#include <soc/pm.h> |
| 8 |
#include <soc/gpio.h> |
| 9 |
#include <variant/ec.h> |
| 10 |
#include <variant/gpio.h> |
| 11 |
|
| 12 |
void mainboard_smi_gpi_handler(const struct gpi_status *sts) |
| 13 |
{ |
| 14 |
if (gpi_status_get(sts, EC_SMI_GPI)) |
| 15 |
chromeec_smi_process_events(); |
| 16 |
} |
| 17 |
|
| 18 |
void mainboard_smi_sleep(u8 slp_typ) |
| 19 |
{ |
| 20 |
const struct pad_config *pads; |
| 21 |
size_t num; |
| 22 |
|
| 23 |
pads = variant_sleep_gpio_table(slp_typ, &num); |
| 24 |
gpio_configure_pads(pads, num); |
| 25 |
|
| 26 |
if (CONFIG(EC_GOOGLE_CHROMEEC)) |
| 27 |
chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, |
| 28 |
MAINBOARD_EC_S5_WAKE_EVENTS); |
| 29 |
} |
| 30 |
|
| 31 |
int mainboard_smi_apmc(u8 apmc) |
| 32 |
{ |
| 33 |
if (CONFIG(EC_GOOGLE_CHROMEEC)) |
| 34 |
chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, |
| 35 |
MAINBOARD_EC_SMI_EVENTS); |
| 36 |
return 0; |
| 37 |
} |