summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSubrata Banik <subrata.banik@intel.com>2018-02-19 13:57:02 +0530
committerPatrick Georgi <pgeorgi@google.com>2018-02-22 09:56:12 +0000
commitf9eaede51848d28214b47ade110b20ceac8a53e2 (patch)
tree4c0b2e0d7c2b6af65744f86cbbc20e7b5021e0cb
parent736a03fd248174ef27d0b5b9adffc8970cee4c14 (diff)
downloadcoreboot-f9eaede51848d28214b47ade110b20ceac8a53e2.tar.xz
soc/intel/common/block/smm: Add option to have SOC specific SMI Handler at finalize()
This patch ensures common code provides an option to register a SOC specific SMI handler before booting to OS (specifically during ramstage). Change-Id: I50fb154cc1ad4b3459bc352d2065f2c582711c20 Signed-off-by: Subrata Banik <subrata.banik@intel.com> Reviewed-on: https://review.coreboot.org/23810 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Furquan Shaikh <furquan@google.com> Reviewed-by: Tung Lun Loo <tung.lun.loo@intel.com>
-rw-r--r--src/soc/intel/common/block/include/intelblocks/smihandler.h3
-rw-r--r--src/soc/intel/common/block/smm/smihandler.c9
2 files changed, 12 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 df2d17c9e2..197268b29e 100644
--- a/src/soc/intel/common/block/include/intelblocks/smihandler.h
+++ b/src/soc/intel/common/block/include/intelblocks/smihandler.h
@@ -148,6 +148,9 @@ struct global_nvs_t *smm_get_gnvs(void);
/* SoC overrides. */
+/* Specific SOC SMI handler during ramstage finalize phase */
+void smihandler_soc_at_finalize(void);
+
/*
* This function returns a 1 or 0 depending on whether disable_busmaster
* needs to be done for the specified device on S5 entry
diff --git a/src/soc/intel/common/block/smm/smihandler.c b/src/soc/intel/common/block/smm/smihandler.c
index 8a877c3570..81ff3ebec8 100644
--- a/src/soc/intel/common/block/smm/smihandler.c
+++ b/src/soc/intel/common/block/smm/smihandler.c
@@ -38,6 +38,12 @@ static struct global_nvs_t *gnvs;
/* SoC overrides. */
+/* Specific SOC SMI handler during ramstage finalize phase */
+__attribute__((weak)) void smihandler_soc_at_finalize(void)
+{
+ return;
+}
+
__attribute__((weak)) int smihandler_soc_disable_busmaster(device_t dev)
{
return 1;
@@ -278,6 +284,9 @@ static void finalize(void)
if (IS_ENABLED(CONFIG_SPI_FLASH_SMM))
/* Re-init SPI driver to handle locked BAR */
fast_spi_init();
+
+ /* Specific SOC SMI handler during ramstage finalize phase */
+ smihandler_soc_at_finalize();
}
void smihandler_southbridge_apmc(