[PATCH 1/3] spi/qspi: Add memory mapped read support.
sourav.poddar at ti.com
Fri Oct 18 00:27:51 PDT 2013
On Friday 18 October 2013 11:40 AM, Sourav Poddar wrote:
> On Friday 18 October 2013 11:26 AM, Trent Piepho wrote:
>> On Thu, Oct 17, 2013 at 9:06 PM, Sourav Poddar<sourav.poddar at ti.com>
>>> On Friday 18 October 2013 05:12 AM, Mark Brown wrote:
>>>>> Are you looking for comparison between read_via_dma() v/s memcpy() ?
>>>> No, I'm looking for a comparison of normal SPI mode (which I'd have
>>>> expected to DMA) and the memcpy() mode.
>>>>> If yes, then unfortunately we are bit constrained because our
>>>>> does not support DMA. So, we have to depend on CPU based memcpy()
>>>>> only. However, use of DMA can be added as an independent patch on
>>>>> top of this CASE-2 patch.
>>>> However if the controller can't DMA at all then that's not going to be
>>>> possible... am I understanding you correctly that normal SPI can't
>>> Yes, you are correct, the normal SPI cant DMA.
>> Hardware limitation or driver limitation? Adding DMA support to the
>> driver might be much more useful than adding memory mapped read
> Its a hardware limitation, the qspi controller does not support DMA.
> Linux MTD discussion mailing list
So, consolidating all the comments, this is what can be done to improve the
1. Keep the qspi controller by default in memory mapped mode.
2. While doing operations other than memory mapped, change the
controller into config mode and at the end change it into memory mapped
3. For filling memory mapped register in qspi controller, we can pass
from dt rather than hardcoding as macros.
4. For memory mapped read, do the memcpy in the mtd_read itself and
This has two points to be considered -
To get the mem buf from the spi controller to mtd layer
As suggested by Mark, we can define some apis like
get_buf/free_buf in mtd driver and use that to get the
Runtime clock management is handle by SPI framework, so while
doing memory read, where we bypass SPI framework, clocks will be
disable and we will get an abort while doing memcpy.
As suggested by Trent, we can keep the SPI controller clocks
always ON ?
If the above proposal looks good, should I go ahead and post the next
More information about the linux-mtd