Arthur Heymans has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/33044
Change subject: sb/intel/{bd82x6x,lynxpoint,ibexpeak}: Use SPIBAR lockdown ......................................................................
sb/intel/{bd82x6x,lynxpoint,ibexpeak}: Use SPIBAR lockdown
The common code makes the driver aware that SPIBAR is locked down, removing the need for calling spi_init() again.
Change-Id: Ib5dbbb3e01015ca80e1b1011048acc87235c90c8 Signed-off-by: Arthur Heymans arthur@aheymans.xyz --- M src/southbridge/intel/bd82x6x/lpc.c M src/southbridge/intel/common/finalize.c M src/southbridge/intel/ibexpeak/lpc.c M src/southbridge/intel/lynxpoint/lpc.c 4 files changed, 12 insertions(+), 11 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/44/33044/1
diff --git a/src/southbridge/intel/bd82x6x/lpc.c b/src/southbridge/intel/bd82x6x/lpc.c index 9615698..a1ffa65 100644 --- a/src/southbridge/intel/bd82x6x/lpc.c +++ b/src/southbridge/intel/bd82x6x/lpc.c @@ -882,11 +882,9 @@ acpi_is_wakeup_s3()) { outb(APM_CNT_FINALIZE, APM_CNT); if (CONFIG(CONSOLE_SPI_FLASH)) - /* Re-init SPI driver to handle locked BAR. - This prevents flashconsole from hanging. - If other code needs to use SPI during - ramstage, whitelist it here. */ - spi_init(); + /* Make the SPI driver aware that SPIBAR is + locked down, which happens in SMM*/ + spi_lock_down(); } } } diff --git a/src/southbridge/intel/common/finalize.c b/src/southbridge/intel/common/finalize.c index 80c65bb..4c97c00 100644 --- a/src/southbridge/intel/common/finalize.c +++ b/src/southbridge/intel/common/finalize.c @@ -20,6 +20,7 @@ #include <southbridge/intel/common/pmbase.h> #include <southbridge/intel/common/pmutil.h> #include <southbridge/intel/common/rcba.h> +#include <southbridge/intel/common/spi.h> #include <spi-generic.h>
#include "finalize.h" @@ -39,11 +40,7 @@ }
/* Lock SPIBAR */ - RCBA32_OR(0x3804, (1 << 15)); - - if (CONFIG(SPI_FLASH_SMM)) - /* Re-init SPI driver to handle locked BAR */ - spi_init(); + spi_lock_down();
/* TCLOCKDN: TC Lockdown */ RCBA32_OR(0x0050, (1UL << 31)); diff --git a/src/southbridge/intel/ibexpeak/lpc.c b/src/southbridge/intel/ibexpeak/lpc.c index fa1ca92..b32ec0d 100644 --- a/src/southbridge/intel/ibexpeak/lpc.c +++ b/src/southbridge/intel/ibexpeak/lpc.c @@ -793,6 +793,9 @@ if (CONFIG(INTEL_CHIPSET_LOCKDOWN) || acpi_is_wakeup_s3()) { outb(APM_CNT_FINALIZE, APM_CNT); + /* Make the SPI driver aware that SPIBAR is locked down, + which happens in SMM*/ + spi_lock_down(); } } } diff --git a/src/southbridge/intel/lynxpoint/lpc.c b/src/southbridge/intel/lynxpoint/lpc.c index 4efb83e..3e086e5 100644 --- a/src/southbridge/intel/lynxpoint/lpc.c +++ b/src/southbridge/intel/lynxpoint/lpc.c @@ -963,8 +963,11 @@ { spi_finalize_ops();
- if (acpi_is_wakeup_s3() || CONFIG(INTEL_CHIPSET_LOCKDOWN)) + if (acpi_is_wakeup_s3() || CONFIG(INTEL_CHIPSET_LOCKDOWN)) { outb(APM_CNT_FINALIZE, APM_CNT); + /* Make the SPI driver aware that SPIBAR is locked down, + which happens in SMM*/ + spi_lock_down(); }
static struct pci_operations pci_ops = {