aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-mvebu/platsmp-a9.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-mvebu/platsmp-a9.c')
-rw-r--r--arch/arm/mach-mvebu/platsmp-a9.c53
1 files changed, 51 insertions, 2 deletions
diff --git a/arch/arm/mach-mvebu/platsmp-a9.c b/arch/arm/mach-mvebu/platsmp-a9.c
index 47a71a924b96..2ec1a42b4321 100644
--- a/arch/arm/mach-mvebu/platsmp-a9.c
+++ b/arch/arm/mach-mvebu/platsmp-a9.c
@@ -43,21 +43,70 @@ static int __cpuinit mvebu_cortex_a9_boot_secondary(unsigned int cpu,
43 else 43 else
44 mvebu_pmsu_set_cpu_boot_addr(hw_cpu, mvebu_cortex_a9_secondary_startup); 44 mvebu_pmsu_set_cpu_boot_addr(hw_cpu, mvebu_cortex_a9_secondary_startup);
45 smp_wmb(); 45 smp_wmb();
46
47 /*
48 * Doing this before deasserting the CPUs is needed to wake up CPUs
49 * in the offline state after using CPU hotplug.
50 */
51 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
52
46 ret = mvebu_cpu_reset_deassert(hw_cpu); 53 ret = mvebu_cpu_reset_deassert(hw_cpu);
47 if (ret) { 54 if (ret) {
48 pr_err("Could not start the secondary CPU: %d\n", ret); 55 pr_err("Could not start the secondary CPU: %d\n", ret);
49 return ret; 56 return ret;
50 } 57 }
51 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
52 58
53 return 0; 59 return 0;
54} 60}
61/*
62 * When a CPU is brought back online, either through CPU hotplug, or
63 * because of the boot of a kexec'ed kernel, the PMSU configuration
64 * for this CPU might be in the deep idle state, preventing this CPU
65 * from receiving interrupts. Here, we therefore take out the current
66 * CPU from this state, which was entered by armada_38x_cpu_die()
67 * below.
68 */
69static void armada_38x_secondary_init(unsigned int cpu)
70{
71 mvebu_v7_pmsu_idle_exit();
72}
73
74#ifdef CONFIG_HOTPLUG_CPU
75static void armada_38x_cpu_die(unsigned int cpu)
76{
77 /*
78 * CPU hotplug is implemented by putting offline CPUs into the
79 * deep idle sleep state.
80 */
81 armada_38x_do_cpu_suspend(true);
82}
83
84/*
85 * We need a dummy function, so that platform_can_cpu_hotplug() knows
86 * we support CPU hotplug. However, the function does not need to do
87 * anything, because CPUs going offline can enter the deep idle state
88 * by themselves, without any help from a still alive CPU.
89 */
90static int armada_38x_cpu_kill(unsigned int cpu)
91{
92 return 1;
93}
94#endif
55 95
56static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = { 96static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
57 .smp_boot_secondary = mvebu_cortex_a9_boot_secondary, 97 .smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
58}; 98};
59 99
100static struct smp_operations armada_38x_smp_ops __initdata = {
101 .smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
102 .smp_secondary_init = armada_38x_secondary_init,
103#ifdef CONFIG_HOTPLUG_CPU
104 .cpu_die = armada_38x_cpu_die,
105 .cpu_kill = armada_38x_cpu_kill,
106#endif
107};
108
60CPU_METHOD_OF_DECLARE(mvebu_armada_375_smp, "marvell,armada-375-smp", 109CPU_METHOD_OF_DECLARE(mvebu_armada_375_smp, "marvell,armada-375-smp",
61 &mvebu_cortex_a9_smp_ops); 110 &mvebu_cortex_a9_smp_ops);
62CPU_METHOD_OF_DECLARE(mvebu_armada_380_smp, "marvell,armada-380-smp", 111CPU_METHOD_OF_DECLARE(mvebu_armada_380_smp, "marvell,armada-380-smp",
63 &mvebu_cortex_a9_smp_ops); 112 &armada_38x_smp_ops);