Attention is currently required from: Marc Jones.
Hello Marc Jones,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/70348
to review the following change.
Change subject: soc/intel/common/block/fast_spi: Add SPI BIOS decode lock ......................................................................
soc/intel/common/block/fast_spi: Add SPI BIOS decode lock
Add fast_spi_set_bde() to be called by the SOC lockdown function. The lock is SOC specific, so it can't be called in common PCH lockdown function.
Change-Id: I3f7cca671250996a6be7b5b28437c3e1bf777678 Signed-off-by: Marc Jones marcjones@sysproconsulting.com --- M src/soc/intel/common/block/fast_spi/fast_spi.c M src/soc/intel/common/block/fast_spi/fast_spi_def.h M src/soc/intel/common/block/include/intelblocks/fast_spi.h 3 files changed, 29 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/48/70348/1
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi.c b/src/soc/intel/common/block/fast_spi/fast_spi.c index 471c85d..9735a84 100644 --- a/src/soc/intel/common/block/fast_spi/fast_spi.c +++ b/src/soc/intel/common/block/fast_spi/fast_spi.c @@ -458,6 +458,16 @@ pci_write_config8(dev, SPI_BIOS_CONTROL, bios_cntl); }
+void fast_spi_set_bde(void) +{ + const pci_devfn_t dev = PCH_DEV_SPI; + uint32_t bde; + + bde = pci_read_config32(dev, SPI_BIOS_DECODE_EN); + bde |= SPI_BIOS_DECODE_LOCK; + pci_write_config32(dev, SPI_BIOS_DECODE_EN, bde); +} + void fast_spi_clear_outstanding_status(void) { void *spibar = fast_spi_get_bar(); diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_def.h b/src/soc/intel/common/block/fast_spi/fast_spi_def.h index 4012c29..af46ccb 100644 --- a/src/soc/intel/common/block/fast_spi/fast_spi_def.h +++ b/src/soc/intel/common/block/fast_spi/fast_spi_def.h @@ -4,6 +4,8 @@ #define SOC_INTEL_COMMON_BLOCK_FAST_SPI_DEF_H
/* PCI configuration registers */ +#define SPI_BIOS_DECODE_EN 0xd8 +#define SPI_BIOS_DECODE_LOCK BIT(31)
#define SPI_BIOS_CONTROL 0xdc
diff --git a/src/soc/intel/common/block/include/intelblocks/fast_spi.h b/src/soc/intel/common/block/include/intelblocks/fast_spi.h index 90f1cb2..681e66c 100644 --- a/src/soc/intel/common/block/include/intelblocks/fast_spi.h +++ b/src/soc/intel/common/block/include/intelblocks/fast_spi.h @@ -103,5 +103,9 @@ */ struct postcar_frame; void fast_spi_cache_ext_bios_postcar(struct postcar_frame *pcf); +/* + * Set FAST_SPIBAR BIOS Decode Lock bit. + */ +void fast_spi_set_bde(void);
#endif /* SOC_INTEL_COMMON_BLOCK_FAST_SPI_H */