1 #include <linux/delay.h>
2 #include <linux/init.h>
6 static int tango_boot_secondary(unsigned int cpu
, struct task_struct
*idle
)
8 tango_set_aux_boot_addr(virt_to_phys(secondary_startup
));
9 tango_start_aux_core(cpu
);
13 #ifdef CONFIG_HOTPLUG_CPU
15 * cpu_kill() and cpu_die() run concurrently on different cores.
16 * Firmware will only "kill" a core once it has properly "died".
17 * Try a few times to kill a core before giving up, and sleep
18 * between tries to give that core enough time to die.
20 static int tango_cpu_kill(unsigned int cpu
)
24 for (i
= 0; i
< 10; ++i
) {
26 err
= tango_aux_core_kill(cpu
);
34 static void tango_cpu_die(unsigned int cpu
)
36 while (tango_aux_core_die(cpu
) < 0)
39 panic("cpu %d failed to die\n", cpu
);
43 static const struct smp_operations tango_smp_ops __initconst
= {
44 .smp_boot_secondary
= tango_boot_secondary
,
45 #ifdef CONFIG_HOTPLUG_CPU
46 .cpu_kill
= tango_cpu_kill
,
47 .cpu_die
= tango_cpu_die
,
51 CPU_METHOD_OF_DECLARE(tango4_smp
, "sigma,tango4-smp", &tango_smp_ops
);