1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/console.h>
4 #include <cpu/x86/smm.h>
5 #include <ec/google/chromeec/smm.h>
9 #include <intelblocks/smihandler.h>
13 int mainboard_io_trap_handler(int smif
)
17 printk(BIOS_DEBUG
, "Sample\n");
24 /* On success, the IO Trap Handler returns 0
25 * On failure, the IO Trap Handler returns a value != 0
27 * For now, we force the return value to 0 and log all traps to
28 * see what's going on.
33 void mainboard_smi_gpi_handler(const struct gpi_status
*sts
)
35 if (gpi_status_get(sts
, EC_SMI_GPI
))
36 chromeec_smi_process_events();
39 void mainboard_smi_sleep(u8 slp_typ
)
41 if (CONFIG(EC_GOOGLE_CHROMEEC
))
42 chromeec_smi_sleep(slp_typ
, MAINBOARD_EC_S3_WAKE_EVENTS
,
43 MAINBOARD_EC_S5_WAKE_EVENTS
);
46 int mainboard_smi_apmc(u8 apmc
)
48 if (CONFIG(EC_GOOGLE_CHROMEEC
))
49 chromeec_smi_apmc(apmc
, MAINBOARD_EC_SCI_EVENTS
,
50 MAINBOARD_EC_SMI_EVENTS
);