1 // SPDX-License-Identifier: GPL-2.0
2 #include <linux/delay.h>
3 #include <linux/init.h>
7 static int tango_boot_secondary(unsigned int cpu
, struct task_struct
*idle
)
9 tango_set_aux_boot_addr(__pa_symbol(secondary_startup
));
10 tango_start_aux_core(cpu
);
14 #ifdef CONFIG_HOTPLUG_CPU
16 * cpu_kill() and cpu_die() run concurrently on different cores.
17 * Firmware will only "kill" a core once it has properly "died".
18 * Try a few times to kill a core before giving up, and sleep
19 * between tries to give that core enough time to die.
21 static int tango_cpu_kill(unsigned int cpu
)
25 for (i
= 0; i
< 10; ++i
) {
27 err
= tango_aux_core_kill(cpu
);
35 static void tango_cpu_die(unsigned int cpu
)
37 while (tango_aux_core_die(cpu
) < 0)
40 panic("cpu %d failed to die\n", cpu
);
44 static const struct smp_operations tango_smp_ops __initconst
= {
45 .smp_boot_secondary
= tango_boot_secondary
,
46 #ifdef CONFIG_HOTPLUG_CPU
47 .cpu_kill
= tango_cpu_kill
,
48 .cpu_die
= tango_cpu_die
,
52 CPU_METHOD_OF_DECLARE(tango4_smp
, "sigma,tango4-smp", &tango_smp_ops
);