2 * Symmetric Multi Processing (SMP) support for Marvell EBU Cortex-A9
3 * based SOCs (Armada 375/38x).
5 * Copyright (C) 2014 Marvell
7 * Gregory CLEMENT <gregory.clement@free-electrons.com>
8 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
10 * This file is licensed under the terms of the GNU General Public
11 * License version 2. This program is licensed "as is" without any
12 * warranty of any kind, whether express or implied.
15 #include <linux/init.h>
18 #include <linux/smp.h>
19 #include <linux/mbus.h>
20 #include <asm/smp_scu.h>
21 #include <asm/smp_plat.h>
25 extern void mvebu_cortex_a9_secondary_startup(void);
27 static int __cpuinit mvebu_cortex_a9_boot_secondary(unsigned int cpu,
28 struct task_struct *idle)
32 pr_info("Booting CPU %d\n", cpu);
35 * Write the address of secondary startup into the system-wide
36 * flags register. The boot monitor waits until it receives a
37 * soft interrupt, and then the secondary CPU branches to this
40 hw_cpu = cpu_logical_map(cpu);
41 if (of_machine_is_compatible("marvell,armada375"))
42 mvebu_system_controller_set_cpu_boot_addr(mvebu_cortex_a9_secondary_startup);
44 mvebu_pmsu_set_cpu_boot_addr(hw_cpu, mvebu_cortex_a9_secondary_startup);
46 ret = mvebu_cpu_reset_deassert(hw_cpu);
48 pr_err("Could not start the secondary CPU: %d\n", ret);
51 arch_send_wakeup_ipi_mask(cpumask_of(cpu));
56 static struct smp_operations mvebu_cortex_a9_smp_ops __initdata = {
57 .smp_boot_secondary = mvebu_cortex_a9_boot_secondary,
60 CPU_METHOD_OF_DECLARE(mvebu_armada_375_smp, "marvell,armada-375-smp",
61 &mvebu_cortex_a9_smp_ops);
62 CPU_METHOD_OF_DECLARE(mvebu_armada_380_smp, "marvell,armada-380-smp",
63 &mvebu_cortex_a9_smp_ops);