1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <cpu/x86/smm.h>
5 #include <southbridge/intel/lynxpoint/pch.h>
6 #include <southbridge/intel/common/gpio.h>
7 #include <southbridge/intel/lynxpoint/me.h>
8 #include <northbridge/intel/haswell/haswell.h>
9 #include <cpu/intel/haswell/haswell.h>
11 /* Include EC functions */
12 #include <ec/google/chromeec/smm.h>
15 /* Codec enable: GPIO45 */
16 #define GPIO_PP3300_CODEC_EN 45
17 /* GPIO46 controls the WLAN_DISABLE_L signal. */
18 #define GPIO_WLAN_DISABLE_L 46
19 #define GPIO_LTE_DISABLE_L 59
21 /* gpi_sts is GPIO 47:32 */
22 void mainboard_smi_gpi(u32 gpi_sts
)
24 if (gpi_sts
& (1 << (EC_SMI_GPI
- 32)))
25 chromeec_smi_process_events();
28 void mainboard_smi_sleep(u8 slp_typ
)
30 /* Disable USB charging if required */
31 chromeec_set_usb_charge_mode(slp_typ
);
37 /* Prevent leak from standby rail to WLAN rail in S3/S4/S5. */
38 set_gpio(GPIO_WLAN_DISABLE_L
, 0);
39 set_gpio(GPIO_PP3300_CODEC_EN
, 0);
41 set_gpio(GPIO_LTE_DISABLE_L
, 0);
45 chromeec_smi_sleep(slp_typ
, MAINBOARD_EC_S3_WAKE_EVENTS
, MAINBOARD_EC_S5_WAKE_EVENTS
);
48 int mainboard_smi_apmc(u8 apmc
)
50 chromeec_smi_apmc(apmc
, MAINBOARD_EC_SCI_EVENTS
, MAINBOARD_EC_SMI_EVENTS
);