Magnus Damm | 1c51ed4 | 2010-12-14 16:56:55 +0900 | [diff] [blame] | 1 | /* |
| 2 | * SMP support for R-Mobile / SH-Mobile |
| 3 | * |
| 4 | * Copyright (C) 2010 Magnus Damm |
| 5 | * |
| 6 | * Based on realview, Copyright (C) 2002 ARM Ltd, All Rights Reserved |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License version 2 as |
| 10 | * published by the Free Software Foundation. |
| 11 | */ |
| 12 | #include <linux/kernel.h> |
| 13 | #include <linux/errno.h> |
| 14 | #include <linux/smp.h> |
Magnus Damm | 8b30679 | 2011-12-28 16:47:16 +0900 | [diff] [blame^] | 15 | #include <mach/common.h> |
Magnus Damm | 1c51ed4 | 2010-12-14 16:56:55 +0900 | [diff] [blame] | 16 | |
| 17 | int platform_cpu_kill(unsigned int cpu) |
| 18 | { |
Magnus Damm | 8b30679 | 2011-12-28 16:47:16 +0900 | [diff] [blame^] | 19 | return shmobile_platform_cpu_kill(cpu); |
Magnus Damm | 1c51ed4 | 2010-12-14 16:56:55 +0900 | [diff] [blame] | 20 | } |
| 21 | |
| 22 | void platform_cpu_die(unsigned int cpu) |
| 23 | { |
| 24 | while (1) { |
| 25 | /* |
| 26 | * here's the WFI |
| 27 | */ |
| 28 | asm(".word 0xe320f003\n" |
| 29 | : |
| 30 | : |
| 31 | : "memory", "cc"); |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | int platform_cpu_disable(unsigned int cpu) |
| 36 | { |
| 37 | /* |
| 38 | * we don't allow CPU 0 to be shutdown (it is still too special |
| 39 | * e.g. clock tick interrupts) |
| 40 | */ |
| 41 | return cpu == 0 ? -EPERM : 0; |
| 42 | } |