summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@chromium.org>2016-11-17 20:38:07 -0800
committerFurquan Shaikh <furquan@google.com>2016-11-22 17:37:57 +0100
commitd2fb6ae813880b8fd1b3983e0e61c7e51fb9b20b (patch)
treece8dcf60dd013444448e2be2ef6d52c7179ceac2 /src/soc/mediatek/mt8173
parentdc34fb60b4151a7fad3882cc85dac4379f2d8dd8 (diff)
spi: Get rid of flash_programmer_probe in spi_slave structure
flash_programmer_probe is a property of the spi flash driver and does not belong in the spi_slave structure. Thus, make spi_flash_programmer_probe a callback from the spi_flash_probe function. Logic still remains the same as before (order matters): 1. Try spi_flash_programmer_probe without force option 2. Try generic flash probing 3. Try spi_flash_programmer_probe with force option If none of the above steps work, fail probing. Flash controller is expected to honor force option to decide whether to perform specialized probing or to defer to generic probing. BUG=None BRANCH=None TEST=Compiles successfully Change-Id: I4163593eea034fa044ec2216e56d0ea3fbc86c7d Signed-off-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://review.coreboot.org/17465 Tested-by: build bot (Jenkins) Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/soc/mediatek/mt8173')
-rw-r--r--src/soc/mediatek/mt8173/flash_controller.c2
-rw-r--r--src/soc/mediatek/mt8173/include/soc/flash_controller.h1
-rw-r--r--src/soc/mediatek/mt8173/spi.c2
3 files changed, 1 insertions, 4 deletions
diff --git a/src/soc/mediatek/mt8173/flash_controller.c b/src/soc/mediatek/mt8173/flash_controller.c
index dc64d4083c..3799c6ac10 100644
--- a/src/soc/mediatek/mt8173/flash_controller.c
+++ b/src/soc/mediatek/mt8173/flash_controller.c
@@ -233,7 +233,7 @@ static int nor_erase(const struct spi_flash *flash, u32 offset, size_t len)
return 0;
}
-struct spi_flash *mt8173_nor_flash_probe(struct spi_slave *spi)
+struct spi_flash *spi_flash_programmer_probe(struct spi_slave *spi, int force)
{
static struct spi_flash flash = {0};
diff --git a/src/soc/mediatek/mt8173/include/soc/flash_controller.h b/src/soc/mediatek/mt8173/include/soc/flash_controller.h
index 1d2ac32432..458f357f5d 100644
--- a/src/soc/mediatek/mt8173/include/soc/flash_controller.h
+++ b/src/soc/mediatek/mt8173/include/soc/flash_controller.h
@@ -87,5 +87,4 @@ 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;
-struct spi_flash *mt8173_nor_flash_probe(struct spi_slave *spi);
#endif /* __SOC_MEDIATEK_MT8173_FLASH_CONTROLLER_H__ */
diff --git a/src/soc/mediatek/mt8173/spi.c b/src/soc/mediatek/mt8173/spi.c
index c35b1fc507..d8639e0ceb 100644
--- a/src/soc/mediatek/mt8173/spi.c
+++ b/src/soc/mediatek/mt8173/spi.c
@@ -173,8 +173,6 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
case CONFIG_BOOT_DEVICE_SPI_FLASH_BUS:
slave.bus = bus;
slave.cs = cs;
- slave.force_programmer_specific = 1;
- slave.programmer_specific_probe = &mt8173_nor_flash_probe;
return &slave;
default:
die ("wrong bus number.\n");