From f9eaede51848d28214b47ade110b20ceac8a53e2 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Mon, 19 Feb 2018 13:57:02 +0530 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/23810 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh Reviewed-by: Tung Lun Loo --- .../intel/common/block/include/intelblocks/smihandler.h | 3 +++ src/soc/intel/common/block/smm/smihandler.c | 9 +++++++++ 2 files changed, 12 insertions(+) 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(