[U-Boot] [PATCH v2 2/9] sunxi: initial sun7i pinmux and gpio support

Wolfgang Denk wd at denx.de
Wed Mar 26 10:01:37 CET 2014


Dear Ian,

[Cc: list truncated / changed]

In message <1395822638.29683.9.camel at dagon.hellion.org.uk> you wrote:
>
> I looked at this transform in a few different contexts and one concern I
> had was that readl and writel have barriers in them (after the read and
> before the write respectively) while clrsetbits and friends do not. I

They are supposed to.  They map to the out_##type() / in_##type()
standard I/O accessors which are supposed to be suitable to access
device registers.

I can see that the ARM implementation maps this to __raw_write##type()
/ __raw_read##type() and then to __arch_put##type() /
__arch_get##type() which indeed do not include MBs.

> But I think I am probably being overly cautious here and the obvious
> transformation can be made. Anyone got any thoughts?

I'm not an expert for ARM, but this indeed looks suspiscious - thanks
for reporting this.

It is conspicuous that Linux does not use out_##type() / in_##type()
for ARM, and instead uses iowrite##type() / ioread##type() - which do
include MBs.

Albert - what do you think?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Drun'? 'm not drun'! You woudn' dare call m' drun' if I was sober!
                                     - Terry Pratchett, _Men at Arms_


More information about the U-Boot mailing list