From: Bill Pringlemeir <bpringlemeir@nbsps.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 3/4] mtd: nand: add Freescale vf610_nfc driver
Date: Thu, 21 Aug 2014 17:15:41 -0400 [thread overview]
Message-ID: <87mwax7ddu.fsf@nbsps.com> (raw)
In-Reply-To: 691c46b58b8a4416070323238fde73cf@agner.ch
>>>>> On 14 Aug 2014, stefan at agner.ch wrote:
>>>>> This adds initial support for Freescale NFC (NAND Flash
>>>>> Controller) found in ARM Vybrid SoC's, Power Architecture MPC5125
>>>>> and others. However, this driver is only tested on Vybrid.
>>> On Wed, 2014-08-13 at 22:32, Scott Wood wrote:
>>>> raw_writel() is itself something that should only be used for
>>>> hand-optimized sections. For non-performance-critical code you
>>>> should use normal writel() so that you don't need to worry about
>>>> manually adding I/O barriers.
>>> Am 2014-08-14 23:12, schrieb Bill Pringlemeir:
[regarding memcpy() in the driver]
>>>> Maybe a comment is fine? It seems the Vybrid is safe for
>>>> different access sizes, but it is possible that some other CPU
>>>> might not be able to access this memory via 32/16/8 bit accesses
>>>> and 'memcpy()' may not be appropriate. It seems that 'natural'
>>>> size of the NFC controller itself is 32bits and the CPU interface
>>>> does lane masking. Ie, boot mode documentation talks about
>>>> remapping 'sram_physical_addr[13:3] =
>>>> {cpu_addr[11:3],cpu_addr[13:12]}' saying that bits 2,1 are not used
>>>> (hopefully one based numbers). This is just my guess...
>> On 18 Aug 2014, stefan at agner.ch wrote:
>>> What assumptions do you make how memcpy accesses memory? This latest
>>> patch now uses the optimized versions from the kernel... Maybe they
>>> even try to access 64-bit width (the NIC interconnect supports
>>> 64-bit access)
[snip]
> Am 2014-08-18 18:38, schrieb Bill Pringlemeir:
>> My only point is that the SRAM buffers use the same interface as the
>> main Nand controller register banks. So using 'readl/writel' for the
>> register, but not the SRAM buffers seems inconsistent.
>> So to address this inconsistency, I was thinking that we should at
>> least have a comment?
On 19 Aug 2014, stefan at agner.ch wrote:
> IMHO, we just treat this as if its memory and I guess this is fine for
> a buffer. memcpy knows how to copy data, and takes care if the
> architecture needs aligned access when reading 32-bit width, or
> similar requirements. We do not know whether memcpy really uses 32-bit
> accesses, hence this comment might even be wrong. In a short test, I
> could also access the buffer in byte/word length (tested using
> md.b/md.w).
> Also, I assume this just works for a different architecture too. If
> not, the one using this driver the first time on a different
> architecture would see this pretty quickly I guess :-)
[snip]
> In our case, a barrier just after the memcpy would be sufficient.
I would suggest you make a 'vf610_nfc_memcpy()' [or even from/to
variants if you are pendantic] which can be a wrapper function of just
'memcpy'. Just the like the readl/writel wrappers this will collect the
BUS accesses into one place. So they are documented for people porting
the code. Trying to accommodate some future insane hardware hookup seems
futile beyond this?
Otherwise, I will add an 'Ack' or 'Reviewed-By' from me if you like. I
am sorry, I don't know what if anything is appropriate.
Thanks,
Bill Pringlemeir.
next prev parent reply other threads:[~2014-08-21 21:15 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-14 16:30 [U-Boot] [PATCH v2 0/4] arm: vf610: add NAND flash support Stefan Agner
2014-08-14 16:30 ` [U-Boot] [PATCH v2 1/4] arm: vf610: add NFC pin mux Stefan Agner
2014-08-14 16:30 ` [U-Boot] [PATCH v2 2/4] arm: vf610: add NFC clock support Stefan Agner
2014-08-14 16:30 ` [U-Boot] [PATCH v2 3/4] mtd: nand: add Freescale NFC driver Stefan Agner
2014-08-14 18:34 ` Bill Pringlemeir
2014-08-14 19:49 ` Scott Wood
2014-08-14 21:12 ` Bill Pringlemeir
2014-08-18 9:41 ` Stefan Agner
2014-08-18 16:38 ` Bill Pringlemeir
2014-08-19 17:00 ` Stefan Agner
2014-08-21 21:15 ` Bill Pringlemeir [this message]
2014-09-11 9:37 ` [U-Boot] [PATCH v3 3/4] mtd: nand: add Freescale vf610_nfc driver Stefano Babic
2014-08-14 16:30 ` [U-Boot] [PATCH v2 4/4] arm: vf610: add NAND support for vf610twr Stefan Agner
-- strict thread matches above, loose matches on Subject: below --
2014-08-18 16:26 [U-Boot] [PATCH v3 0/4] arm: vf610: add NAND flash support Stefan Agner
2014-08-18 16:26 ` [U-Boot] [PATCH v3 3/4] mtd: nand: add Freescale vf610_nfc driver Stefan Agner
2014-09-06 17:21 ` Stefan Agner
2014-09-11 9:36 ` Stefano Babic
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=87mwax7ddu.fsf@nbsps.com \
--to=bpringlemeir@nbsps.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox