- 13 3月, 2019 1 次提交
-
-
由 Trent Piepho 提交于
Commit 71abd290 ("spi: imx: Add support for SPI Slave mode") added an RX FIFO flush before start of a transfer. In slave mode, the master may have sent more data than expected and this data will still be in the RX FIFO at the start of the next transfer, and so needs to be flushed. However, the code to do the flush was accidentally saving this data into the previous transfer's RX buffer, clobbering the contents of whatever followed that buffer. Change it to empty the FIFO and throw away the data. Every one of the RX functions for the different eCSPI versions and modes reads the RX FIFO data using the same readl() call, so just use that, rather than using the spi_imx->rx function pointer and making sure all the different rx functions have a working "throw away" mode. There is another issue, which affects master mode when switching from DMA to PIO. There can be extra data in the RX FIFO which triggers this flush code, causing memory corruption in the same manner. I don't know why this data is unexpectedly in the FIFO. It's likely there is a different bug or erratum responsible for that. But regardless of that, I think this is proper fix the for bug at hand here. Fixes: 71abd290 ("spi: imx: Add support for SPI Slave mode") Cc: Jiada Wang <jiada_wang@mentor.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Stefan Agner <stefan@agner.ch> Cc: Shawn Guo <shawnguo@kernel.org> Signed-off-by: NTrent Piepho <tpiepho@impinj.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 3月, 2019 1 次提交
-
-
由 Chris Lesiak 提交于
This fixes a bug for messages containing both zero length and unidirectional xfers. The function spi_map_msg will allocate dummy tx and/or rx buffers for use with unidirectional transfers when the hardware can only do a bidirectional transfer. That dummy buffer will be used in place of a NULL buffer even when the xfer length is 0. Then in the function __spi_map_msg, if he hardware can dma, the zero length xfer will have spi_map_buf called on the dummy buffer. Eventually, __sg_alloc_table is called and returns -EINVAL because nents == 0. This fix prevents the error by not using the dummy buffer when the xfer length is zero. Signed-off-by: NChris Lesiak <chris.lesiak@licor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 04 3月, 2019 1 次提交
-
-
由 Geert Uytterhoeven 提交于
While the MSIOF variants in older SuperH and SH/R-Mobile SoCs support bits-per-word values in the full range 8..32, the variants present in R-Car Gen2 and Gen3 SoCs are restricted to 8, 16, 24, or 32. Obtain the value from family-specific sh_msiof_chipdata to fix this. Reported-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: NSimon Horman <horms+renesas@verge.net.au> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 2月, 2019 2 次提交
-
-
由 Wei Yongjun 提交于
There is a error message within devm_ioremap_resource already, so remove the dev_err call to avoid redundant error message. Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Wei Yongjun 提交于
The call to spi_master_put() in sifive_spi_remove() is redundant since the master is registered using devm_spi_register_master() and no reference hold by using spi_master_get() in sifive_spi_remove(). This is detected by Coccinelle semantic patch. Fixes: 484a9a68 ("spi: sifive: Add driver for the SiFive SPI controller") Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 2月, 2019 2 次提交
-
-
由 Andy Shevchenko 提交于
When the commit b6ced294 ("spi: pxa2xx: Switch to SPI core DMA mapping functionality") switches to SPI core provided DMA helpers, it missed to setup maximum supported DMA transfer length for the controller and thus users mistakenly try to send more data than supported with the following warning: ili9341 spi-PRP0001:01: DMA disabled for transfer length 153600 greater than 65536 Setup maximum supported DMA transfer length in order to make users know the limit. Fixes: b6ced294 ("spi: pxa2xx: Switch to SPI core DMA mapping functionality") Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
- 19 2月, 2019 2 次提交
-
-
由 Yash Shah 提交于
Add driver for the SiFive SPI controller on the HiFive Unleashed board. Signed-off-by: NPalmer Dabbelt <palmer@sifive.com> Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NYash Shah <yash.shah@sifive.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Yash Shah 提交于
DT documentation for SPI controller added. Signed-off-by: NPalmer Dabbelt <palmer@sifive.com> Signed-off-by: NEmil Renner Berthing <kernel@esmil.dk> Signed-off-by: NYash Shah <yash.shah@sifive.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 2月, 2019 7 次提交
-
-
由 Baolin Wang 提交于
Add a prefix for SPI DMA channel macros to avoid namespace conflicts, and no functional changes. Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lanqing Liu 提交于
Add DMA mode support for the Spreadtrum SPI controller, and we will enable SPI interrupt to help to complete the SPI transfer work in DMA mode. Signed-off-by: NLanqing Liu <lanqing.liu@unisoc.com> Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lanqing Liu 提交于
Add the DMA properties for the SPI dma mode. Signed-off-by: NLanqing Liu <lanqing.liu@unisoc.com> Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lanqing Liu 提交于
The SPI irq event will use to complete the SPI work in the SPI DMA mode, so this patch is a preparation for the following DMA mode support. Moreover the SPI interrupt can be fired when removing the SPI controller, so we should make sure the SPI controller has stopped the queue in remove function before freeing the SPI irq. Signed-off-by: NLanqing Liu <lanqing.liu@unisoc.com> Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Fabio Estevam 提交于
Add an entry for the "fsl,imx8mq-ecspi" compatible to describe the ECSPI version present on i.MX8M. Signed-off-by: NFabio Estevam <festevam@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Felix Fietkau 提交于
Sleeping is safe inside spi_transfer_one_message, and some GPIO chips are running on slow busses (such as I2C GPIO expanders) and need to sleep for setting values. Signed-off-by: NFelix Fietkau <nbd@nbd.name> Signed-off-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jonathan Neuschäfer 提交于
The spi-gpio driver already handles different chip select polarities, but so far this was not advertised in master->mode_bits. This patch fixes mmc_spi on top of spi_gpio, which is useful in some testing scenarios. Signed-off-by: NJonathan Neuschäfer <j.neuschaefer@gmx.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 2月, 2019 3 次提交
-
-
由 Geert Uytterhoeven 提交于
As of commit 8caab75f ('spi: Generalize SPI "master" to "controller"'), the old master-centric names are compatibility wrappers for the new controller-centric names. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Geert Uytterhoeven 提交于
As of commit 8caab75f ('spi: Generalize SPI "master" to "controller"'), the old master-centric names are compatibility wrappers for the new controller-centric names. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Geert Uytterhoeven 提交于
As of commit 8caab75f ('spi: Generalize SPI "master" to "controller"'), the old master-centric names are compatibility wrappers for the new controller-centric names. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 2月, 2019 14 次提交
-
-
由 Tudor Ambarus 提交于
The sam9x60 qspi controller uses 2 clocks, one for the peripheral register access, the other for the qspi core and phy. Both are mandatory. It uses different transfer type bits in IFR register. It has dedicated registers to specify a read or a write instruction: Read Instruction Code Register (RICR) and Write Instruction Code Register (WICR). ICR/RICR/WICR have identical fields. Tested with sst26vf064b jedec,spi-nor flash. Backward compatibility test done on sama5d2 qspi controller and mx25l25635e jedec,spi-nor flash. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
The sam9x60 qspi controller uses 2 clocks, one for the peripheral register access, the other for the qspi core and phy. Both are mandatory. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Naming clocks is a good practice. Keep supporting unnamed peripheral clock, to be backward compatible with old DTs. While here, rename clk to pclk, to indicate that it is a peripheral clock. Suggested-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Naming clocks is a good practice. Make "pclk" madatory even if we support unnamed clock in the driver, to be backward compatible with old DTs. Suggested-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Introduced in: commit b6055787 ("ARM: dts: at91: sama5d2: switch to new clock binding") Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Split the TFRTYP_TRSFR_ bitfields in 2: one bit encoding the mem/reg transfer type and one bit encoding the direction of the transfer (read/write). Remove NOP when setting read transfer type. Remove useless setting of write transfer type when op->data.dir == SPI_MEM_DATA_IN && !op->data.nbytes. QSPI_IFR_TFRTYP_TRSFR_WRITE is specific just to sama5d2 qspi, rename it to QSPI_IFR_SAMA5D2_WRITE_TRSFR. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Adopt the SPDX license identifiers to ease license compliance management. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Return -ENOTSUPP when atmel_qspi_find_mode() fails. Propagate the error in atmel_qspi_exec_op(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
The cast is done implicitly. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Let general names to core drivers. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
The wrappers hid that the accesses are relaxed. Drop them. Suggested-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Cosmetic change, no functional change. Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <bbrezillon@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tudor Ambarus 提交于
Set the controller by default in Serial Memory Mode (SMM) at probe. Cache Mode Register (MR) value to avoid write access when setting the controller in serial memory mode at exec_op(). Signed-off-by: NTudor Ambarus <tudor.ambarus@microchip.com> Reviewed-by: NBoris Brezillon <boris.brezillon@collabora.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lukasz Majewski 提交于
The NXP's Vybryd vf610 can work as a SPI slave device (the CS and clock signals are provided by master). It is possible to specify a single device to work in that mode. As we do use DMA for transferring data, the RX channel must be prepared for incoming data. Moreover, in slave mode we just set a subset of control fields in configuration registers (CTAR0, PUSHR). For testing the spidev_test program has been used. Test script for this patch can be found here: https://github.com/lmajewski/tests-spi/blob/master/tests/spi/spi_tests.shSigned-off-by: NLukasz Majewski <lukma@denx.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 31 1月, 2019 2 次提交
-
-
由 Jonas Bonn 提交于
If the SPI slave requires an inter-word delay, configure the DLYBCT register accordingly. Tested on a SAMA5D2 board (derived from SAMA5D2-Xplained reference board). Signed-off-by: NJonas Bonn <jonas@norrbonn.se> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> CC: Nicolas Ferre <nicolas.ferre@microchip.com> CC: Mark Brown <broonie@kernel.org> CC: Alexandre Belloni <alexandre.belloni@bootlin.com> CC: Ludovic Desroches <ludovic.desroches@microchip.com> CC: linux-spi@vger.kernel.org CC: linux-arm-kernel@lists.infradead.org Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jonas Bonn 提交于
Some devices are slow and cannot keep up with the SPI bus and therefore require a short delay between words of the SPI transfer. The example of this that I'm looking at is a SAMA5D2 with a minimum SPI clock of 400kHz talking to an AVR-based SPI slave. The AVR cannot put bytes on the bus fast enough to keep up with the SoC's SPI controller even at the lowest bus speed. This patch introduces the ability to specify a required inter-word delay for SPI devices. It is up to the controller driver to configure itself accordingly in order to introduce the requested delay. Note that, for spi_transfer, there is already a field word_delay that provides similar functionality. This field, however, is specified in clock cycles (and worse, SPI controller cycles, not SCK cycles); that makes this value dependent on the master clock instead of the device clock for which the delay is intended to provide some relief. This patch leaves this old word_delay in place and provides a time-based word_delay_us alongside it; the new field fits in the struct padding so struct size is constant. There is only one in-kernel user of the word_delay field and presumably that driver could be reworked to use the time-based value instead. The time-based delay is limited to 8 bits as these delays are intended to be short. The SAMA5D2 that I've tested this on limits delays to a maximum of ~100us, which is already many word-transfer periods even at the minimum transfer speed supported by the controller. Signed-off-by: NJonas Bonn <jonas@norrbonn.se> CC: Mark Brown <broonie@kernel.org> CC: Rob Herring <robh+dt@kernel.org> CC: Mark Rutland <mark.rutland@arm.com> CC: linux-spi@vger.kernel.org CC: devicetree@vger.kernel.org Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 1月, 2019 5 次提交
-
-
由 Uwe Kleine-König 提交于
Driver specific implementations for .transfer_one_message need to call the tracing stuff themself. This is necessary to make spi tracing actually useful. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Yogesh Narayan Gaur 提交于
Typo fix in Author Boris Brezillon last name and update with new email address. Fixes: 84d04318 ("spi: Add a driver for the Freescale/NXP QuadSPI controller") Signed-off-by: NYogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vignesh R 提交于
Commit 4dea6c9b ("spi: spi-ti-qspi: add mmap mode read support") has has got order of parameter wrong when calling regmap_update_bits() to select CS for mmap access. Mask and value arguments are interchanged. Code will work on a system with single slave, but fails when more than one CS is in use. Fix this by correcting the order of parameters when calling regmap_update_bits(). Fixes: 4dea6c9b ("spi: spi-ti-qspi: add mmap mode read support") Cc: stable@vger.kernel.org Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Yogesh Narayan Gaur 提交于
Add MODULE_LICENSE info to fix below warning: WARNING: modpost: missing MODULE_LICENSE() in drivers/spi/spi-nxp-fspi.o Typo fix in Boris Brezillon last name. Fixes: a5356aef ("spi: spi-mem: Add driver for NXP FlexSPI controller") Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NYogesh Narayan Gaur <yogeshnarayan.gaur@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Jiwei Sun 提交于
When transfer timeout, give -EAGAIN to the message's status, and it can make the spi device driver choose repeated transimation or not. And if transfer timeout, output some useful information for tracing the issue. Signed-off-by: NJiwei Sun <jiwei.sun@windriver.com> Reviewed-by: NLinus Walleij <linus.walleij@linaro.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-