1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #ifndef SOC_INTEL_COMMON_BLOCK_SMI_HANDLER_H
4 #define SOC_INTEL_COMMON_BLOCK_SMI_HANDLER_H
6 #include <device/device.h>
13 * The register value is used with get_reg and set_reg
22 struct smm_save_state_ops
{
23 /* return io_misc_info from SMM Save State Area */
24 uint32_t (*get_io_misc_info
)(void *state
);
26 /* return value of the requested register from
29 uint64_t (*get_reg
)(void *state
, enum smm_reg reg
);
31 void (*set_reg
)(void *state
, enum smm_reg reg
, uint64_t val
);
34 typedef void (*smi_handler_t
)(const struct smm_save_state_ops
*save_state_ops
);
37 * SOC SMI Handler has to provide this structure which has methods to access
38 * the SOC specific SMM Save State Area
40 const struct smm_save_state_ops
*get_smm_save_state_ops(void);
43 * southbridge_smi should be defined inside SOC specific code and should have
44 * handlers for any SMI events that need to be handled. Default handlers
45 * for some SMI events are provided in soc/intel/common/block/smm/smihandler.c
47 extern const smi_handler_t southbridge_smi
[32];
50 * This function should be implemented in SOC specific code to handle
51 * the SMI event on SLP_EN. The default functionality is provided in
52 * soc/intel/common/block/smm/smihandler.c
54 void smihandler_southbridge_sleep(
55 const struct smm_save_state_ops
*save_state_ops
);
58 * This function should be implemented in SOC specific code to handle
59 * SMI_APM event. The default functionality is provided in
60 * soc/intel/common/block/smm/smihandler.c
62 void smihandler_southbridge_apmc(
63 const struct smm_save_state_ops
*save_state_ops
);
66 * This function should be implemented in SOC specific code to handle
67 * SMI_PM1 event. The default functionality is provided in
68 * soc/intel/common/block/smm/smihandler.c
70 void smihandler_southbridge_pm1(
71 const struct smm_save_state_ops
*save_state_ops
);
74 * This function should be implemented in SOC specific code to handle
75 * SMI_GPE0 event. The default functionality is provided in
76 * soc/intel/common/block/smm/smihandler.c
78 void smihandler_southbridge_gpe0(
79 const struct smm_save_state_ops
*save_state_ops
);
82 * This function should be implemented in SOC specific code to handle
83 * MC event. The default functionality is provided in
84 * soc/intel/common/block/smm/smihandler.c
86 void smihandler_southbridge_mc(
87 const struct smm_save_state_ops
*save_state_ops
);
90 * This function should be implemented in SOC specific code to handle
91 * minitor event. The default functionality is provided in
92 * soc/intel/common/block/smm/smihandler.c
94 void smihandler_southbridge_monitor(
95 const struct smm_save_state_ops
*save_state_ops
);
97 * This function should be implemented in SOC specific code to handle
98 * SMI_TCO event. The default functionality is provided in
99 * soc/intel/common/block/smm/smihandler.c
101 void smihandler_southbridge_tco(
102 const struct smm_save_state_ops
*save_state_ops
);
105 * This function should be implemented in SOC specific code to handle
106 * SMI PERIODIC_STS event. The default functionality is provided in
107 * soc/intel/common/block/smm/smihandler.c
109 void smihandler_southbridge_periodic(
110 const struct smm_save_state_ops
*save_state_ops
);
113 * This function should be implemented in SOC specific code to handle
114 * SMI GPIO_STS event. The default functionality is provided in
115 * soc/intel/common/block/smm/smihandler.c
117 void smihandler_southbridge_gpi(
118 const struct smm_save_state_ops
*save_state_ops
);
121 * This function should be implemented in SOC specific code to handle
122 * SMI ESPI_STS event. The default functionality is provided in
123 * soc/intel/common/block/smm/smihandler.c
125 void smihandler_southbridge_espi(
126 const struct smm_save_state_ops
*save_state_ops
);
130 /* Specific SOC SMI handler during ramstage finalize phase */
131 void smihandler_soc_at_finalize(void);
134 * This function returns a 1 or 0 depending on whether disable_busmaster
135 * needs to be done for the specified device on S5 entry
137 int smihandler_soc_disable_busmaster(pci_devfn_t dev
);
139 /* Mainboard overrides. */
141 /* Mainboard handler for GPI SMIs */
142 void mainboard_smi_gpi_handler(const struct gpi_status
*sts
);
144 /* Mainboard handler for ESPI EMIs */
145 void mainboard_smi_espi_handler(void);
147 extern const struct smm_save_state_ops em64t100_smm_ops
;
149 extern const struct smm_save_state_ops em64t101_smm_ops
;