Commit | Line | Data |
---|---|---|
4898de3d BS |
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 | ||
4898de3d | 13 | #include <asm/smp_plat.h> |
6213f70e | 14 | #include "common.h" |
4898de3d BS |
15 | |
16 | static inline void platform_do_lowpower(unsigned int cpu) | |
17 | { | |
4898de3d BS |
18 | /* we put the platform to just WFI */ |
19 | for (;;) { | |
20 | __asm__ __volatile__("dsb\n\t" "wfi\n\t" | |
21 | : : : "memory"); | |
6213f70e | 22 | if (prima2_pen_release == cpu_logical_map(cpu)) { |
4898de3d BS |
23 | /* |
24 | * OK, proper wakeup, we're done | |
25 | */ | |
26 | break; | |
27 | } | |
28 | } | |
29 | } | |
30 | ||
31 | /* | |
32 | * platform-specific code to shutdown a CPU | |
33 | * | |
34 | * Called with IRQs disabled | |
35 | */ | |
b96fc2f3 | 36 | void sirfsoc_cpu_die(unsigned int cpu) |
4898de3d BS |
37 | { |
38 | platform_do_lowpower(cpu); | |
39 | } |