summaryrefslogtreecommitdiff
path: root/src/soc/intel/common/block
diff options
context:
space:
mode:
authorBrandon Breitenstein <brandon.breitenstein@intel.com>2017-08-08 15:30:41 -0700
committerAaron Durbin <adurbin@chromium.org>2017-08-09 22:45:54 +0000
commit60ce6152fd3ab299920cfe984698f85279360a51 (patch)
tree85a8e243ce973b894b26a28551fe67124df4029b /src/soc/intel/common/block
parent6d5873d7f280b3eb96664e41f2c204fc39ab506a (diff)
intel/common/block/smm: Update smihandler to handle gpi
Updating the common smihandler to handler gpi events which originally were going to be left to each soc to handle. After some more analysis the gpi handler can also be commonized. Change-Id: I6273fe846587137938bbcffa3a92736b91982574 Signed-off-by: Brandon Breitenstein <brandon.breitenstein@intel.com> Reviewed-on: https://review.coreboot.org/20917 Reviewed-by: Aaron Durbin <adurbin@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/soc/intel/common/block')
-rw-r--r--src/soc/intel/common/block/include/intelblocks/smihandler.h18
-rw-r--r--src/soc/intel/common/block/smm/smihandler.c23
2 files changed, 41 insertions, 0 deletions
diff --git a/src/soc/intel/common/block/include/intelblocks/smihandler.h b/src/soc/intel/common/block/include/intelblocks/smihandler.h
index 4423904371..389d2415b8 100644
--- a/src/soc/intel/common/block/include/intelblocks/smihandler.h
+++ b/src/soc/intel/common/block/include/intelblocks/smihandler.h
@@ -109,6 +109,21 @@ void smihandler_southbridge_periodic(
const struct smm_save_state_ops *save_state_ops);
/*
+ * This function should be implemented in SOC specific code to handle
+ * SMI GPIO_STS event. The default functionality is provided in
+ * soc/intel/common/block/smm/smihandler.c
+ */
+void smihandler_southbridge_gpi(
+ const struct smm_save_state_ops *save_state_ops);
+
+/*
+ * This function should be implemented in SOC specific code to handle
+ * SMI ESPI_STS event. The default functionality is provided in
+ * soc/intel/common/block/smm/smihandler.c
+ */
+void smihandler_southbridge_espi(
+ const struct smm_save_state_ops *save_state_ops);
+/*
* This function returns a 1 or 0 depending on whether disable_busmaster
* needs to be done for the specified device on S5 entry
*/
@@ -122,6 +137,9 @@ struct global_nvs_t *smm_get_gnvs(void);
/* Mainboard handler for GPI SMIs */
void mainboard_smi_gpi_handler(const struct gpi_status *sts);
+/* Mainboard handler for ESPI EMIs */
+void mainboard_smi_espi_handler(void);
+
extern const struct smm_save_state_ops em64t100_smm_ops;
extern const struct smm_save_state_ops em64t101_smm_ops;
diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c
index 7a4be47844..24327f2aa8 100644
--- a/src/soc/intel/common/block/smm/smihandler.c
+++ b/src/soc/intel/common/block/smm/smihandler.c
@@ -356,6 +356,29 @@ void smihandler_southbridge_periodic(
printk(BIOS_DEBUG, "Periodic SMI.\n");
}
+void __attribute__((weak))
+mainboard_smi_gpi_handler(const struct gpi_status *sts) { }
+
+void smihandler_southbridge_gpi(
+ const struct smm_save_state_ops *save_state_ops)
+{
+ struct gpi_status smi_sts;
+
+ gpi_clear_get_smi_status(&smi_sts);
+ mainboard_smi_gpi_handler(&smi_sts);
+
+ /* Clear again after mainboard handler */
+ gpi_clear_get_smi_status(&smi_sts);
+}
+
+void __attribute__((weak)) mainboard_smi_espi_handler(void) { }
+
+void smihandler_southbridge_espi(
+ const struct smm_save_state_ops *save_state_ops)
+{
+ mainboard_smi_espi_handler();
+}
+
void southbridge_smi_handler(void)
{
int i;