blob: bc0d957e89ac496794b68b78c4863116c439e9b8 [file] [log] [blame]
Thomas Gleixnera636cd62019-05-19 15:51:34 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Barry Song4898de32012-12-20 19:37:32 +08002/*
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.
Barry Song4898de32012-12-20 19:37:32 +08006 */
7
8#include <linux/kernel.h>
9#include <linux/errno.h>
10#include <linux/smp.h>
11
Barry Song4898de32012-12-20 19:37:32 +080012#include <asm/smp_plat.h>
Russell King6213f702018-12-13 14:02:48 +000013#include "common.h"
Barry Song4898de32012-12-20 19:37:32 +080014
15static inline void platform_do_lowpower(unsigned int cpu)
16{
Barry Song4898de32012-12-20 19:37:32 +080017 /* we put the platform to just WFI */
18 for (;;) {
19 __asm__ __volatile__("dsb\n\t" "wfi\n\t"
20 : : : "memory");
Russell King6213f702018-12-13 14:02:48 +000021 if (prima2_pen_release == cpu_logical_map(cpu)) {
Barry Song4898de32012-12-20 19:37:32 +080022 /*
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 Boydb96fc2f2015-10-19 13:05:33 -070035void sirfsoc_cpu_die(unsigned int cpu)
Barry Song4898de32012-12-20 19:37:32 +080036{
37 platform_do_lowpower(cpu);
38}