From 446082946a796436f738af8c2863c1c28a0ccb01 Mon Sep 17 00:00:00 2001 From: Duncan Laurie Date: Wed, 7 Nov 2018 11:36:35 -0700 Subject: soc/intel/common: Add option to disable eSPI SMI at runtime Add an option that will disable eSPI SMI when ACPI mode is enabled, and re-enable eSPI SMI when ACPI mode is disabled. Additionally it ensures eSPI SMI is disabled on the ACPI OS resume path. This allows a mainboard to ensure that the Embedded Controller will not be able to assert SMI at runtime when booted into an ACPI aware operating system. This was tested on a Sarien board with the Wilco EC to ensure that the eSPI SMI enable bit is clear when booted into the OS, and remains clear after resume. Change-Id: Ic305c3498dfa4b8166cfdb070fc404dd4618ba3c Signed-off-by: Duncan Laurie Reviewed-on: https://review.coreboot.org/29535 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin Reviewed-by: Furquan Shaikh --- src/soc/intel/common/block/smm/smm.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/soc/intel/common/block/smm/smm.c') diff --git a/src/soc/intel/common/block/smm/smm.c b/src/soc/intel/common/block/smm/smm.c index 6059995493..d929975186 100644 --- a/src/soc/intel/common/block/smm/smm.c +++ b/src/soc/intel/common/block/smm/smm.c @@ -15,6 +15,7 @@ * GNU General Public License for more details. */ +#include #include #include #include @@ -93,3 +94,11 @@ void smm_region_info(void **start, size_t *size) *start = (void *)sa_get_tseg_base(); *size = sa_get_tseg_size(); } + +#if IS_ENABLED(CONFIG_SOC_INTEL_COMMON_BLOCK_SMM_ESPI_ACPI_DIS) +static void smm_disable_espi(void *dest) +{ + pmc_disable_smi(ESPI_SMI_EN); +} +BOOT_STATE_INIT_ENTRY(BS_OS_RESUME, BS_ON_ENTRY, smm_disable_espi, NULL); +#endif -- cgit v1.2.3