summaryrefslogtreecommitdiff
path: root/arch/arm/include/asm/armv7.h
diff options
context:
space:
mode:
authorAndre Przywara <andre.przywara@arm.com>2016-05-12 11:14:41 (GMT)
committerTom Rini <trini@konsulko.com>2016-05-12 15:13:03 (GMT)
commit1ea4fac5a34604e67504ee6537bb01e809528cd4 (patch)
treea00ff7f5f48cc255bdea84ba7a4181a0feb1b622 /arch/arm/include/asm/armv7.h
parent4baca92001bff3c32a05001a7dc58996623e3ef8 (diff)
downloadu-boot-fsl-qoriq-1ea4fac5a34604e67504ee6537bb01e809528cd4.tar.xz
arm/arm64: Move barrier instructions into separate header
Commit bfb33f0bc45b ("sunxi: mctl_mem_matches: Add missing memory barrier") broke compilation for the Pine64, as dram_helper.c now includes <asm/armv7.h>, which does not compile on arm64. Fix this by moving all barrier instructions into a separate header file, which can easily be shared between arm and arm64. Also extend the inline assembly to take the "sy" argument, which is optional for ARMv7, but mandatory for v8. This fixes compilation for 64-bit sunxi boards (Pine64). Acked-by: Ian Campbell <ijc@hellion.org.uk> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'arch/arm/include/asm/armv7.h')
-rw-r--r--arch/arm/include/asm/armv7.h21
1 files changed, 1 insertions, 20 deletions
diff --git a/arch/arm/include/asm/armv7.h b/arch/arm/include/asm/armv7.h
index 30e7939..423fc70 100644
--- a/arch/arm/include/asm/armv7.h
+++ b/arch/arm/include/asm/armv7.h
@@ -59,26 +59,7 @@
#ifndef __ASSEMBLY__
#include <linux/types.h>
#include <asm/io.h>
-
-/*
- * CP15 Barrier instructions
- * Please note that we have separate barrier instructions in ARMv7
- * However, we use the CP15 based instructtions because we use
- * -march=armv5 in U-Boot
- */
-#define CP15ISB asm volatile ("mcr p15, 0, %0, c7, c5, 4" : : "r" (0))
-#define CP15DSB asm volatile ("mcr p15, 0, %0, c7, c10, 4" : : "r" (0))
-#define CP15DMB asm volatile ("mcr p15, 0, %0, c7, c10, 5" : : "r" (0))
-
-#ifdef __ARM_ARCH_7A__
-#define ISB asm volatile ("isb" : : : "memory")
-#define DSB asm volatile ("dsb" : : : "memory")
-#define DMB asm volatile ("dmb" : : : "memory")
-#else
-#define ISB CP15ISB
-#define DSB CP15DSB
-#define DMB CP15DMB
-#endif
+#include <asm/barriers.h>
/*
* Workaround for ARM errata # 798870