Shawn Guo | 69c31b7 | 2011-09-06 14:59:40 +0800 | [diff] [blame^] | 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> |
| 15 | #include <mach/common.h> |
| 16 | |
| 17 | int platform_cpu_kill(unsigned int cpu) |
| 18 | { |
| 19 | return 1; |
| 20 | } |
| 21 | |
| 22 | /* |
| 23 | * platform-specific code to shutdown a CPU |
| 24 | * |
| 25 | * Called with IRQs disabled |
| 26 | */ |
| 27 | void platform_cpu_die(unsigned int cpu) |
| 28 | { |
| 29 | flush_cache_all(); |
| 30 | imx_enable_cpu(cpu, false); |
| 31 | cpu_do_idle(); |
| 32 | |
| 33 | /* We should never return from idle */ |
| 34 | panic("cpu %d unexpectedly exit from shutdown\n", cpu); |
| 35 | } |
| 36 | |
| 37 | int platform_cpu_disable(unsigned int cpu) |
| 38 | { |
| 39 | /* |
| 40 | * we don't allow CPU 0 to be shutdown (it is still too special |
| 41 | * e.g. clock tick interrupts) |
| 42 | */ |
| 43 | return cpu == 0 ? -EPERM : 0; |
| 44 | } |