aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-11-05 18:34:01 +0100
committerFelix Fietkau <nbd@nbd.name>2017-11-05 18:52:12 +0100
commite0d58157d8e2ec3da0a1fe62a65aa756c5514871 (patch)
tree739fe3b9a41f345d5af83c47193aa412cb03288c
parente0bd22526906961c15c6d77f17819845677eceb0 (diff)
downloadupstream-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.tar.gz
upstream-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.tar.bz2
upstream-e0d58157d8e2ec3da0a1fe62a65aa756c5514871.zip
ar71xx: fix flash fast read on devices using multiple flash chips
Add a callback to allow the SPI driver to indicate which devices fast flash read works on. Signed-off-by: Felix Fietkau <nbd@nbd.name>
-rw-r--r--target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch16
1 files changed, 11 insertions, 5 deletions
diff --git a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch
index 0dc73a8b5b..5c3583f758 100644
--- a/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch
+++ b/target/linux/ar71xx/patches-4.9/461-spi-ath79-add-fast-flash-read.patch
@@ -10,10 +10,18 @@
}
static void ath79_spi_disable(struct ath79_spi *sp)
-@@ -205,6 +202,33 @@ static u32 ath79_spi_txrx_mode0(struct s
+@@ -205,6 +202,38 @@ static u32 ath79_spi_txrx_mode0(struct s
return ath79_spi_rr(sp, AR71XX_SPI_REG_RDS);
}
++static bool ath79_spi_flash_read_supported(struct spi_device *spi)
++{
++ if (spi->chip_select || gpio_is_valid(spi->cs_gpio))
++ return false;
++
++ return true;
++}
++
+static int ath79_spi_read_flash_data(struct spi_device *spi,
+ struct spi_flash_read_message *msg)
+{
@@ -22,9 +30,6 @@
+ if (msg->addr_width > 3)
+ return -EOPNOTSUPP;
+
-+ if (spi->chip_select || gpio_is_valid(spi->cs_gpio))
-+ return -EOPNOTSUPP;
-+
+ /* disable GPIO mode */
+ ath79_spi_wr(sp, AR71XX_SPI_REG_FS, 0);
+
@@ -44,11 +49,12 @@
static int ath79_spi_probe(struct platform_device *pdev)
{
struct spi_master *master;
-@@ -234,6 +258,7 @@ static int ath79_spi_probe(struct platfo
+@@ -234,6 +263,8 @@ static int ath79_spi_probe(struct platfo
master->num_chipselect = pdata->num_chipselect;
master->cs_gpios = pdata->cs_gpios;
}
+ master->spi_flash_read = ath79_spi_read_flash_data;
++ master->flash_read_supported = ath79_spi_flash_read_supported;
sp->bitbang.master = master;
sp->bitbang.chipselect = ath79_spi_chipselect;