Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: move CP15 definitions to separate header file

Avoid namespace conflicts with drivers over the CP15 definitions by
moving CP15 related prototypes and definitions to a private header
file.

Acked-by: Stephen Warren <swarren@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com> [Tegra]
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com> [EP93xx]
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Kukjin Kim <kgene.kim@samsung.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>

authored by

Russell King and committed by
David Howells
15d07dc9 ec221208

+103 -84
+87
arch/arm/include/asm/cp15.h
··· 1 + #ifndef __ASM_ARM_CP15_H 2 + #define __ASM_ARM_CP15_H 3 + 4 + #include <asm/system.h> 5 + 6 + /* 7 + * CR1 bits (CP#15 CR1) 8 + */ 9 + #define CR_M (1 << 0) /* MMU enable */ 10 + #define CR_A (1 << 1) /* Alignment abort enable */ 11 + #define CR_C (1 << 2) /* Dcache enable */ 12 + #define CR_W (1 << 3) /* Write buffer enable */ 13 + #define CR_P (1 << 4) /* 32-bit exception handler */ 14 + #define CR_D (1 << 5) /* 32-bit data address range */ 15 + #define CR_L (1 << 6) /* Implementation defined */ 16 + #define CR_B (1 << 7) /* Big endian */ 17 + #define CR_S (1 << 8) /* System MMU protection */ 18 + #define CR_R (1 << 9) /* ROM MMU protection */ 19 + #define CR_F (1 << 10) /* Implementation defined */ 20 + #define CR_Z (1 << 11) /* Implementation defined */ 21 + #define CR_I (1 << 12) /* Icache enable */ 22 + #define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */ 23 + #define CR_RR (1 << 14) /* Round Robin cache replacement */ 24 + #define CR_L4 (1 << 15) /* LDR pc can set T bit */ 25 + #define CR_DT (1 << 16) 26 + #define CR_IT (1 << 18) 27 + #define CR_ST (1 << 19) 28 + #define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */ 29 + #define CR_U (1 << 22) /* Unaligned access operation */ 30 + #define CR_XP (1 << 23) /* Extended page tables */ 31 + #define CR_VE (1 << 24) /* Vectored interrupts */ 32 + #define CR_EE (1 << 25) /* Exception (Big) Endian */ 33 + #define CR_TRE (1 << 28) /* TEX remap enable */ 34 + #define CR_AFE (1 << 29) /* Access flag enable */ 35 + #define CR_TE (1 << 30) /* Thumb exception enable */ 36 + 37 + #ifndef __ASSEMBLY__ 38 + 39 + #if __LINUX_ARM_ARCH__ >= 4 40 + #define vectors_high() (cr_alignment & CR_V) 41 + #else 42 + #define vectors_high() (0) 43 + #endif 44 + 45 + extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 46 + extern unsigned long cr_alignment; /* defined in entry-armv.S */ 47 + 48 + static inline unsigned int get_cr(void) 49 + { 50 + unsigned int val; 51 + asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc"); 52 + return val; 53 + } 54 + 55 + static inline void set_cr(unsigned int val) 56 + { 57 + asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" 58 + : : "r" (val) : "cc"); 59 + isb(); 60 + } 61 + 62 + #ifndef CONFIG_SMP 63 + extern void adjust_cr(unsigned long mask, unsigned long set); 64 + #endif 65 + 66 + #define CPACC_FULL(n) (3 << (n * 2)) 67 + #define CPACC_SVC(n) (1 << (n * 2)) 68 + #define CPACC_DISABLE(n) (0 << (n * 2)) 69 + 70 + static inline unsigned int get_copro_access(void) 71 + { 72 + unsigned int val; 73 + asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access" 74 + : "=r" (val) : : "cc"); 75 + return val; 76 + } 77 + 78 + static inline void set_copro_access(unsigned int val) 79 + { 80 + asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access" 81 + : : "r" (val) : "cc"); 82 + isb(); 83 + } 84 + 85 + #endif 86 + 87 + #endif
-77
arch/arm/include/asm/system.h
··· 15 15 #define CPU_ARCH_ARMv7 9 16 16 17 17 /* 18 - * CR1 bits (CP#15 CR1) 19 - */ 20 - #define CR_M (1 << 0) /* MMU enable */ 21 - #define CR_A (1 << 1) /* Alignment abort enable */ 22 - #define CR_C (1 << 2) /* Dcache enable */ 23 - #define CR_W (1 << 3) /* Write buffer enable */ 24 - #define CR_P (1 << 4) /* 32-bit exception handler */ 25 - #define CR_D (1 << 5) /* 32-bit data address range */ 26 - #define CR_L (1 << 6) /* Implementation defined */ 27 - #define CR_B (1 << 7) /* Big endian */ 28 - #define CR_S (1 << 8) /* System MMU protection */ 29 - #define CR_R (1 << 9) /* ROM MMU protection */ 30 - #define CR_F (1 << 10) /* Implementation defined */ 31 - #define CR_Z (1 << 11) /* Implementation defined */ 32 - #define CR_I (1 << 12) /* Icache enable */ 33 - #define CR_V (1 << 13) /* Vectors relocated to 0xffff0000 */ 34 - #define CR_RR (1 << 14) /* Round Robin cache replacement */ 35 - #define CR_L4 (1 << 15) /* LDR pc can set T bit */ 36 - #define CR_DT (1 << 16) 37 - #define CR_IT (1 << 18) 38 - #define CR_ST (1 << 19) 39 - #define CR_FI (1 << 21) /* Fast interrupt (lower latency mode) */ 40 - #define CR_U (1 << 22) /* Unaligned access operation */ 41 - #define CR_XP (1 << 23) /* Extended page tables */ 42 - #define CR_VE (1 << 24) /* Vectored interrupts */ 43 - #define CR_EE (1 << 25) /* Exception (Big) Endian */ 44 - #define CR_TRE (1 << 28) /* TEX remap enable */ 45 - #define CR_AFE (1 << 29) /* Access flag enable */ 46 - #define CR_TE (1 << 30) /* Thumb exception enable */ 47 - 48 - /* 49 18 * This is used to ensure the compiler did actually allocate the register we 50 19 * asked it for some inline assembly sequences. Apparently we can't trust 51 20 * the compiler from one version to another so a bit of paranoia won't hurt. ··· 88 119 89 120 extern unsigned int user_debug; 90 121 91 - #if __LINUX_ARM_ARCH__ >= 4 92 - #define vectors_high() (cr_alignment & CR_V) 93 - #else 94 - #define vectors_high() (0) 95 - #endif 96 - 97 122 #if __LINUX_ARM_ARCH__ >= 7 || \ 98 123 (__LINUX_ARM_ARCH__ == 6 && defined(CONFIG_CPU_32v6K)) 99 124 #define sev() __asm__ __volatile__ ("sev" : : : "memory") ··· 147 184 148 185 #define set_mb(var, value) do { var = value; smp_mb(); } while (0) 149 186 #define nop() __asm__ __volatile__("mov\tr0,r0\t@ nop\n\t"); 150 - 151 - extern unsigned long cr_no_alignment; /* defined in entry-armv.S */ 152 - extern unsigned long cr_alignment; /* defined in entry-armv.S */ 153 - 154 - static inline unsigned int get_cr(void) 155 - { 156 - unsigned int val; 157 - asm("mrc p15, 0, %0, c1, c0, 0 @ get CR" : "=r" (val) : : "cc"); 158 - return val; 159 - } 160 - 161 - static inline void set_cr(unsigned int val) 162 - { 163 - asm volatile("mcr p15, 0, %0, c1, c0, 0 @ set CR" 164 - : : "r" (val) : "cc"); 165 - isb(); 166 - } 167 - 168 - #ifndef CONFIG_SMP 169 - extern void adjust_cr(unsigned long mask, unsigned long set); 170 - #endif 171 - 172 - #define CPACC_FULL(n) (3 << (n * 2)) 173 - #define CPACC_SVC(n) (1 << (n * 2)) 174 - #define CPACC_DISABLE(n) (0 << (n * 2)) 175 - 176 - static inline unsigned int get_copro_access(void) 177 - { 178 - unsigned int val; 179 - asm("mrc p15, 0, %0, c1, c0, 2 @ get copro access" 180 - : "=r" (val) : : "cc"); 181 - return val; 182 - } 183 - 184 - static inline void set_copro_access(unsigned int val) 185 - { 186 - asm volatile("mcr p15, 0, %0, c1, c0, 2 @ set copro access" 187 - : : "r" (val) : "cc"); 188 - isb(); 189 - } 190 187 191 188 /* 192 189 * switch_mm() may do a full cache flush over the context switch,
+1 -1
arch/arm/kernel/fiq.c
··· 42 42 #include <linux/seq_file.h> 43 43 44 44 #include <asm/cacheflush.h> 45 + #include <asm/cp15.h> 45 46 #include <asm/fiq.h> 46 47 #include <asm/irq.h> 47 - #include <asm/system.h> 48 48 #include <asm/traps.h> 49 49 50 50 static unsigned long no_fiq_insn;
+1 -1
arch/arm/kernel/head-nommu.S
··· 17 17 #include <asm/assembler.h> 18 18 #include <asm/ptrace.h> 19 19 #include <asm/asm-offsets.h> 20 + #include <asm/cp15.h> 20 21 #include <asm/thread_info.h> 21 - #include <asm/system.h> 22 22 23 23 /* 24 24 * Kernel startup entry point.
+1 -1
arch/arm/kernel/head.S
··· 15 15 #include <linux/init.h> 16 16 17 17 #include <asm/assembler.h> 18 + #include <asm/cp15.h> 18 19 #include <asm/domain.h> 19 20 #include <asm/ptrace.h> 20 21 #include <asm/asm-offsets.h> 21 22 #include <asm/memory.h> 22 23 #include <asm/thread_info.h> 23 - #include <asm/system.h> 24 24 #include <asm/pgtable.h> 25 25 26 26 #ifdef CONFIG_DEBUG_LL
+1 -1
arch/arm/kernel/setup.c
··· 33 33 #include <linux/sort.h> 34 34 35 35 #include <asm/unified.h> 36 + #include <asm/cp15.h> 36 37 #include <asm/cpu.h> 37 38 #include <asm/cputype.h> 38 39 #include <asm/elf.h> ··· 45 44 #include <asm/cacheflush.h> 46 45 #include <asm/cachetype.h> 47 46 #include <asm/tlbflush.h> 48 - #include <asm/system.h> 49 47 50 48 #include <asm/prom.h> 51 49 #include <asm/mach/arch.h>
+1
arch/arm/mach-exynos/hotplug.c
··· 16 16 #include <linux/io.h> 17 17 18 18 #include <asm/cacheflush.h> 19 + #include <asm/cp15.h> 19 20 #include <asm/smp_plat.h> 20 21 21 22 #include <mach/regs-pmu.h>
+1
arch/arm/mach-realview/hotplug.c
··· 13 13 #include <linux/smp.h> 14 14 15 15 #include <asm/cacheflush.h> 16 + #include <asm/cp15.h> 16 17 #include <asm/smp_plat.h> 17 18 18 19 extern volatile int pen_release;
+1
arch/arm/mach-tegra/hotplug.c
··· 13 13 #include <linux/smp.h> 14 14 15 15 #include <asm/cacheflush.h> 16 + #include <asm/cp15.h> 16 17 17 18 static inline void cpu_enter_lowpower(void) 18 19 {
+1 -1
arch/arm/mach-vexpress/hotplug.c
··· 14 14 15 15 #include <asm/cacheflush.h> 16 16 #include <asm/smp_plat.h> 17 - #include <asm/system.h> 17 + #include <asm/cp15.h> 18 18 19 19 extern volatile int pen_release; 20 20
+1 -1
arch/arm/mm/alignment.c
··· 22 22 #include <linux/sched.h> 23 23 #include <linux/uaccess.h> 24 24 25 - #include <asm/system.h> 25 + #include <asm/cp15.h> 26 26 #include <asm/unaligned.h> 27 27 28 28 #include "fault.h"
+1
arch/arm/mm/cache-feroceon-l2.c
··· 15 15 #include <linux/init.h> 16 16 #include <linux/highmem.h> 17 17 #include <asm/cacheflush.h> 18 + #include <asm/cp15.h> 18 19 #include <plat/cache-feroceon-l2.h> 19 20 20 21 /*
+1
arch/arm/mm/cache-tauros2.c
··· 16 16 17 17 #include <linux/init.h> 18 18 #include <asm/cacheflush.h> 19 + #include <asm/cp15.h> 19 20 #include <asm/hardware/cache-tauros2.h> 20 21 21 22
+1 -1
arch/arm/mm/cache-xsc3l2.c
··· 18 18 */ 19 19 #include <linux/init.h> 20 20 #include <linux/highmem.h> 21 - #include <asm/system.h> 21 + #include <asm/cp15.h> 22 22 #include <asm/cputype.h> 23 23 #include <asm/cacheflush.h> 24 24
+1
arch/arm/mm/ioremap.c
··· 26 26 #include <linux/vmalloc.h> 27 27 #include <linux/io.h> 28 28 29 + #include <asm/cp15.h> 29 30 #include <asm/cputype.h> 30 31 #include <asm/cacheflush.h> 31 32 #include <asm/mmu_context.h>
+1
arch/arm/mm/mmu.c
··· 17 17 #include <linux/fs.h> 18 18 #include <linux/vmalloc.h> 19 19 20 + #include <asm/cp15.h> 20 21 #include <asm/cputype.h> 21 22 #include <asm/sections.h> 22 23 #include <asm/cachetype.h>
+1
arch/arm/mm/pgd.c
··· 12 12 #include <linux/highmem.h> 13 13 #include <linux/slab.h> 14 14 15 + #include <asm/cp15.h> 15 16 #include <asm/pgalloc.h> 16 17 #include <asm/page.h> 17 18 #include <asm/tlbflush.h>
+1
arch/arm/vfp/vfpmodule.c
··· 18 18 #include <linux/smp.h> 19 19 #include <linux/init.h> 20 20 21 + #include <asm/cp15.h> 21 22 #include <asm/cputype.h> 22 23 #include <asm/thread_notify.h> 23 24 #include <asm/vfp.h>