summaryrefslogtreecommitdiff
path: root/src/soc
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc')
-rw-r--r--src/soc/intel/common/block/fast_spi/fast_spi_flash.c5
-rw-r--r--src/soc/mediatek/mt8173/flash_controller.c10
-rw-r--r--src/soc/mediatek/mt8173/include/soc/flash_controller.h2
-rw-r--r--src/soc/mediatek/mt8173/spi.c1
4 files changed, 8 insertions, 10 deletions
diff --git a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
index 77801445be..fc36553d9c 100644
--- a/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
+++ b/src/soc/intel/common/block/fast_spi/fast_spi_flash.c
@@ -280,8 +280,8 @@ static int fast_spi_flash_status(const struct spi_flash *flash,
* The size of the flash component is always taken from density field in the
* SFDP table. FLCOMP.C0DEN is no longer used by the Flash Controller.
*/
-int spi_flash_programmer_probe(const struct spi_slave *dev,
- int force, struct spi_flash *flash)
+static int fast_spi_flash_probe(const struct spi_slave *dev,
+ struct spi_flash *flash)
{
BOILERPLATE_CREATE_CTX(ctx);
uint32_t flash_bits;
@@ -362,4 +362,5 @@ static int fast_spi_flash_ctrlr_setup(const struct spi_slave *dev)
const struct spi_ctrlr fast_spi_flash_ctrlr = {
.setup = fast_spi_flash_ctrlr_setup,
.max_xfer_size = SPI_CTRLR_DEFAULT_MAX_XFER_SIZE,
+ .flash_probe = fast_spi_flash_probe,
};
diff --git a/src/soc/mediatek/mt8173/flash_controller.c b/src/soc/mediatek/mt8173/flash_controller.c
index ee950b8f81..f4c0de47d8 100644
--- a/src/soc/mediatek/mt8173/flash_controller.c
+++ b/src/soc/mediatek/mt8173/flash_controller.c
@@ -228,14 +228,8 @@ static int nor_erase(const struct spi_flash *flash, u32 offset, size_t len)
return 0;
}
-int spi_flash_programmer_probe(const struct spi_slave *spi,
- int force, struct spi_flash *flash)
+int mtk_spi_flash_probe(const struct spi_slave *spi, struct spi_flash *flash)
{
- static int done;
-
- if (done)
- return 0;
-
write32(&mt8173_nor->wrprot, SFLASH_COMMAND_ENABLE);
memcpy(&flash->spi, spi, sizeof(*spi));
flash->name = "mt8173 flash controller";
@@ -246,6 +240,6 @@ int spi_flash_programmer_probe(const struct spi_slave *spi,
flash->sector_size = 0x1000;
flash->erase_cmd = SECTOR_ERASE_CMD;
flash->size = CONFIG_ROM_SIZE;
- done = 1;
+
return 0;
}
diff --git a/src/soc/mediatek/mt8173/include/soc/flash_controller.h b/src/soc/mediatek/mt8173/include/soc/flash_controller.h
index 458f357f5d..82d167a054 100644
--- a/src/soc/mediatek/mt8173/include/soc/flash_controller.h
+++ b/src/soc/mediatek/mt8173/include/soc/flash_controller.h
@@ -87,4 +87,6 @@ struct mt8173_nor_regs {
check_member(mt8173_nor_regs, fdma_end_dadr, 0x724);
static struct mt8173_nor_regs * const mt8173_nor = (void *)SFLASH_REG_BASE;
+int mtk_spi_flash_probe(const struct spi_slave *spi, struct spi_flash *flash);
+
#endif /* __SOC_MEDIATEK_MT8173_FLASH_CONTROLLER_H__ */
diff --git a/src/soc/mediatek/mt8173/spi.c b/src/soc/mediatek/mt8173/spi.c
index 188bdc2881..b8ee4231b9 100644
--- a/src/soc/mediatek/mt8173/spi.c
+++ b/src/soc/mediatek/mt8173/spi.c
@@ -295,6 +295,7 @@ static const struct spi_ctrlr spi_ctrlr = {
.xfer = spi_ctrlr_xfer,
.xfer_vector = spi_xfer_two_vectors,
.max_xfer_size = 65535,
+ .flash_probe = mtk_spi_flash_probe,
};
int spi_setup_slave(unsigned int bus, unsigned int cs, struct spi_slave *slave)