diff options
author | Leela Krishna Amudala <leela.krishna@linaro.org> | 2014-05-09 09:51:04 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-25 15:04:59 -0400 |
commit | 75ad2ab28f0f184a7ba7f816b62be04c3c0ba80a (patch) | |
tree | 6bfcb96f1e2bfbd80f86b4c6ae167dc6f1797337 | |
parent | b5783dcaed065ae6622a9795a19a4eda748b64f8 (diff) |
ARM: EXYNOS: use v7_exit_coherency_flush macro for cache disabling
A common macro v7_exit_coherency_flush available which does the below
tasks in the seqeunce.
-clearing C bit
-clearing L1 cache
-exit SMP
-instruction and data synchronization
So removing the local functions which does the same thing and use the
macro instead.
Signed-off-by: Leela Krishna Amudala <leela.krishna@linaro.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
[cw00.choi@samsung.com: tested on exynos3250 based board]
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
-rw-r--r-- | arch/arm/mach-exynos/hotplug.c | 63 |
1 files changed, 1 insertions, 62 deletions
diff --git a/arch/arm/mach-exynos/hotplug.c b/arch/arm/mach-exynos/hotplug.c index 5eead530c6f8..9ca692d2744e 100644 --- a/arch/arm/mach-exynos/hotplug.c +++ b/arch/arm/mach-exynos/hotplug.c | |||
@@ -24,56 +24,6 @@ | |||
24 | #include "common.h" | 24 | #include "common.h" |
25 | #include "regs-pmu.h" | 25 | #include "regs-pmu.h" |
26 | 26 | ||
27 | static inline void cpu_enter_lowpower_a9(void) | ||
28 | { | ||
29 | unsigned int v; | ||
30 | |||
31 | asm volatile( | ||
32 | " mcr p15, 0, %1, c7, c5, 0\n" | ||
33 | " mcr p15, 0, %1, c7, c10, 4\n" | ||
34 | /* | ||
35 | * Turn off coherency | ||
36 | */ | ||
37 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
38 | " bic %0, %0, %3\n" | ||
39 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
40 | " mrc p15, 0, %0, c1, c0, 0\n" | ||
41 | " bic %0, %0, %2\n" | ||
42 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
43 | : "=&r" (v) | ||
44 | : "r" (0), "Ir" (CR_C), "Ir" (0x40) | ||
45 | : "cc"); | ||
46 | } | ||
47 | |||
48 | static inline void cpu_enter_lowpower_a15(void) | ||
49 | { | ||
50 | unsigned int v; | ||
51 | |||
52 | asm volatile( | ||
53 | " mrc p15, 0, %0, c1, c0, 0\n" | ||
54 | " bic %0, %0, %1\n" | ||
55 | " mcr p15, 0, %0, c1, c0, 0\n" | ||
56 | : "=&r" (v) | ||
57 | : "Ir" (CR_C) | ||
58 | : "cc"); | ||
59 | |||
60 | flush_cache_louis(); | ||
61 | |||
62 | asm volatile( | ||
63 | /* | ||
64 | * Turn off coherency | ||
65 | */ | ||
66 | " mrc p15, 0, %0, c1, c0, 1\n" | ||
67 | " bic %0, %0, %1\n" | ||
68 | " mcr p15, 0, %0, c1, c0, 1\n" | ||
69 | : "=&r" (v) | ||
70 | : "Ir" (0x40) | ||
71 | : "cc"); | ||
72 | |||
73 | isb(); | ||
74 | dsb(); | ||
75 | } | ||
76 | |||
77 | static inline void cpu_leave_lowpower(void) | 27 | static inline void cpu_leave_lowpower(void) |
78 | { | 28 | { |
79 | unsigned int v; | 29 | unsigned int v; |
@@ -132,19 +82,8 @@ static inline void platform_do_lowpower(unsigned int cpu, int *spurious) | |||
132 | void __ref exynos_cpu_die(unsigned int cpu) | 82 | void __ref exynos_cpu_die(unsigned int cpu) |
133 | { | 83 | { |
134 | int spurious = 0; | 84 | int spurious = 0; |
135 | int primary_part = 0; | ||
136 | 85 | ||
137 | /* | 86 | v7_exit_coherency_flush(louis); |
138 | * we're ready for shutdown now, so do it. | ||
139 | * Exynos4 is A9 based while Exynos5 is A15; check the CPU part | ||
140 | * number by reading the Main ID register and then perform the | ||
141 | * appropriate sequence for entering low power. | ||
142 | */ | ||
143 | asm("mrc p15, 0, %0, c0, c0, 0" : "=r"(primary_part) : : "cc"); | ||
144 | if ((primary_part & 0xfff0) == 0xc0f0) | ||
145 | cpu_enter_lowpower_a15(); | ||
146 | else | ||
147 | cpu_enter_lowpower_a9(); | ||
148 | 87 | ||
149 | platform_do_lowpower(cpu, &spurious); | 88 | platform_do_lowpower(cpu, &spurious); |
150 | 89 | ||