2 * Copyright 2011 Freescale Semiconductor, Inc.
3 * Copyright 2011 Linaro Ltd.
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:
9 * http://www.opensource.org/licenses/gpl-license.html
10 * http://www.gnu.org/copyleft/gpl.html
13 #include <linux/errno.h>
14 #include <asm/cacheflush.h>
16 #include <mach/common.h>
18 int platform_cpu_kill(unsigned int cpu
)
23 static inline void cpu_enter_lowpower(void)
29 "mcr p15, 0, %1, c7, c5, 0\n"
30 " mcr p15, 0, %1, c7, c10, 4\n"
34 " mrc p15, 0, %0, c1, c0, 1\n"
36 " mcr p15, 0, %0, c1, c0, 1\n"
37 " mrc p15, 0, %0, c1, c0, 0\n"
39 " mcr p15, 0, %0, c1, c0, 0\n"
41 : "r" (0), "Ir" (CR_C
), "Ir" (0x40)
45 static inline void cpu_leave_lowpower(void)
50 "mrc p15, 0, %0, c1, c0, 0\n"
52 " mcr p15, 0, %0, c1, c0, 0\n"
53 " mrc p15, 0, %0, c1, c0, 1\n"
55 " mcr p15, 0, %0, c1, c0, 1\n"
57 : "Ir" (CR_C
), "Ir" (0x40)
62 * platform-specific code to shutdown a CPU
64 * Called with IRQs disabled
66 void platform_cpu_die(unsigned int cpu
)
69 imx_enable_cpu(cpu
, false);
73 /* We should never return from idle */
74 panic("cpu %d unexpectedly exit from shutdown\n", cpu
);
77 int platform_cpu_disable(unsigned int cpu
)
80 * we don't allow CPU 0 to be shutdown (it is still too special
81 * e.g. clock tick interrupts)
83 return cpu
== 0 ? -EPERM
: 0;