summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-virt
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-05-21 10:24:11 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2013-05-21 10:24:11 -0400
commit05774088391c7430f6a4c1d5d18196ef17bb3ba9 (patch)
treef8263dcb34690375f12de8b533c426138b53d5a0 /arch/arm/mach-virt
parentc7788792a5e7b0d5d7f96d0766b4cb6112d47d75 (diff)
arm: introduce psci_smp_ops
Rename virt_smp_ops to psci_smp_ops and move them to arch/arm/kernel/psci_smp.c. Remove mach-virt/platsmp.c, now unused. Compile psci_smp if CONFIG_ARM_PSCI and CONFIG_SMP. Add a cpu_die smp_op based on psci_ops.cpu_off. Initialize PSCI before setting smp_ops in setup_arch. If PSCI is available on the platform, prefer psci_smp_ops over the platform smp_ops. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Will Deacon <will.deacon@arm.com> CC: arnd@arndb.de CC: marc.zyngier@arm.com CC: linux@arm.linux.org.uk CC: nico@linaro.org CC: rob.herring@calxeda.com
Diffstat (limited to 'arch/arm/mach-virt')
-rw-r--r--arch/arm/mach-virt/Makefile1
-rw-r--r--arch/arm/mach-virt/platsmp.c50
-rw-r--r--arch/arm/mach-virt/virt.c3
3 files changed, 0 insertions, 54 deletions
diff --git a/arch/arm/mach-virt/Makefile b/arch/arm/mach-virt/Makefile
index 042afc1f8c44..7ddbfa60227f 100644
--- a/arch/arm/mach-virt/Makefile
+++ b/arch/arm/mach-virt/Makefile
@@ -3,4 +3,3 @@
3# 3#
4 4
5obj-y := virt.o 5obj-y := virt.o
6obj-$(CONFIG_SMP) += platsmp.o
diff --git a/arch/arm/mach-virt/platsmp.c b/arch/arm/mach-virt/platsmp.c
deleted file mode 100644
index f4143f5bfa5b..000000000000
--- a/arch/arm/mach-virt/platsmp.c
+++ /dev/null
@@ -1,50 +0,0 @@
1/*
2 * Dummy Virtual Machine - does what it says on the tin.
3 *
4 * Copyright (C) 2012 ARM Ltd
5 * Author: Will Deacon <will.deacon@arm.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#include <linux/init.h>
21#include <linux/smp.h>
22#include <linux/of.h>
23
24#include <asm/psci.h>
25#include <asm/smp_plat.h>
26
27extern void secondary_startup(void);
28
29static void __init virt_smp_init_cpus(void)
30{
31}
32
33static void __init virt_smp_prepare_cpus(unsigned int max_cpus)
34{
35}
36
37static int __cpuinit virt_boot_secondary(unsigned int cpu,
38 struct task_struct *idle)
39{
40 if (psci_ops.cpu_on)
41 return psci_ops.cpu_on(cpu_logical_map(cpu),
42 __pa(secondary_startup));
43 return -ENODEV;
44}
45
46struct smp_operations __initdata virt_smp_ops = {
47 .smp_init_cpus = virt_smp_init_cpus,
48 .smp_prepare_cpus = virt_smp_prepare_cpus,
49 .smp_boot_secondary = virt_boot_secondary,
50};
diff --git a/arch/arm/mach-virt/virt.c b/arch/arm/mach-virt/virt.c
index 061f283f579e..a67d2dd5bb60 100644
--- a/arch/arm/mach-virt/virt.c
+++ b/arch/arm/mach-virt/virt.c
@@ -36,11 +36,8 @@ static const char *virt_dt_match[] = {
36 NULL 36 NULL
37}; 37};
38 38
39extern struct smp_operations virt_smp_ops;
40
41DT_MACHINE_START(VIRT, "Dummy Virtual Machine") 39DT_MACHINE_START(VIRT, "Dummy Virtual Machine")
42 .init_irq = irqchip_init, 40 .init_irq = irqchip_init,
43 .init_machine = virt_init, 41 .init_machine = virt_init,
44 .smp = smp_ops(virt_smp_ops),
45 .dt_compat = virt_dt_match, 42 .dt_compat = virt_dt_match,
46MACHINE_END 43MACHINE_END