Commit | Line | Data |
---|---|---|
4de3abb3 WD |
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 | ||
4de3abb3 WD |
24 | #include <asm/psci.h> |
25 | #include <asm/smp_plat.h> | |
26 | ||
27 | extern void secondary_startup(void); | |
28 | ||
29 | static void __init virt_smp_init_cpus(void) | |
30 | { | |
31 | } | |
32 | ||
33 | static void __init virt_smp_prepare_cpus(unsigned int max_cpus) | |
34 | { | |
35 | } | |
36 | ||
37 | static 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 | ||
4de3abb3 WD |
46 | struct smp_operations __initdata virt_smp_ops = { |
47 | .smp_init_cpus = virt_smp_init_cpus, | |
48 | .smp_prepare_cpus = virt_smp_prepare_cpus, | |
4de3abb3 WD |
49 | .smp_boot_secondary = virt_boot_secondary, |
50 | }; |