1 /* SPDX-License-Identifier: GPL-2.0-only */
4 #include <cpu/x86/smm.h>
5 #include <southbridge/intel/bd82x6x/pch.h>
6 #include <southbridge/intel/bd82x6x/me.h>
7 #include <northbridge/intel/sandybridge/sandybridge.h>
9 /* Include EC functions */
10 #include <ec/google/chromeec/ec.h>
11 #include <ec/google/chromeec/smm.h>
14 void mainboard_smi_gpi(u32 gpi_sts
)
16 if (gpi_sts
& (1 << EC_SMI_GPI
))
17 chromeec_smi_process_events();
20 void mainboard_smi_sleep(u8 slp_typ
)
22 /* Disable USB charging if required */
23 chromeec_set_usb_charge_mode(slp_typ
);
25 /* Disable SCI and SMI events */
26 google_chromeec_set_smi_mask(0);
27 google_chromeec_set_sci_mask(0);
29 /* Clear pending events that may trigger immediate wake */
30 while (google_chromeec_get_event() != EC_HOST_EVENT_NONE
)
33 /* Enable wake events */
34 google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS
);
37 int mainboard_smi_apmc(u8 apmc
)
39 chromeec_smi_apmc(apmc
, MAINBOARD_EC_SCI_EVENTS
, MAINBOARD_EC_SMI_EVENTS
);