12 #include <linux/errno.h>
27 #if defined(CONFIG_OF)
41 static void *vexpress_dt_cortex_a9_scu_base
__initdata;
43 const static char *vexpress_dt_cortex_a9_match[]
__initconst = {
49 static int __init vexpress_dt_find_scu(
unsigned long node,
52 if (of_flat_dt_match(node, vexpress_dt_cortex_a9_match)) {
60 vexpress_dt_scu = CORTEX_A9_SCU;
65 if (
WARN_ON(!vexpress_dt_cortex_a9_scu_base))
75 WARN_ON(of_scan_flat_dt(vexpress_dt_find_scu,
NULL));
78 static int __init vexpress_dt_cpus_num(
unsigned long node,
const char *uname,
79 int depth,
void *data)
81 static int prev_depth = -1;
84 if (prev_depth > depth && nr_cpus > 0)
87 if (nr_cpus < 0 &&
strcmp(uname,
"cpus") == 0)
94 if (device_type &&
strcmp(device_type,
"cpu") == 0)
103 static void __init vexpress_dt_smp_init_cpus(
void)
107 switch (vexpress_dt_scu) {
109 ncores = of_scan_flat_dt(vexpress_dt_cpus_num,
NULL);
122 if (ncores > nr_cpu_ids) {
123 pr_warn(
"SMP: %u cores greater than maximum (%u), clipping\n",
128 for (
i = 0;
i < ncores; ++
i)
138 switch (vexpress_dt_scu) {
140 for (i = 0; i < max_cpus; i++)
154 static void __init vexpress_dt_smp_init_cpus(
void)
170 static void __init vexpress_smp_init_cpus(
void)
175 vexpress_dt_smp_init_cpus();
179 static void __init vexpress_smp_prepare_cpus(
unsigned int max_cpus)
200 .smp_init_cpus = vexpress_smp_init_cpus,
201 .smp_prepare_cpus = vexpress_smp_prepare_cpus,
204 #ifdef CONFIG_HOTPLUG_CPU