Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 1 | /* |
| 2 | * CPU hotplug support for CSR Marco dual-core SMP SoCs |
| 3 | * |
| 4 | * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company. |
| 5 | * |
| 6 | * Licensed under GPLv2 or later. |
| 7 | */ |
| 8 | |
| 9 | #include <linux/kernel.h> |
| 10 | #include <linux/errno.h> |
| 11 | #include <linux/smp.h> |
| 12 | |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 13 | #include <asm/smp_plat.h> |
| 14 | |
| 15 | static inline void platform_do_lowpower(unsigned int cpu) |
| 16 | { |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 17 | /* we put the platform to just WFI */ |
| 18 | for (;;) { |
| 19 | __asm__ __volatile__("dsb\n\t" "wfi\n\t" |
| 20 | : : : "memory"); |
| 21 | if (pen_release == cpu_logical_map(cpu)) { |
| 22 | /* |
| 23 | * OK, proper wakeup, we're done |
| 24 | */ |
| 25 | break; |
| 26 | } |
| 27 | } |
| 28 | } |
| 29 | |
| 30 | /* |
| 31 | * platform-specific code to shutdown a CPU |
| 32 | * |
| 33 | * Called with IRQs disabled |
| 34 | */ |
Stephen Boyd | b96fc2f | 2015-10-19 13:05:33 -0700 | [diff] [blame] | 35 | void sirfsoc_cpu_die(unsigned int cpu) |
Barry Song | 4898de3 | 2012-12-20 19:37:32 +0800 | [diff] [blame] | 36 | { |
| 37 | platform_do_lowpower(cpu); |
| 38 | } |