Commit | Line | Data |
---|---|---|
0459ca9b MZ |
1 | /* |
2 | * PSCI SMP initialisation | |
3 | * | |
4 | * Copyright (C) 2013 ARM Ltd. | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License version 2 as | |
8 | * published by the Free Software Foundation. | |
9 | * | |
10 | * This program is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | #include <linux/init.h> | |
20 | #include <linux/of.h> | |
21 | #include <linux/smp.h> | |
22 | ||
23 | #include <asm/psci.h> | |
a9a193ff | 24 | #include <asm/smp_plat.h> |
0459ca9b MZ |
25 | |
26 | static int __init smp_psci_init_cpu(struct device_node *dn, int cpu) | |
27 | { | |
28 | return 0; | |
29 | } | |
30 | ||
31 | static int __init smp_psci_prepare_cpu(int cpu) | |
32 | { | |
33 | int err; | |
34 | ||
35 | if (!psci_ops.cpu_on) { | |
36 | pr_err("psci: no cpu_on method, not booting CPU%d\n", cpu); | |
37 | return -ENODEV; | |
38 | } | |
39 | ||
a9a193ff | 40 | err = psci_ops.cpu_on(cpu_logical_map(cpu), __pa(secondary_holding_pen)); |
0459ca9b MZ |
41 | if (err) { |
42 | pr_err("psci: failed to boot CPU%d (%d)\n", cpu, err); | |
43 | return err; | |
44 | } | |
45 | ||
46 | return 0; | |
47 | } | |
48 | ||
49 | const struct smp_enable_ops smp_psci_ops __initconst = { | |
50 | .name = "psci", | |
a9a193ff | 51 | .init_cpu = smp_psci_init_cpu, |
0459ca9b MZ |
52 | .prepare_cpu = smp_psci_prepare_cpu, |
53 | }; |