[PATCH] map-ram chip driver: 16-bit block transfer
Arnd Bergmann
arnd at arndb.de
Fri Aug 11 12:41:10 PDT 2017
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?
Arnd
More information about the linux-mtd
mailing list