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 5a76df3d37..4ff1e9ba70 100644 --- a/src/soc/intel/common/block/fast_spi/fast_spi.c +++ b/src/soc/intel/common/block/fast_spi/fast_spi.c @@ -428,3 +428,11 @@ void fast_spi_disable_wp(void) bios_cntl |= SPI_BIOS_CONTROL_WPD; pci_write_config8(dev, SPI_BIOS_CONTROL, bios_cntl); } + +void fast_spi_clear_outstanding_status(void) +{ + void *spibar = fast_spi_get_bar(); + + /* Make sure all W1C status bits get cleared. */ + write32(spibar + SPIBAR_HSFSTS_CTL, SPIBAR_HSFSTS_W1C_BITS); +} 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 eb3f2aabb6..1e96603438 100644 --- a/src/soc/intel/common/block/include/intelblocks/fast_spi.h +++ b/src/soc/intel/common/block/include/intelblocks/fast_spi.h @@ -5,6 +5,8 @@ #include +/* Clear any SPI outstanding status bits, i.e., FCERR, FDONE etc. */ +void fast_spi_clear_outstanding_status(void); /* Check if SPI transaction is pending */ int fast_spi_cycle_in_progress(void); /*