]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
arm: mmu: Add missing volatile for reading SCTLR register
authorAlison Wang <b18965@freescale.com>
Wed, 9 Sep 2015 02:22:02 +0000 (10:22 +0800)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 16 Oct 2015 05:55:51 +0000 (07:55 +0200)
Add 'volatile' qualifier to the asm statement in get_cr()
so that the statement is not optimized out by the compiler.

(http://comments.gmane.org/gmane.linux.linaro.toolchain/5163)

Without the 'volatile', get_cr() returns a wrong value which
prevents enabling the MMU  and later causes a PCIE VA access
failure.

Signed-off-by: Alison Wang <alison.wang@freescale.com>
arch/arm/include/asm/system.h

index 868ea54b4fef2c2d9d9819a986ca58f5e9c7800b..cfc7834ed9dd012b8550a358babddc7f991e9666 100644 (file)
@@ -194,7 +194,7 @@ void save_boot_params_ret(void);
 static inline unsigned int get_cr(void)
 {
        unsigned int val;
-       asm("mrc p15, 0, %0, c1, c0, 0  @ get CR" : "=r" (val) : : "cc");
+       asm volatile("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc");
        return val;
 }