- 05 1月, 2018 1 次提交
-
-
由 Radu Pirea 提交于
This patch enables SPI DMA transfers for Atmel SAM9 SoCs and implements a bounce buffer for transfers which have vmalloc allocated buffers. Those buffers are not cache coherent even if they have been transformed into sg lists. UBIFS is affected by this cache coherency issue. In this patch I also reverted "spi: atmel: fix corrupted data issue on SAM9 family SoCs"(7094576c). Signed-off-by: NRadu Pirea <radu.pirea@microchip.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 12月, 2017 1 次提交
-
-
由 Radu Pirea 提交于
The only part of atmel_spi_remove which needs to be atomic is hardware reset. atmel_spi_stop_dma calls dma_terminate_all and this needs interrupts enabled. atmel_spi_release_dma calls dma_release_channel and dma_release_channel locks a mutex inside of spin_lock. So the call of these functions can't be inside a spin_lock. Reported-by: NJia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: NRadu Pirea <radu.pirea@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 6月, 2017 1 次提交
-
-
由 Cyrille Pitchen 提交于
This patch disables the use of the DMA for data transfer and forces the use of PIO transfers instead as a quick fixup to solve the cache aliasing issue on ARM9 based cores, which embeds a VIVT data cache. Indeed in the case of VIVT data caches, it is not safe to call dma_map_*() functions to map buffers for DMA transfers when those buffers have been allocated by vmalloc() or from any DMA-unsafe area. Further patches may propose a better solution based on the use of a bounce buffer at the SPI sub-system level but such solution needs more time to be discussed. Then the use of DMA transfers could be enabled again to improve the performances but before that, this patch already solves the issue. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@microchip.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 07 6月, 2017 1 次提交
-
-
由 Baruch Siach 提交于
Don't print the version at the beginning of atmel_spi_probe(). This avoids spamming the log whenever a deferred probe runs. Signed-off-by: NBaruch Siach <baruch@tkos.co.il> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 4月, 2017 1 次提交
-
-
由 Quentin Schulz 提交于
This adds deepest (Backup+Self-Refresh) PM support to the ATMEL SAMA5D2 SoC's SPI controller. When resuming from deepest state, it is required to restore MR register as the registers are lost since VDD core has been shut down when entering deepest state on the SAMA5D2. Signed-off-by: NQuentin Schulz <quentin.schulz@free-electrons.com> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 4月, 2017 1 次提交
-
-
由 Quentin Schulz 提交于
The SPI controller configuration during the init can be reused, for the resume function for example. Let's move this configuration to a separate function. Signed-off-by: NQuentin Schulz <quentin.schulz@free-electrons.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.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>
-
- 16 11月, 2016 1 次提交
-
-
由 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>
-
- 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>
-
- 29 1月, 2016 1 次提交
-
-
由 Cyrille Pitchen 提交于
The non-DT platform that uses this driver (actually the AVR32) was taking a bad branch for determining if the IP would use gpio for CS. Adding the presence of DT as a condition fixes this issue. Fixes: 48203034 ("spi: atmel: add support for the internal chip-select of the spi controller") Reported-by: NMans Rullgard <mans@mansr.com> Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> [nicolas.ferre@atmel.com: extract from ml discussion] Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Tested-by: NMans Rullgard <mans@mansr.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 23 10月, 2015 1 次提交
-
-
由 David Mosberger-Tang 提交于
The DMA-slave configuration depends on the whether <= 8 or > 8 bits are transferred per word, so we need to call atmel_spi_dma_slave_config() with the correct value. Signed-off-by: NDavid Mosberger <davidm@egauge.net> Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 26 9月, 2015 1 次提交
-
-
由 Jarkko Nikula 提交于
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This makes possible to remove two if statements and remove one code block that is never executed. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 9月, 2015 1 次提交
-
-
由 Jarkko Nikula 提交于
SPI core validates both bits_per_word and speed_hz transfer parameters and defaults to spi->bits_per_word and spi->max_speed_hz in case these per transfer parameters are not set. This makes possible to remove two if statements and remove one code block that is never executed. Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 9月, 2015 1 次提交
-
-
由 Alexandre Belloni 提交于
When CONFIG_PM is defined but not CONFIG_PM_SLEEP (this happens when CONFIG_SUSPEND is not defined), there is the following warning: drivers/spi/spi-atmel.c:1723:12: warning: ‘atmel_spi_suspend’ defined but not used [-Wunused-function] drivers/spi/spi-atmel.c:1741:12: warning: ‘atmel_spi_resume’ defined but not used [-Wunused-function] Enclose both atmel_spi_suspend and atmel_spi_resume in #ifdef CONFIG_PM_SLEEP/#endif to solve that. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 8月, 2015 1 次提交
-
-
由 Alexandre Belloni 提交于
Definitions from linux/platform_data/atmel.h are not used, remove the include. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 6月, 2015 1 次提交
-
-
由 Cyrille Pitchen 提交于
The latest SPI controllers embedded inside sama5d2x SoCs come with FIFOs. When FIFOs are enabled, they can either work in SINGLE data mode or MULTIPLE data mode. The selected mode depends on the configuration of the SPI controller (see below). In SINGLE data mode (or legacy mode), for a single I/O access, only one data can be read from the Receive Data Register (RDR) or written into the Transmit Data Register (TDR). On the other hand, in MULTIPLE data mode, up to 4 data can be read from the RDR or up 2 data can be written into the TDR in a single 32bit I/O access. So programmers should take good care of the width of the I/O access to read/write the right number of data. The exact number of read/written data depends on both the I/O access width and the data width (from 8 up to 16 bits). To enable the FIFO feature a "atmel,fifo-size" property must be set to provide the maximum number of data (not bytes) the RX and TX FIFOs can store. Hence a 32 data FIFO can always store up to 32 data unrelated with the actual data width. When FIFOs are enabled, the RX one is forced to operate in SINGLE data mode because this driver configures the spi controller as a master. In master mode only, the Received Data Register has an additionnal Peripheral Chip Select field, which prevents us from reading more than a single data at each register access. Besides, the TX FIFO operates in MULTIPLE data mode. However, even when a 8bit data size is used, only two data by access could be written into the Transmit Data Register. Indeed the first data has to be written into the lowest 16 bits whereas the second data has to be written into the highest 16 bits of the TDR. When DMA transfers are used to send data, we don't rework the transmit buffer to cope with this hardware limitation: the additional copies required to prepare a new input buffer suited to both the DMA controller and the spi controller would waste all the benefit of the DMA transfer. Instead, the DMA controller is configured to write only one data at time into the TDR. In pio mode, two data are written in the TDR in a single access. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 6月, 2015 1 次提交
-
-
由 Cyrille Pitchen 提交于
This patch relies on the CSAAT (Chip Select Active After Transfer) feature introduced by the version 2 of the spi controller. This new mode allows to use properly the internal chip-select output pin of the spi controller instead of using external gpios. Consequently, the "cs-gpios" device-tree property becomes optional. When the new CSAAT bit is set into the Chip Select Register, the internal chip-select output pin remains asserted till both the following conditions become true: - the LASTXFER bit is set into the Control Register (or the Transmit Data Register) - the Transmit Data Register and its shift register are empty. WARNING: if the LASTXFER bit is set into the Control Register then new data are written into the Transmit Data Register fast enough to keep its shifter not empty, the chip-select output pin remains asserted. Only when the shifter becomes empty, the chip-select output pin is unasserted. When the CSAAT bit is clear in the Chip Select Register, the LASTXFER bit is ignored in both the Control Register and the Transmit Data Register. The internal chip-select output pin remains active as long as the Transmit Data Register or its shift register are not empty. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 3月, 2015 1 次提交
-
-
由 Ben Dooks 提交于
Use the endian agnositc IO functions instead of the __raw ones for when the driver is in use on big-endian systems. Signed-off-by: NBen Dooks <ben.dooks@codethink.co.uk> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 26 2月, 2015 1 次提交
-
-
由 Torsten Fleischer 提交于
Additionally to the current DMA transfer the PDC allows to set up a next DMA transfer. This is useful for larger SPI transfers. The driver currently waits for ENDRX as end of the transfer. But ENDRX is set when the current DMA transfer is done (RCR = 0), i.e. it doesn't include the next DMA transfer. Thus a subsequent SPI transfer could be started although there is currently a transfer in progress. This can cause invalid accesses to the SPI slave devices and to SPI transfer errors. This issue has been observed on a hardware with a M25P128 SPI NOR flash. So instead of ENDRX we should wait for RXBUFF. This flag is set if there is no more DMA transfer in progress (RCR = RNCR = 0). Signed-off-by: NTorsten Fleischer <torfl6749@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 04 2月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
return type of wait_for_completion_timeout is unsigned long not int, this patch adds an appropriate variable and fixes up the assignment. It removes the else branch as the only thing it was doing is assigning ret = 0; - but ret is never used thereafter so that is not needed. As the string in dev_err already states "timeout" there is little point in printing the 0. A typo in "trasfer" -> transfer is also fixed. Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 11月, 2014 2 次提交
-
-
由 Ludovic Desroches 提交于
Return probe defer if requesting a dma channel without a dma controller probed. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ludovic Desroches 提交于
All boards with a dma controller have DT support so using dma_request_slave_channel_compat is no more needed. Signed-off-by: NLudovic Desroches <ludovic.desroches@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 10月, 2014 1 次提交
-
-
由 Wenyou Yang 提交于
To make it cleaner, the system suspend/resume directly call the runtime suspend/resume functions and remove the wapper of CONFIG_PM_RUNTIME, CONFIG_PM_SLEEP. Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Acked-by: NKevin Hilman <khilman@linaro.org> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 10月, 2014 4 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
由 Fengguang Wu 提交于
drivers/spi/spi-atmel.c:1518:1-4: WARNING: end returns can be simpified and declaration on line 1514 can be dropped Simplify a trivial if-return sequence. Possibly combine with a preceding function call. Generated by: scripts/coccinelle/misc/simple_return.cocci Signed-off-by: NFengguang Wu <fengguang.wu@intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Wenyou Yang 提交于
Drivers should put the device into low power states proactively whenever the device is not in use. Thus implement support for runtime PM and use the autosuspend feature to make sure that we can still perform well in case we see lots of SPI traffic within short period of time. Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vinod Koul 提交于
The drivers should use dmaengine_terminate_all() API instead of accessing the device_control which will be deprecated soon Signed-off-by: NVinod Koul <vinod.koul@intel.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 8月, 2014 1 次提交
-
-
由 Mark Brown 提交于
On 64 bit systems integers are generally still 32 bit but long values and pointers are usually 64 bit. GCC warns when casting a 64 bit pointer into a 32 bit integer so cast to a long instead in order to avoid warnings. Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 17 7月, 2014 1 次提交
-
-
由 Geert Uytterhoeven 提交于
Use the inline wrapper introduced by commit 16052827 ("dmaengine/dma_slave: introduce inline wrappers"). Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 08 5月, 2014 1 次提交
-
-
由 Alexandre Belloni 提交于
Found using smatch: drivers/spi/spi-atmel.c:878 atmel_spi_pump_pio_data() warn: unsigned 'as->current_remaining_bytes' is never less than zero. Signed-off-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 18 4月, 2014 1 次提交
-
-
由 Alexander Stein 提交于
atmel_spi_lock does a spin_lock_irqsave, so we need to renable the interrupts when we want to schedule. Signed-off-by: NAlexander Stein <alexanders83@web.de> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 15 4月, 2014 1 次提交
-
-
由 Axel Lin 提交于
Don't use unsigned for current_remaining_bytes so we can check current_remaining_bytes < 0 case. Use int is enough for current_remaining_bytes. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 22 3月, 2014 1 次提交
-
-
由 Randy Dunlap 提交于
Fix printk format warning by using %p extension 'ad' for dma_addr_t. drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat] drivers/spi/spi-atmel.c:1228:3: warning: format '%x' expects argument of type 'unsigned int', but argument 9 has type 'dma_addr_t' [-Wformat] Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 05 3月, 2014 2 次提交
-
-
由 Wenyou Yang 提交于
The PM callbacks implemented by the spi-atmel driver don't call spi_master_{resume,suspend}, fix that. Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Wenyou Yang 提交于
Amend the spi atmel pin controller to optionally take a pin control handle and set the state of the pins to: - "default" on boot, resume and before performing an spitransfer - "sleep" on suspend() This should make it possible to optimize energy usage for the pins both for the suspend/resume cycle Signed-off-by: NWenyou Yang <wenyou.yang@atmel.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-