summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/system.h
diff options
context:
space:
mode:
authorAlison Wang <b18965@freescale.com>2015-09-09 10:22:02 +0800
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2015-10-16 07:55:51 +0200
commit53fd4b8c22bbdf4598f87e701e9a6c6ee50172ff (patch)
tree24d8f51da79a8a92ad533fb87122756ba78d4d3b /arch/arm/include/asm/system.h
parent1275456d31cc130738775dca19b0a2ab1374cfbd (diff)
downloadtalos-obmc-uboot-53fd4b8c22bbdf4598f87e701e9a6c6ee50172ff.tar.gz
talos-obmc-uboot-53fd4b8c22bbdf4598f87e701e9a6c6ee50172ff.zip
arm: mmu: Add missing volatile for reading SCTLR register
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>
Diffstat (limited to 'arch/arm/include/asm/system.h')
-rw-r--r--arch/arm/include/asm/system.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h
index 868ea54b4f..cfc7834ed9 100644
--- a/arch/arm/include/asm/system.h
+++ b/arch/arm/include/asm/system.h
@@ -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;
}
OpenPOWER on IntegriCloud