From: Thomas Chou <thomas@wytron.com.tw>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] mtd: add altera quadspi driver
Date: Thu, 5 Nov 2015 12:26:25 +0800 [thread overview]
Message-ID: <563ADA71.9030007@wytron.com.tw> (raw)
In-Reply-To: <1446692747.2088.11.camel@clsee-VirtualBox>
HI Chin Liang,
On 2015?11?05? 11:05, Chin Liang See wrote:
>>>>> I notice you are writing in word style which might have concern in
>>>>> performance. As the burst count can go up to 64, we can write larger
>>>>> data through memcpy. This will avoid redundancy of data header (opcode
>>>>> + address + dummy).
>>>>
>>>> You cannot do that, memcpy works on memory while write*() operators work
>>>> on I/O. You should use readsl() and friends then.
>>>
>>> Actually I am thinking to take advantage the cache fill and dump. But
>>> after rethinking, this might limit some of the use case as we want the
>>> driver to support NIOS II without cache. With that, just ignore this
>>> comment for now.
>>
>> I'm not sure I want to ask for details here. I think we're reading data from
>> some sort of IO device, so we should just use readl() or readsl() to read
>> them out (and write*() for the other direction). I don't think cache operations
>> can be involved in any way. Correct me if I'm wrong please.
>>
>
> Sure, I can share more. Since the read can support up to burst of 64
> byte, we can use the a cache fill method which eventually trigger a read
> of 32 byte (which is size of a cache line) to the Quad SPI controller.
> To ensure we don't read from old data, we need to invalidate that cache
> line (through address). By doing this, we can gain better performance as
> we are reading 32 bytes of data instead 4 per transaction.
>
>>> But your comment lead to the fact that the read part is now using
>>> memcpy. Thomas needs to fix that to use the readl :)
>>
>> Uhm, I don't think I understand this remark, sorry. I never suggested to use
>> memcpy() in this entire thread, did I ?
>
>
> Nope, but this trigger me that we need to do the same for read. The
> memcpy might lead to the driver reading old data that stay on cache
> instead from controller. Another way to get rid of this is invalidate
> the cache.
Thank for the reminding about the read part. I should not use memcpy()
indeed.
Maybe we could pull the memcpy_fromio() and memcpy_toio() or the
asm-generic/io.h from Linux kernel?
For i/o access, we bypass the cache for u-boot nios2 with ioremap() or
map_physaddr(uncached). So no worries or advantage about cache.
Best regards,
Thomas
next prev parent reply other threads:[~2015-11-05 4:26 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-03 13:22 [U-Boot] [PATCH] mtd: add altera quadspi driver Thomas Chou
2015-11-03 17:44 ` Marek Vasut
2015-11-03 17:49 ` Jagan Teki
2015-11-03 17:52 ` Marek Vasut
2015-11-03 17:56 ` Jagan Teki
2015-11-03 18:11 ` Marek Vasut
2015-11-04 2:36 ` Thomas Chou
2015-11-04 3:45 ` Marek Vasut
2015-11-04 4:45 ` Thomas Chou
2015-11-04 5:15 ` Marek Vasut
2015-11-04 5:33 ` Thomas Chou
2015-11-04 14:02 ` Marek Vasut
2015-11-04 15:56 ` Chin Liang See
2015-11-04 16:18 ` Marek Vasut
2015-11-05 2:49 ` Chin Liang See
2015-11-05 2:53 ` Marek Vasut
2015-11-05 3:05 ` Chin Liang See
2015-11-05 4:26 ` Thomas Chou [this message]
2015-11-05 4:36 ` Marek Vasut
2015-11-05 8:47 ` [U-Boot] [PATCH v2 1/2] nios2: add memcpy_fromio and memcpy_toio Thomas Chou
2015-11-05 8:47 ` [U-Boot] [PATCH v2 2/2] mtd: add altera quadspi driver Thomas Chou
2015-11-05 14:25 ` Jagan Teki
2015-11-05 14:45 ` Thomas Chou
2015-11-05 14:57 ` Jagan Teki
2015-11-05 15:51 ` Marek Vasut
2015-11-06 8:11 ` Jagan Teki
2015-11-06 13:45 ` Marek Vasut
2015-11-06 0:18 ` Thomas Chou
2015-11-06 8:07 ` Jagan Teki
2015-11-06 9:28 ` Thomas Chou
2015-11-06 9:52 ` Jagan Teki
2015-11-06 11:48 ` Jagan Teki
2015-11-06 13:32 ` Thomas Chou
2015-11-07 8:07 ` [U-Boot] [PATCH v3] " Thomas Chou
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=563ADA71.9030007@wytron.com.tw \
--to=thomas@wytron.com.tw \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.