• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <acpi/acpi.h>
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>
8 
9 /* Include EC functions */
10 #include <ec/google/chromeec/ec.h>
11 #include <ec/google/chromeec/smm.h>
12 #include "ec.h"
13 
mainboard_smi_gpi(u32 gpi_sts)14 void mainboard_smi_gpi(u32 gpi_sts)
15 {
16 	if (gpi_sts & (1 << EC_SMI_GPI))
17 		chromeec_smi_process_events();
18 }
19 
mainboard_smi_sleep(u8 slp_typ)20 void mainboard_smi_sleep(u8 slp_typ)
21 {
22 	/* Disable USB charging if required */
23 	chromeec_set_usb_charge_mode(slp_typ);
24 
25 	/* Disable SCI and SMI events */
26 	google_chromeec_set_smi_mask(0);
27 	google_chromeec_set_sci_mask(0);
28 
29 	/* Clear pending events that may trigger immediate wake */
30 	while (google_chromeec_get_event() != EC_HOST_EVENT_NONE)
31 		;
32 
33 	/* Enable wake events */
34 	google_chromeec_set_wake_mask(MAINBOARD_EC_S3_WAKE_EVENTS);
35 }
36 
mainboard_smi_apmc(u8 apmc)37 int mainboard_smi_apmc(u8 apmc)
38 {
39 	chromeec_smi_apmc(apmc, MAINBOARD_EC_SCI_EVENTS, MAINBOARD_EC_SMI_EVENTS);
40 	return 0;
41 }
42