- 09 12月, 2016 2 次提交
-
-
由 Uwe Kleine-König 提交于
The calculation of SPR and SPPR doesn't round correctly at several places which might result in baud rates that are too big. For example with tclk_hz = 250000001 and target rate 25000000 it determined a divider of 10 which is wrong. Instead of fixing all the corner cases replace the calculation by an algorithm without a loop which should even be quicker to execute apart from being correct. Fixes: df59fa7f ("spi: orion: support armada extended baud rates") Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Romain Perier 提交于
Marvell Armada 3700 SoC comprises an SPI Controller. This Controller supports up to 4 SPI slave devices, with dedicated chip selects,supports SPI mode 0/1/2 and 3, CPIO or Fifo mode with DMA transfers and different SPI transfer mode (Single, Dual or Quad). This commit adds basic driver support for FIFO mode. In this mode, dedicated registers are used to store the instruction, the address, the read mode and the data. Write and Read FIFO are used to store the outcoming or incoming data. The data FIFOs are accessible via DMA or by the CPU. Only the CPU is supported for now. Signed-off-by: NRomain Perier <romain.perier@free-electrons.com> Tested-by: NGregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 12月, 2016 1 次提交
-
-
由 Heiner Kallweit 提交于
fsl_espi_read_reg16 / fsl_espi_write_reg16 are supposed to read / write big endian values. Therefore ioread16be / iowrite16be have to be used. Fixes: 05823432 ("eliminate need for linearization when writing to hardware") Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 12月, 2016 4 次提交
-
-
由 Heiner Kallweit 提交于
After introducing direct transfers between hardware and transfer buffers remove all code which is unused now. This includes getting rid of the 64k linearization buffer. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Eliminate need for linearization when reading from the hardware and write to the transfer buffers directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Eliminate need for linearization when writing to the hardware and read from the transfer buffers directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Determine need for byte swap only once and store it in new member swab in struct fsl_espi. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 11月, 2016 5 次提交
-
-
由 Nicolas Ferre 提交于
For DMA transfers, we now use the core DMA framework which provides channel fields in the spi_master structure. Remove the private channels from atmel_spi stucture which were located in a sub-structure. This last one (atmel_spi_dma) which is now empty is also removed. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
The atmel_spi_dma structure was cluttered with unused fields relative to older DMA channel selection API. Remove them. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Cyrille Pitchen 提交于
Use the SPI core DMA mapping framework instead of our own in case of DMA support. PDC support is not converted to this framework. The driver is now able to transfer a complete sg list through DMA. This eventually fix an issue with vmalloc'ed DMA memory that is provided for example by UBI/UBIFS layers. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> [nicolas.ferre@atmel.com: restrict the use to non-PDC DMA] Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
We need both RX and TX data for each transfer in any case (PIO, PDC, DMA). So convert the driver to the core dummy buffer handling with the SPI_MASTER_MUST_RX/SPI_MASTER_MUST_TX infrastructure. This move changes the maximum PDC/DMA buffer handling to 65535 bytes instead of a single page and sets master->max_dma_len to this value. All dummy buffer management is removed from the driver. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
The info banner is here to tell that everything went well, so place it at the very end of the probe function. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 11月, 2016 2 次提交
-
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-ath79.ko | grep alias alias: platform:ath79-spi After this patch: $ modinfo drivers/spi/spi-ath79.ko | grep alias alias: platform:ath79-spi alias: of:N*T*Cqca,ar7100-spiC* alias: of:N*T*Cqca,ar7100-spi Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-axi-spi-engine.ko | grep alias $ After this patch: $ modinfo drivers/spi/spi-axi-spi-engine.ko | grep alias alias: of:N*T*Cadi,axi-spi-engine-1.00.aC* alias: of:N*T*Cadi,axi-spi-engine-1.00.a Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 11月, 2016 4 次提交
-
-
由 Sanchayan Maity 提交于
Current DMA implementation was not handling the continuous selection format viz. SPI chip select would be deasserted even between sequential serial transfers. Use existing dspi_data_to_pushr function to restructure the transmit code path and set or reset the CONT bit on same lines as code path in EOQ mode does. This correctly implements continuous selection format while also correcting and cleaning up the transmit code path. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Currently dmaengine_prep_slave_single was being called with length set to the complete DMA buffer size. This resulted in unwanted bytes being transferred to the SPI register leading to clock and MOSI lines having unwanted data even after chip select got deasserted and the required bytes having been transferred. While at it also clean up the use of curr_xfer_len which is central to the DMA setup, from bytes to DMA transfers for every use. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Buffers allocated with a call to dma_alloc_coherent should be freed with dma_free_coherent instead of the currently used devm_kfree. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Juan Gutierrez 提交于
A null dereference or Oops exception might occurs when reading at once the whole content of an spi-nor of big enough size that requires an scatterlist table that does not fit into one single page. The spi_map_buf function is ignoring the chained sg case by dereferenceing the scatterlist elements in an array fashion. This wrongly assumes that the allocation of the scatterlist elements are contiguous. This is true as long as the scatterlist table fits within a PAGE_SIZE. However, for allocation where the scatter table is bigger than that, the pages allocated by sg_alloc might not be contigous. The sg table can be properly walked by sg_next instead of using an array. Signed-off-by: NJuan Gutierrez <juan.gutierrez@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 11月, 2016 1 次提交
-
-
由 Geert Uytterhoeven 提交于
MSIOF in R-Car M3-W (r8a7796) is handled fine by the existing driver. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 11月, 2016 1 次提交
-
-
由 Sanchayan Maity 提交于
Current DMA implementation had a bug where the DMA transfer would exit the loop in dspi_transfer_one_message after the completion of a single transfer. This results in a multi message transfer submitted with SPI_IOC_MESSAGE to terminate incorrectly without an error. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2016 3 次提交
-
-
由 Heiner Kallweit 提交于
ESPI has a max and min supported SPI frequency, determined by the clock divider range. Set master->min_speed_hz/max_speed_hz to inform the SPI core about these limits. Then the SPI core handles cases where a transfer requests a frequency outside the supported range. So far the driver simply set the lowest supported frequency if the requested frequency was below the supported range. This is not necessarily an appropriate action as the device might not support frequencies greater than the requested one. With this patch the SPI core will reject transfers requesting a too low frequency. The check in fsl_espi_setup can be removed because the SPI core sets spi->max_speed_hz to master->max_speed_hz if it's not set already. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Simplify of_fsl_espi_suspend a little. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ben Whitten 提交于
A call to clk_get_rate appears to be called in the context of an interrupt, cache the bus clock for the frequency calculations in transmission. This fixes a 'BUG: scheduling while atomic' and 'WARNING: CPU: 0 PID: 777 at kernel/sched/core.c:2960 atmel_spi_unlock' Signed-off-by: NBen Whitten <ben.whitten@lairdtech.com> Signed-off-by: NSteve deRosier <steve.derosier@lairdtech.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 11月, 2016 1 次提交
-
-
由 Dan Carpenter 提交于
These lines were indented one extra tab. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 11月, 2016 10 次提交
-
-
由 Heiner Kallweit 提交于
After having removed all code dependencies we can make fsl-espi completely independent of fsl-lib now. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Only few members of struct mpc8xxx_spi are relevant for fsl-espi. Therefore replace it with a ESPI-specific struct fsl_espi. Replace variable names mpc8xxx_spi and mspi with espi. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
The register initialization is the same in fsl_espi_probe and in of_fsl_espi_resume. Therefore factor it out into fsl_espi_init_regs. It was actually a bug that CSMODE_BEF and CSMODE_AFT were not set in of_fsl_espi_resume. Seems like nobody ever used values other than zero for these parameters. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Very little from struct spi_mpc8xxx_cs is relevant for fsl-espi. Therefore replace it with struct fsl_espi_cs. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Very little of the library functions mpc8xxx_spi_probe and of_mpc8xxx_spi_probe is relevant for fsl-espi. Therefore migrate the relevant parts to fsl-espi (considering that get_brgfreq() always returns -1 on systems with ESPI) and remove use of these functions. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
There's no need to access mpc8xxx_spi->irq, we can use function parameter irq directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Change the check to access property "mode" directly. This allows us to get rid of mpc8xxx_spi->flags in a subsequent patch in this patch series as it's used nowhere else. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Use master->num_chipselect directly instead of pdata->max_chipselect. In this context let of_fsl_espi_get_chipselects return max_chipselect. This change allows us to get rid of struct fsl_spi_platform_data completely in the fsl-espi driver. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Don't set pdata->cs_control as it's nowhere used in fsl-espi and fsl-lib. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Remove pdata->initial_spmode as it is nowhere set. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 11月, 2016 2 次提交
-
-
由 Heiner Kallweit 提交于
This patch adds support for dual output read mode. It was successfully tested on a P1014-based device with S25FL128S SPINOR flash. With 50MHz SPI clock the read rate is 11MByte/s. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
This patch adds support for ESPI RXSKIP mode. This mode is optimized for flash reads: - sends a number of bytes and then reads a number of bytes - shifts out zeros automatically when reading Supporting RXSKIP mode is a prerequisite for supporting dual output read mode. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 11月, 2016 1 次提交
-
-
由 Sanchayan Maity 提交于
Add DMA support for Vybrid. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 09 11月, 2016 1 次提交
-
-
由 Nicolas Ferre 提交于
Use the managed gpio CS pin request so that we avoid having trouble in the cleanup code. In fact, if module was configured with DT, cleanup code released invalid pin. Since resource wasn't freed, module cannot be reinserted. This require to extract the gpio request call from the "setup" function and call it in the appropriate probe function. Reported-by: NAlexander Morozov <linux@meltdown.ru> Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 11月, 2016 2 次提交
-
-
由 Heiner Kallweit 提交于
There's no need to bother the chip if the mode doesn't change. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Resetting the chip to a default transfer mode after each transfer doesn't provide any benefit. Therefore remove this call. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-