aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch
diff options
context:
space:
mode:
authorMatti Laakso <matti.laakso@outlook.com>2018-03-18 17:23:08 +0200
committerHauke Mehrtens <hauke@hauke-m.de>2018-03-31 16:13:19 +0200
commitcae808946ae5f698d8c9e2c58b9b75e69c343c38 (patch)
treed5c642fcbc6705b4d53a0402f08ca6ff1038ce52 /target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch
parent2534141322b0541daa627a516280638c12a262fe (diff)
downloadupstream-cae808946ae5f698d8c9e2c58b9b75e69c343c38.tar.gz
upstream-cae808946ae5f698d8c9e2c58b9b75e69c343c38.tar.bz2
upstream-cae808946ae5f698d8c9e2c58b9b75e69c343c38.zip
pistachio: add kernel 4.14 support
Add patches and config for 4.14, refreshed from 4.9. Signed-off-by: Matti Laakso <matti.laakso@outlook.com>
Diffstat (limited to 'target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch')
-rw-r--r--target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch b/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch
new file mode 100644
index 0000000000..6c9e6b5a76
--- /dev/null
+++ b/target/linux/pistachio/patches-4.14/104-spi-img-spfi-use-device-0-configuration-for-all-devi.patch
@@ -0,0 +1,64 @@
+From 905ee06a9966113fe51d6bad1819759cb30fd0bd Mon Sep 17 00:00:00 2001
+From: Ionela Voinescu <ionela.voinescu@imgtec.com>
+Date: Tue, 9 Feb 2016 10:18:31 +0000
+Subject: spi: img-spfi: use device 0 configuration for all devices
+
+Given that we control the chip select line externally
+we can use only one parameter register (device 0 parameter
+register) and one set of configuration bits (port configuration
+bits for device 0) for all devices (all chip select lines).
+
+Signed-off-by: Ionela Voinescu <ionela.voinescu@imgtec.com>
+---
+ drivers/spi/spi-img-spfi.c | 23 ++++++++++++++++-------
+ 1 file changed, 16 insertions(+), 7 deletions(-)
+
+--- a/drivers/spi/spi-img-spfi.c
++++ b/drivers/spi/spi-img-spfi.c
+@@ -437,18 +437,23 @@ static int img_spfi_prepare(struct spi_m
+ struct img_spfi *spfi = spi_master_get_devdata(master);
+ u32 val;
+
++ /*
++ * The chip select line is controlled externally so
++ * we can use the CS0 configuration for all devices
++ */
+ val = spfi_readl(spfi, SPFI_PORT_STATE);
++
++ /* 0 for device selection */
+ val &= ~(SPFI_PORT_STATE_DEV_SEL_MASK <<
+ SPFI_PORT_STATE_DEV_SEL_SHIFT);
+- val |= msg->spi->chip_select << SPFI_PORT_STATE_DEV_SEL_SHIFT;
+ if (msg->spi->mode & SPI_CPHA)
+- val |= SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select);
++ val |= SPFI_PORT_STATE_CK_PHASE(0);
+ else
+- val &= ~SPFI_PORT_STATE_CK_PHASE(msg->spi->chip_select);
++ val &= ~SPFI_PORT_STATE_CK_PHASE(0);
+ if (msg->spi->mode & SPI_CPOL)
+- val |= SPFI_PORT_STATE_CK_POL(msg->spi->chip_select);
++ val |= SPFI_PORT_STATE_CK_POL(0);
+ else
+- val &= ~SPFI_PORT_STATE_CK_POL(msg->spi->chip_select);
++ val &= ~SPFI_PORT_STATE_CK_POL(0);
+ spfi_writel(spfi, val, SPFI_PORT_STATE);
+
+ return 0;
+@@ -548,11 +553,15 @@ static void img_spfi_config(struct spi_m
+ div = DIV_ROUND_UP(clk_get_rate(spfi->spfi_clk), xfer->speed_hz);
+ div = clamp(512 / (1 << get_count_order(div)), 1, 128);
+
+- val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(spi->chip_select));
++ /*
++ * The chip select line is controlled externally so
++ * we can use the CS0 parameters for all devices
++ */
++ val = spfi_readl(spfi, SPFI_DEVICE_PARAMETER(0));
+ val &= ~(SPFI_DEVICE_PARAMETER_BITCLK_MASK <<
+ SPFI_DEVICE_PARAMETER_BITCLK_SHIFT);
+ val |= div << SPFI_DEVICE_PARAMETER_BITCLK_SHIFT;
+- spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(spi->chip_select));
++ spfi_writel(spfi, val, SPFI_DEVICE_PARAMETER(0));
+
+ if (!list_is_last(&xfer->transfer_list, &master->cur_msg->transfers) &&
+ /*