From 2088571f56bc36a6917193706e0f4d8ec1ba5b4b Mon Sep 17 00:00:00 2001 From: Aaron Durbin Date: Sun, 9 Feb 2014 16:04:06 -0600 Subject: baytrail: reinitialize spi controller in SMM finalization On the SMM APM_CNT_FINALIZE step reinitialize the SPI controller so that it can still log events after the SPI controller has been locked down. BUG=chrome-os-partner:24624 BRANCH=baytrail TEST=Built and booted. Events still logged after SPI controller has been locked down. Original-Change-Id: I41a3e12c0398303e74f95eb6df82d5bc4303898b Original-Signed-off-by: Aaron Durbin Original-Reviewed-on: https://chromium-review.googlesource.com/185630 Original-Reviewed-by: Duncan Laurie (cherry picked from commit 28ffb1a9e761cdfeb173bd533684db1011260e0a) Signed-off-by: Marc Jones Change-Id: Ia82753cba9ae4f049de2e81061739efc21d49a1e Reviewed-on: http://review.coreboot.org/9296 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/soc/intel/baytrail/smihandler.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/soc/intel/baytrail/smihandler.c b/src/soc/intel/baytrail/smihandler.c index a2718e2ddf..06419077f0 100644 --- a/src/soc/intel/baytrail/smihandler.c +++ b/src/soc/intel/baytrail/smihandler.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -232,6 +233,23 @@ static void southbridge_smi_gsmi(void) *ret = gsmi_exec(sub_command, param); } #endif + +static void finalize(void) +{ + static int finalize_done; + + if (finalize_done) { + printk(BIOS_DEBUG, "SMM already finalized.\n"); + return; + } + finalize_done = 1; + +#if CONFIG_SPI_FLASH_SMM + /* Re-init SPI driver to handle locked BAR */ + spi_init(); +#endif +} + static void southbridge_smi_apmc(void) { uint8_t reg8; @@ -282,6 +300,9 @@ static void southbridge_smi_apmc(void) southbridge_smi_gsmi(); break; #endif + case APM_CNT_FINALIZE: + finalize(); + break; } mainboard_smi_apmc(reg8); -- cgit v1.2.3