Merge tag 'selinux-pr-20190521' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-block.git] / arch / arm / mach-prima2 / hotplug.c
CommitLineData
a636cd6c 1// SPDX-License-Identifier: GPL-2.0-or-later
4898de3d
BS
2/*
3 * CPU hotplug support for CSR Marco dual-core SMP SoCs
4 *
5 * Copyright (c) 2012 Cambridge Silicon Radio Limited, a CSR plc group company.
4898de3d
BS
6 */
7
8#include <linux/kernel.h>
9#include <linux/errno.h>
10#include <linux/smp.h>
11
4898de3d 12#include <asm/smp_plat.h>
6213f70e 13#include "common.h"
4898de3d
BS
14
15static inline void platform_do_lowpower(unsigned int cpu)
16{
4898de3d
BS
17 /* we put the platform to just WFI */
18 for (;;) {
19 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
20 : : : "memory");
6213f70e 21 if (prima2_pen_release == cpu_logical_map(cpu)) {
4898de3d
BS
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 */
b96fc2f3 35void sirfsoc_cpu_die(unsigned int cpu)
4898de3d
BS
36{
37 platform_do_lowpower(cpu);
38}