1
2
3
4
5
6
7
8
9
10
11#include <linux/init.h>
12#include <linux/errno.h>
13#include <linux/smp.h>
14#include <linux/io.h>
15#include <linux/of_address.h>
16#include <linux/vexpress.h>
17
18#include <asm/mcpm.h>
19#include <asm/smp_scu.h>
20#include <asm/mach/map.h>
21
22#include <plat/platsmp.h>
23
24#include "core.h"
25
26bool __init vexpress_smp_init_ops(void)
27{
28#ifdef CONFIG_MCPM
29
30
31
32
33
34 struct device_node *node;
35 node = of_find_compatible_node(NULL, NULL, "arm,cci-400");
36 if (node && of_device_is_available(node)) {
37 mcpm_smp_set_ops();
38 return true;
39 }
40#endif
41 return false;
42}
43
44static const struct of_device_id vexpress_smp_dt_scu_match[] __initconst = {
45 { .compatible = "arm,cortex-a5-scu", },
46 { .compatible = "arm,cortex-a9-scu", },
47 {}
48};
49
50static void __init vexpress_smp_dt_prepare_cpus(unsigned int max_cpus)
51{
52 struct device_node *scu = of_find_matching_node(NULL,
53 vexpress_smp_dt_scu_match);
54
55 if (scu)
56 scu_enable(of_iomap(scu, 0));
57
58
59
60
61
62
63
64 vexpress_flags_set(virt_to_phys(versatile_secondary_startup));
65}
66
67const struct smp_operations vexpress_smp_dt_ops __initconst = {
68 .smp_prepare_cpus = vexpress_smp_dt_prepare_cpus,
69 .smp_secondary_init = versatile_secondary_init,
70 .smp_boot_secondary = versatile_boot_secondary,
71#ifdef CONFIG_HOTPLUG_CPU
72 .cpu_die = vexpress_cpu_die,
73#endif
74};
75