summaryrefslogtreecommitdiff
path: root/src/soc/mediatek/mt8173/spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/soc/mediatek/mt8173/spi.c')
-rw-r--r--src/soc/mediatek/mt8173/spi.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/soc/mediatek/mt8173/spi.c b/src/soc/mediatek/mt8173/spi.c
index c3c71c3db2..dc674f371e 100644
--- a/src/soc/mediatek/mt8173/spi.c
+++ b/src/soc/mediatek/mt8173/spi.c
@@ -23,6 +23,7 @@
#include <string.h>
#include <timer.h>
#include <soc/addressmap.h>
+#include <soc/flash_controller.h>
#include <soc/gpio.h>
#include <soc/pinmux.h>
#include <soc/pll.h>
@@ -161,6 +162,7 @@ static void mtk_spi_dump_data(const char *name, const uint8_t *data,
struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
{
struct mtk_spi_bus *eslave;
+ static struct spi_slave slave;
switch (bus) {
case CONFIG_EC_GOOGLE_CHROMEEC_SPI_BUS:
@@ -168,6 +170,12 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs)
assert(read32(&eslave->regs->spi_cfg0_reg) != 0);
spi_sw_reset(eslave->regs);
return &eslave->slave;
+ case CONFIG_BOOT_MEDIA_SPI_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");
};