diff --git a/src/soc/intel/baytrail/spi.c b/src/soc/intel/baytrail/spi.c index 64aeb9bcc9..8605dfc197 100644 --- a/src/soc/intel/baytrail/spi.c +++ b/src/soc/intel/baytrail/spi.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -316,6 +317,17 @@ void spi_init(void) ich_set_bbar(0); } +#ifndef __SMM__ +static void spi_init_cb(void *unused) +{ + spi_init(); +} + +BOOT_STATE_INIT_ENTRIES(spi_init_bscb) = { + BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_ENTRY, spi_init_cb, NULL), +}; +#endif + int spi_claim_bus(struct spi_slave *slave) { /* Handled by ICH automatically. */ diff --git a/src/southbridge/intel/common/spi.c b/src/southbridge/intel/common/spi.c index 48c72b7737..3f22bc736f 100644 --- a/src/southbridge/intel/common/spi.c +++ b/src/southbridge/intel/common/spi.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -359,6 +360,14 @@ void spi_init(void) bios_cntl &= ~(1 << 5); pci_write_config_byte(dev, 0xdc, bios_cntl | 0x1); } +static void spi_init_cb(void *unused) +{ + spi_init(); +} + +BOOT_STATE_INIT_ENTRIES(spi_init_bscb) = { + BOOT_STATE_INIT_ENTRY(BS_DEV_INIT, BS_ON_ENTRY, spi_init_cb, NULL), +}; int spi_claim_bus(struct spi_slave *slave) {