]>
Commit | Line | Data |
---|---|---|
69c31b7a SG |
1 | /* |
2 | * Copyright 2011 Freescale Semiconductor, Inc. | |
3 | * Copyright 2011 Linaro Ltd. | |
4 | * | |
5 | * The code contained herein is licensed under the GNU General Public | |
6 | * License. You may obtain a copy of the GNU General Public License | |
7 | * Version 2 or later at the following locations: | |
8 | * | |
9 | * http://www.opensource.org/licenses/gpl-license.html | |
10 | * http://www.gnu.org/copyleft/gpl.html | |
11 | */ | |
12 | ||
13 | #include <linux/errno.h> | |
14 | #include <asm/cacheflush.h> | |
602bf409 | 15 | #include <asm/cp15.h> |
e3372474 SG |
16 | |
17 | #include "common.h" | |
69c31b7a | 18 | |
602bf409 SG |
19 | static inline void cpu_enter_lowpower(void) |
20 | { | |
21 | unsigned int v; | |
22 | ||
23 | flush_cache_all(); | |
24 | asm volatile( | |
25 | "mcr p15, 0, %1, c7, c5, 0\n" | |
26 | " mcr p15, 0, %1, c7, c10, 4\n" | |
27 | /* | |
28 | * Turn off coherency | |
29 | */ | |
30 | " mrc p15, 0, %0, c1, c0, 1\n" | |
31 | " bic %0, %0, %3\n" | |
32 | " mcr p15, 0, %0, c1, c0, 1\n" | |
33 | " mrc p15, 0, %0, c1, c0, 0\n" | |
34 | " bic %0, %0, %2\n" | |
35 | " mcr p15, 0, %0, c1, c0, 0\n" | |
36 | : "=&r" (v) | |
37 | : "r" (0), "Ir" (CR_C), "Ir" (0x40) | |
38 | : "cc"); | |
39 | } | |
40 | ||
69c31b7a SG |
41 | /* |
42 | * platform-specific code to shutdown a CPU | |
43 | * | |
44 | * Called with IRQs disabled | |
45 | */ | |
e4f2d979 | 46 | void imx_cpu_die(unsigned int cpu) |
69c31b7a | 47 | { |
602bf409 | 48 | cpu_enter_lowpower(); |
83757664 SG |
49 | cpu_do_idle(); |
50 | } | |
69c31b7a | 51 | |
83757664 SG |
52 | int imx_cpu_kill(unsigned int cpu) |
53 | { | |
54 | imx_enable_cpu(cpu, false); | |
55 | return 1; | |
69c31b7a | 56 | } |