[U-Boot] [RFC PATCH v2] ARM: Avoid compiler optimization for usages of readb, writeb and friends.

Wolfgang Denk
2010-12-22T08:02:06Z

Dear Alexander Holler,

In message <1292711230-3234-1-git-send-email-holler@ahsoftware.de> you wrote:
> gcc 4.5.1 seems to ignore (at least some) volatile definitions,
> avoid that as done in the kernel.
...
> +#define writeb(v,c) ({ __iowmb(); __arch_putb(v,c); })
> +#define writew(v,c) ({ __iowmb(); __arch_putw(v,c); })
> +#define writel(v,c) ({ __iowmb(); __arch_putl(v,c); })

http://www.codesourcery.com/archives/arm-gnu/msg03990.html explains
why this construct is causing errors in cases where an additional read
from the address is unsupported.

Can you please try the following patch instead?

-------------------------------------------------------------------------