From: Peter Tyser <ptyser@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/4 V2] Add basic NVIDIA Tegra2 SoC support
Date: Fri, 14 Jan 2011 17:23:26 -0600 [thread overview]
Message-ID: <1295047406.29642.6729.camel@petert> (raw)
In-Reply-To: <4D30D59B.3000102@free.fr>
On Sat, 2011-01-15 at 00:00 +0100, Albert ARIBAUD wrote:
> Hello,
>
> Le 14/01/2011 23:39, Tom Warren a ?crit :
>
> > So instead of, say uart->lcr = 0, you'd prefer writel(0, uart->lcr),
> > where writel = __arch_putl(v, a) = (*(volatile unsigned int *)(a) =
> > (v))?
> > Is that different enough from 'uart->lcr = 0' to warrant the change?
> > Does it add some HW barriers or forced read-before-write that the
> > 'volatile' struct doesn't?
>
> writel() and readl() do not introduce "read-before-write", that is, they
> do not perform any more than what their names imply, but yes they do
> introduce barriers, or more precisely, they force the compiler to do so.
Agreed, I should have dug deeper. On PPC we use out_be32() or similar
to access memory mapped registers, which does have an explicit barrier.
I'm not familiar with ARM so don't know what the proper access functions
are, but it looks like the defacto standard writel()/readl().
I'd personally use writel()/readl() in this patch. Functionally it may
be the same as your volatile accesses, but its the generally recommended
practice. It looks like most of the Tegra support in the Linux kernel
also uses writel()/readl() for what its worth. Ultimately its up to the
ARM U-Boot maintainer to decide if they require the access functions or
not - I'm just giving my opinions from PPC experience.
Regards,
Peter
next prev parent reply other threads:[~2011-01-14 23:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-14 17:11 [U-Boot] [PATCH 0/4 V2] Add basic NVIDIA Tegra2 SoC support Tom Warren
2011-01-14 17:11 ` [U-Boot] [PATCH 1/4 V2] arm: Tegra2: " Tom Warren
2011-01-14 17:11 ` [U-Boot] [PATCH 2/4 V2] serial: Add Tegra2 serial port support Tom Warren
2011-01-14 17:11 ` [U-Boot] [PATCH 3/4 V2] arm: Tegra2: Add support for NVIDIA Harmony board Tom Warren
2011-01-14 17:11 ` [U-Boot] [PATCH 4/4 V2] arm: Tegra2: Add support for NVIDIA Seaboard board Tom Warren
2011-01-14 19:59 ` [U-Boot] [PATCH 0/4 V2] Add basic NVIDIA Tegra2 SoC support Peter Tyser
2011-01-14 20:41 ` Tom Warren
2011-01-14 21:36 ` Peter Tyser
2011-01-14 22:39 ` Tom Warren
2011-01-14 23:00 ` Albert ARIBAUD
2011-01-14 23:23 ` Peter Tyser [this message]
2011-01-15 0:01 ` Wolfgang Denk
2011-01-17 23:27 ` Wolfgang Denk
2011-01-17 23:27 ` Wolfgang Denk
2011-01-19 21:23 ` Tom Warren
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=1295047406.29642.6729.camel@petert \
--to=ptyser@xes-inc.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