1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Copyright 2011 Freescale Semiconductor, Inc.
4 * Copyright 2011 Linaro Ltd.
7 #include <linux/errno.h>
8 #include <linux/jiffies.h>
9 #include <asm/cacheflush.h>
11 #include <asm/proc-fns.h>
17 * platform-specific code to shutdown a CPU
19 * Called with IRQs disabled
21 void imx_cpu_die(unsigned int cpu
)
23 v7_exit_coherency_flush(louis
);
25 * We use the cpu jumping argument register to sync with
26 * imx_cpu_kill() which is running on cpu0 and waiting for
27 * the register being cleared to kill the cpu.
29 imx_set_cpu_arg(cpu
, ~0);
35 int imx_cpu_kill(unsigned int cpu
)
37 unsigned long timeout
= jiffies
+ msecs_to_jiffies(50);
39 while (imx_get_cpu_arg(cpu
) == 0)
40 if (time_after(jiffies
, timeout
))
42 imx_enable_cpu(cpu
, false);
43 imx_set_cpu_arg(cpu
, 0);
45 imx_gpcv2_set_core1_pdn_pup_by_software(true);