1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <cpu/x86/smm.h>
6 #include <ec/google/chromeec/ec.h>
7 #include <ec/google/chromeec/smm.h>
8 #include <southbridge/intel/lynxpoint/lp_gpio.h>
11 #include <variant/onboard.h>
13 /* gpi_sts is GPIO 47:32 */
14 void mainboard_smi_gpi(u32 gpi_sts
)
16 if (gpi_sts
& (1 << (EC_SMI_GPI
- 32)))
17 chromeec_smi_process_events();
20 static void mainboard_disable_gpios(void)
22 #if CONFIG(BOARD_GOOGLE_SAMUS)
23 /* Put SSD in reset to prevent leak */
24 set_gpio(BOARD_SSD_RESET_GPIO
, 0);
26 set_gpio(BOARD_LTE_DISABLE_GPIO
, 0);
28 set_gpio(BOARD_PP3300_CODEC_GPIO
, 0);
30 /* Prevent leak from standby rail to WLAN rail */
31 set_gpio(BOARD_WLAN_DISABLE_GPIO
, 0);
34 void mainboard_smi_sleep(u8 slp_typ
)
36 /* Disable USB charging if required */
37 /* NOTE: Setting of usb0 _may_ also control usb1 here. */
38 chromeec_set_usb_charge_mode(slp_typ
);
43 mainboard_disable_gpios();
47 chromeec_smi_sleep(slp_typ
, MAINBOARD_EC_S3_WAKE_EVENTS
, MAINBOARD_EC_S5_WAKE_EVENTS
);
50 int mainboard_smi_apmc(u8 apmc
)
52 chromeec_smi_apmc(apmc
, MAINBOARD_EC_SCI_EVENTS
, MAINBOARD_EC_SMI_EVENTS
);