- 17 5月, 2018 1 次提交
-
-
由 Boris Brezillon 提交于
resource_size() is dereferencing the res without checking that it is not NULL, so we need to do the check before calling resource_size(). Fixes: b95cb394 ("spi: ti-qspi: Implement the spi_mem interface") Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 11 5月, 2018 2 次提交
-
-
由 Boris Brezillon 提交于
This API has been replaced by the spi_mem_xx() one, its only user (spi-nor) has been converted to spi_mem_xx() and all SPI controller drivers that were implementing the ->spi_flash_xxx() hooks are also implementing the spi_mem ones. So we can safely get rid of this API. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NFrieder Schrempf <frieder.schrempf@exceet.de> Tested-by: NFrieder Schrempf <frieder.schrempf@exceet.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Boris Brezillon 提交于
The spi_mem interface is meant to replace the spi_flash_read() one. Implement the ->exec_op() method so that we can smoothly get rid of the old interface. Signed-off-by: NBoris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: NVignesh R <vigneshr@ti.com> Tested-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 4月, 2017 1 次提交
-
-
由 Vignesh R 提交于
Flash filesystems like JFFS2, UBIFS and MTD block layer can provide vmalloc'd or kmap'd buffers that cannot be mapped using dma_map_sg() and can potentially be in memory region above 32bit addressable region(ie buffers belonging to memory region backed by LPAE) of DMA, implement spi_flash_can_dma() interface to inform SPI core not to map such buffers. When buffers are not mapped for DMA, then use a pre allocated bounce buffer(64K = typical flash erase sector size) to read from flash and then do a copy to actual destination buffer. This is approach is much faster than using memcpy using CPU and also reduces CPU load. With this patch, UBIFS read speed is ~18MB/s and CPU utilization <20% on DRA74 Rev H EVM. Performance degradation is negligible when compared with non bounce buffer case while using UBIFS. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 27 3月, 2017 1 次提交
-
-
由 Vignesh R 提交于
commit 1351aaeb ("spi: spi-ti-qspi: Use dma_engine wrapper for dma memcpy call") introduced this warning: drivers/spi/spi-ti-qspi.c: In function 'ti_qspi_dma_xfer': drivers/spi/spi-ti-qspi.c:398:21: warning: unused variable 'dma_dev' [-Wunused-variable] struct dma_device *dma_dev = chan->device; Fix it by removing the unused variable. Signed-off-by: NVignesh R <vigneshr@ti.com> Reported-by: NStephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 3月, 2017 1 次提交
-
-
由 Vignesh R 提交于
Instead of calling device_prep_dma_memcpy() directly with dma_device pointer, use the newly introduced dmaengine_prep_dma_memcpy() wrapper API. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 2月, 2017 2 次提交
-
-
由 Christophe JAILLET 提交于
'dma_request_chan_by_mask()' can not return NULL. Try to keep the logic in 'no_dma:' by resetting 'qspi->rx_chan' in case of error. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Christophe JAILLET 提交于
'dma_request_chan_by_mask()' can not return NULL. Try to keep the logic in 'no_dma:' by resetting 'qspi->rx_chan' in case of error. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 2月, 2017 1 次提交
-
-
由 Prahlad V 提交于
call spi_master_put() in case of failures after spi_alloc_master(). call pm_runtime_disable() in case of failures after pm_runtime_enable(). Signed-off-by: NPrahlad V <prahlad.eee@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2016 1 次提交
-
-
由 Prahlad V 提交于
completion variable should be reinitialized before reusing. Signed-off-by: NPrahlad V <prahlad.eee@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 8月, 2016 1 次提交
-
-
由 Vignesh R 提交于
Use mem-to-mem DMA to read from flash when reading in mmap mode. This gives improved read performance and reduces CPU load. With this patch the raw-read throughput is ~16MB/s on DRA74 EVM. And CPU load is <20%. UBIFS read throughput ~13 MB/s. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 26 6月, 2016 1 次提交
-
-
由 Colin Ian King 提交于
trivial fix to spelling mistake in dev_dbg message Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 6月, 2016 1 次提交
-
-
由 Jean-Jacques Hiblot 提交于
Before disabling the pm_runtime, we must ensure that there is no transfer in progress nor will a new one be started. Otherwise the message pump will fail and in the end, the process requesting the transfer will be stuck. This behavior has been observed when transferring data from a SPI flash with dd while removing the module on a DRA7x-evm. Signed-off-by: NJean-Jacques Hiblot <jjhiblot@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 4月, 2016 2 次提交
-
-
由 Ben Hutchings 提交于
We clamp frame_len_words to a maximum of 4096, but do not actually limit the number of words written or read through the DATA registers or the length added to spi_message::actual_length. This results in silent data corruption for commands longer than this maximum. Recalculate the length of each transfer, taking frame_len_words into account. Use this length in qspi_{read,write}_msg(), and to increment spi_message::actual_length. Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org -
由 Ben Hutchings 提交于
Each transfer can specify 8, 16 or 32 bits per word independently of the default for the device being addressed. However, currently we calculate the number of words in the frame assuming that the word size is the device default. If multiple transfers in the same message have differing bits_per_word, we bitwise-or the different values in the WLEN register field. Fix both of these. Also rename 'frame_length' to 'frame_len_words' to make clear that it's not a byte count like spi_message::frame_length. Signed-off-by: NBen Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
- 10 2月, 2016 1 次提交
-
-
由 Vignesh R 提交于
ti-qspi controller provides mmap port to read data from SPI flashes. mmap port is enabled in QSPI_SPI_SWITCH_REG. ctrl module register may also need to be accessed for some SoCs. The QSPI_SPI_SETUP_REGx needs to be populated with flash specific information like read opcode, read mode(quad, dual, normal), address width and dummy bytes. Once, controller is in mmap mode, the whole flash memory is available as a memory region at SoC specific address. This region can be accessed using normal memcpy() (or mem-to-mem dma copy). The ti-qspi controller hardware will internally communicate with SPI flash over SPI bus and get the requested data. Implement spi_flash_read() callback to support mmap read over SPI flash devices. With this, the read throughput increases from ~100kB/s to ~2.5 MB/s. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 10月, 2015 1 次提交
-
-
由 Felipe Balbi 提交于
there's no need to call pm_runtime_get_sync() followed by pm_runtime_put(). We should, instead, just call pm_runtime_put_sync() and pm_runtime_disable(). Signed-off-by: NFelipe Balbi <balbi@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 10月, 2015 1 次提交
-
-
由 Vignesh R 提交于
Currently word completion interrupt is fired for transfer of every word(8bit to 128bit in size). This adds a lot of overhead, and decreases r/w throughput. It hardly takes 3us(@48MHz) for 128bit r/w to complete, hence its better to poll on word complete bit to be set in QSPI_SPI_STATUS_REG instead of using interrupts. This increases the throughput by 30% in both read and write case. So, switch to polling mode instead of interrupts to determine completion of word transfer. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 13 10月, 2015 1 次提交
-
-
由 Vignesh R 提交于
Writing invalid command to QSPI_SPI_CMD_REG will terminate current transfer and de-assert the chip select. This has to be done before calling spi_finalize_current_message(). Because spi_finalize_current_message() will mark the end of current message transfer and schedule the next transfer. If the chipselect is not de-asserted before calling spi_finalize_current_message() then the next transfer will overlap with the previous transfer leading to data corruption. __spi_pump_message() can be called either from kthread worker context or directly from the calling process's context. It is possible that these two calls can race against each other. But race is serialized by checking whether master->cur_msg == NULL (pointer to msg being handled by transfer_one() at present). The master->cur_msg is set to NULL when spi_finalize_current_message() is called on that message, which means calling spi_finalize_current_message() allows __spi_sync() to pump next message in calling process context. Now if spi-ti-qspi calls spi_finalize_current_message() before we terminate transfer at hardware side, if __spi_pump_message() is called from process context then the successive transactions can overlap. Fix this by moving writing invalid command to QSPI_SPI_CMD_REG to before calling spi_finalize_current_message() call. Cc: stable@vger.kernel.org # v3.12+ Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 8月, 2015 1 次提交
-
-
由 Vignesh R 提交于
TI QSPI has four 32 bit data regsiters which can be used to transfer 16 bytes of data at once. The register group QSPI_SPI_DATA_REG_3, QSPI_SPI_DATA_REG_2, QSPI_SPI_DATA_REG_1 and QSPI_SPI_DATA_REG is treated as a single 128-bit word for shifting data in and out. The bit at QSPI_SPI_DATA_REG_3[31] position is the first bit to be shifted out in case of 128 bit transfer mode. Therefore the first byte to be written to flash should be at QSPI_SPI_DATA_REG_3[31-25] position. Instead of writing 1 byte at a time when interacting with spi-nor flash, make use of all the four registers so that 16 bytes can be transferred in one go. This reduces number of register writes and Word Complete interrupts for a given transfer message size, thereby increasing the write performance. Without this patch the raw flash write speed is ~100KB/s, with this patch the write speed increases to ~400 kB/s on DRA74 EVM. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 21 2月, 2015 1 次提交
-
-
由 Mugunthan V N 提交于
Data corruption is seen while reading/writing large data from/to qspi device because the data register is over written or read before data is ready which is denoted by busy bit in status register. SO adding a busy bit check before writing/reading data to/from qspi device. Signed-off-by: NMugunthan V N <mugunthanvnm@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 06 2月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
return type of wait_for_completion_timeout is unsigned long not int, this patch uses the return value of wait_for_completion_timeout in the condition directly rather than assigning it to an incorrect type variable. Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 20 10月, 2014 1 次提交
-
-
由 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>
-
- 10 3月, 2014 1 次提交
-
-
由 Sourav Poddar 提交于
mmap resource requirement is only for memory mapped operations. If the user does not populate mmap resource, dont call return, instead we go on for normal spi mode operations. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 16 2月, 2014 1 次提交
-
-
由 Axel Lin 提交于
The purpose of commit 1e8a52e1 "spi: By default setup spi_masters with 1 chipselect and dynamics bus number" is to avoid setting default value for bus_num and num_chipselect in spi master drivers. So let's remove the duplicate code. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-By: NDavid Daney <david.daney@cavium.com> Acked-by: NStephen Warren <swarren@nvidia.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 07 2月, 2014 1 次提交
-
-
由 Axel Lin 提交于
Signed-off-by: NAxel Lin <axel.lin@ingics.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 13 1月, 2014 2 次提交
-
-
由 Axel Lin 提交于
The driver name in current code looks like a compatible string which is not the naming convention for platform drivers. Fix it and also add modalias since this driver can be built as a module. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Acked-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Axel Lin 提交于
Make the unit of wlen to be byte, and simplify the code to avoid duplicate code for different wlen cases. Signed-off-by: NAxel Lin <axel.lin@ingics.com> Acked-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 07 1月, 2014 1 次提交
-
-
由 Axel Lin 提交于
Now platform_get_drvdata() returns the address of qspi rather than master. Also drop unneeded spi_unregister_master() call in ti_qspi_remove() because we use devm_spi_register_master() in probe. commit cbcabb7a "spi/qspi: Fix qspi remove path" assumes platform_get_drvdata() returns address of master. However, commit 160a0613 "spi/qspi: set correct platform drvdata in ti_qspi_probe()" pass qspi to platform_set_drvdata(). Signed-off-by: NAxel Lin <axel.lin@ingics.com> Reviewed-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 31 12月, 2013 1 次提交
-
-
由 Sourav Poddar 提交于
Due to the following commit commit 160a0613 Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Date: Mon Nov 11 14:13:41 2013 +0800 spi/qspi: set correct platform drvdata in ti_qspi_probe() The ti_qspi_remove() use the platform drvdata as a type of struct ti_qspi, we should pass correct platform drvdata to platform_set_drvdata() in ti_qspi_probe(). Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NMark Brown <broonie@linaro.org> platform_set_drvdata was changed in the probe, so we need to correspondingly change deferencing of qspi in runtime resume path. Else, this will lead to a NULL dereference pointer. Based on v3.13-rc3 Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 19 12月, 2013 1 次提交
-
-
由 Sourav Poddar 提交于
Modify the qspi driver to parse reg information by name. If "reg names" is not found, then revert back to normal get resource. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 24 11月, 2013 3 次提交
-
-
由 Sourav Poddar 提交于
There is a bug in qspi removal path, as a result of which qspi cannot be removed when used as a module. The patch solves the bug and qspi can be removed cleanly. The bugs fixed are: -pm_runtime used around register access. - pm_runtime_disable need to be done before removal. - spi_unregister_master need to be called to unregister the spi device. Tested on DRA7 board. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Sourav Poddar 提交于
clean up pm_runtime error check in accordance with rest of the check in the driver. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Wei Yongjun 提交于
The ti_qspi_remove() use the platform drvdata as a type of struct ti_qspi, we should pass correct platform drvdata to platform_set_drvdata() in ti_qspi_probe(). Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 07 10月, 2013 1 次提交
-
-
The here used irq and threaded irq handler is a complete non-sense. After the status register is read and the source disabled it schedules a thread (the irq thread) to read the status from the variable, invoke complete() and then renable the interrupt. Again: schedule a thread which invokes _only_ complete(). This patch removes this non-sense and we remain with one handler which invokes complete() if needed. The device remove path should now disable the interupts. This has been compile time tested. Signed-off-by: NSebastian Andrzej Siewior <bigeasy@linutronix.de> Tested-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 26 9月, 2013 2 次提交
-
-
由 Sourav Poddar 提交于
Add dual/quad read mode bit flag for the master controller. These check will be used in the spi framework to determine whether the master controller can do dual/quad read respectively. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Jingoo Han 提交于
Use devm_spi_register_master() to make cleanup paths simpler, and remove unnecessary remove(). Signed-off-by: NJingoo Han <jg1.han@samsung.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 01 9月, 2013 1 次提交
-
-
由 Wei Yongjun 提交于
Add the missing unlock before return from function ti_qspi_start_transfer_one() in the error handling case. Signed-off-by: NWei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: NMark Brown <broonie@linaro.org>
-
- 27 8月, 2013 2 次提交
-
-
由 Sourav Poddar 提交于
Add a compatible string for am4372. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-
由 Sourav Poddar 提交于
Fix module device table entry. Without this, there will be a build failure while trying to build qspi as a module. Signed-off-by: NSourav Poddar <sourav.poddar@ti.com> Signed-off-by: NMark Brown <broonie@linaro.org>
-