[PATCH] map-ram chip driver: 16-bit block transfer

Sanjay Tandel sanjay.tandel at rockwellcollins.com
Fri Aug 11 14:03:32 PDT 2017


On Fri, Aug 11, 2017 at 2:41 PM, Arnd Bergmann <arnd at arndb.de> wrote:
> On Fri, Aug 11, 2017 at 6:50 PM, Sanjay Tandel
> <sanjay.tandel at rockwellcollins.com> wrote:
>> On Wed, Aug 9, 2017 at 1:10 PM, Boris Brezillon
>> <boris.brezillon at free-electrons.com> wrote:
>>> Le Fri,  4 Aug 2017 08:02:20 -0500,
>>> Matt Weber <matthew.weber at rockwellcollins.com> a écrit :
>>>
>>>> From: sgtandel <sanjay.tandel at rockwellcollins.com>
>>>>
>>>> This patch adds 16-bit I/O memory write function (map_copy_to16) in map-ram
>>>> driver. map-ram driver's block write function(i.e map_copy_to) uses
>>>> memcpy_toio() function for block transfer. memcpy_toio() is limited to do
>>>> single byte write, irrespective of bankwidth.
>>>
>>> That's not true. Depending on the platform (+ config options)
>>> memcpy_to/fromio() can be a simple redirection to memcpy, and
>>> memcpy is likely to be optimized to do 32bit or 64bit accesses when
>>> possible (IOW, when alignment allows it).
>>>
>> Agree with you on memcpy_toio/_fromio.
>> but map-ram driver's map_copy_to/map_copy_from aren't based on bank-width
>> provided for specific chip.It relies on memcpy_toio, which is dependent on arch,
>> alignment and size.For example - like in our case of accessing 16-bit
>> flash, despite
>> of chip's bank-width being 16-bit, map_copy_to ends up accessing 8-bit using
>> memcpy_toio, because memcpy_toio for ARM arch always does 8-bit accesses.
>
> On almost all ARM platforms, it would use 32-bit accesses these days. On what
> kernel version, ARM platform and endianess do you see memcpy_toio() use 8-bit
> access?
>

We use version 4.1.8 with Freescale LS1021A( cortex-a7 core, little-endian).
With the newer versions of kernel also, I can see same 8-bit
implementation for 32-bit ARM arch.

BTW, for other arch also memcpy_toio()  uses combination of  32-bit(or
64-bit) and 8-bit accesses,
which may not work here.Because we need all accesses to be of same
size(bank-width).


>        Arnd



More information about the linux-mtd mailing list