2 * Copyright 2010-2011 Calxeda, Inc.
3 * Based on platsmp.c, Copyright (C) 2002 ARM Ltd.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program. If not, see <http://www.gnu.org/licenses/>.
17 #include <linux/init.h>
18 #include <linux/smp.h>
21 #include <asm/smp_scu.h>
22 #include <asm/hardware/gic.h>
26 extern void secondary_startup(void);
28 static void __cpuinit
highbank_secondary_init(unsigned int cpu
)
30 gic_secondary_init(0);
33 static int __cpuinit
highbank_boot_secondary(unsigned int cpu
, struct task_struct
*idle
)
35 highbank_set_cpu_jump(cpu
, secondary_startup
);
36 gic_raise_softirq(cpumask_of(cpu
), 0);
41 * Initialise the CPU possible map early - this describes the CPUs
42 * which may be present or become present in the system.
44 static void __init
highbank_smp_init_cpus(void)
46 unsigned int i
, ncores
= 4;
49 if (ncores
> NR_CPUS
) {
51 "highbank: no. of cores (%d) greater than configured "
52 "maximum of %d - clipping\n",
57 for (i
= 0; i
< ncores
; i
++)
58 set_cpu_possible(i
, true);
60 set_smp_cross_call(gic_raise_softirq
);
63 static void __init
highbank_smp_prepare_cpus(unsigned int max_cpus
)
66 scu_enable(scu_base_addr
);
69 struct smp_operations highbank_smp_ops __initdata
= {
70 .smp_init_cpus
= highbank_smp_init_cpus
,
71 .smp_prepare_cpus
= highbank_smp_prepare_cpus
,
72 .smp_secondary_init
= highbank_secondary_init
,
73 .smp_boot_secondary
= highbank_boot_secondary
,
74 #ifdef CONFIG_HOTPLUG_CPU
75 .cpu_die
= highbank_cpu_die
,