aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Herring <rob.herring@calxeda.com>2013-01-16 18:57:33 -0500
committerNicolas Pitre <nicolas.pitre@linaro.org>2013-05-29 15:50:34 -0400
commitbbc8d77db655be61a21d7623428c46c578a866d3 (patch)
treec5f138fdd654299e44ba073a43a681f0a5c91b0e
parent62158f817ad3e0368480b8e9480be34bffd8c74a (diff)
ARM: introduce common set_auxcr/get_auxcr functions
Move the private set_auxcr/get_auxcr functions from drivers/cpuidle/cpuidle-calxeda.c so they can be used across platforms. Signed-off-by: Rob Herring <rob.herring@calxeda.com> Cc: Russell King <linux@arm.linux.org.uk> Signed-off-by: Nicolas Pitre <nico@linaro.org> Acked-by: Tony Lindgren <tony@atomide.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Reviewed-by: Will Deacon <will.deacon@arm.com>
-rw-r--r--arch/arm/include/asm/cp15.h14
-rw-r--r--drivers/cpuidle/cpuidle-calxeda.c14
2 files changed, 14 insertions, 14 deletions
diff --git a/arch/arm/include/asm/cp15.h b/arch/arm/include/asm/cp15.h
index 1f3262e99d81..cedd3721318b 100644
--- a/arch/arm/include/asm/cp15.h
+++ b/arch/arm/include/asm/cp15.h
@@ -61,6 +61,20 @@ static inline void set_cr(unsigned int val)
61 isb(); 61 isb();
62} 62}
63 63
64static inline unsigned int get_auxcr(void)
65{
66 unsigned int val;
67 asm("mrc p15, 0, %0, c1, c0, 1 @ get AUXCR" : "=r" (val));
68 return val;
69}
70
71static inline void set_auxcr(unsigned int val)
72{
73 asm volatile("mcr p15, 0, %0, c1, c0, 1 @ set AUXCR"
74 : : "r" (val));
75 isb();
76}
77
64#ifndef CONFIG_SMP 78#ifndef CONFIG_SMP
65extern void adjust_cr(unsigned long mask, unsigned long set); 79extern void adjust_cr(unsigned long mask, unsigned long set);
66#endif 80#endif
diff --git a/drivers/cpuidle/cpuidle-calxeda.c b/drivers/cpuidle/cpuidle-calxeda.c
index 223379169cb0..0e6e408c0a63 100644
--- a/drivers/cpuidle/cpuidle-calxeda.c
+++ b/drivers/cpuidle/cpuidle-calxeda.c
@@ -37,20 +37,6 @@
37extern void highbank_set_cpu_jump(int cpu, void *jump_addr); 37extern void highbank_set_cpu_jump(int cpu, void *jump_addr);
38extern void *scu_base_addr; 38extern void *scu_base_addr;
39 39
40static inline unsigned int get_auxcr(void)
41{
42 unsigned int val;
43 asm("mrc p15, 0, %0, c1, c0, 1 @ get AUXCR" : "=r" (val) : : "cc");
44 return val;
45}
46
47static inline void set_auxcr(unsigned int val)
48{
49 asm volatile("mcr p15, 0, %0, c1, c0, 1 @ set AUXCR"
50 : : "r" (val) : "cc");
51 isb();
52}
53
54static noinline void calxeda_idle_restore(void) 40static noinline void calxeda_idle_restore(void)
55{ 41{
56 set_cr(get_cr() | CR_C); 42 set_cr(get_cr() | CR_C);