aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/Kconfig2
-rw-r--r--arch/arm/mach-highbank/Makefile2
-rw-r--r--arch/arm/mach-highbank/localtimer.c40
-rw-r--r--arch/arm/mach-highbank/platsmp.c78
4 files changed, 121 insertions, 1 deletions
diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
index 887b818bd667..b02e85bb4736 100644
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -1416,7 +1416,7 @@ config SMP
1416 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \ 1416 depends on REALVIEW_EB_ARM11MP || REALVIEW_EB_A9MP || \
1417 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \ 1417 MACH_REALVIEW_PB11MP || MACH_REALVIEW_PBX || ARCH_OMAP4 || \
1418 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \ 1418 ARCH_EXYNOS4 || ARCH_TEGRA || ARCH_U8500 || ARCH_VEXPRESS_CA9X4 || \
1419 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE 1419 ARCH_MSM_SCORPIONMP || ARCH_SHMOBILE || ARCH_HIGHBANK
1420 select USE_GENERIC_SMP_HELPERS 1420 select USE_GENERIC_SMP_HELPERS
1421 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP 1421 select HAVE_ARM_SCU if !ARCH_MSM_SCORPIONMP
1422 help 1422 help
diff --git a/arch/arm/mach-highbank/Makefile b/arch/arm/mach-highbank/Makefile
index da7f81a69530..89c736ff047f 100644
--- a/arch/arm/mach-highbank/Makefile
+++ b/arch/arm/mach-highbank/Makefile
@@ -1,2 +1,4 @@
1obj-y := clock.o highbank.o system.o 1obj-y := clock.o highbank.o system.o
2obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o 2obj-$(CONFIG_DEBUG_HIGHBANK_UART) += lluart.o
3obj-$(CONFIG_SMP) += platsmp.o
4obj-$(CONFIG_LOCAL_TIMERS) += localtimer.o
diff --git a/arch/arm/mach-highbank/localtimer.c b/arch/arm/mach-highbank/localtimer.c
new file mode 100644
index 000000000000..5a00e7945fdf
--- /dev/null
+++ b/arch/arm/mach-highbank/localtimer.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright 2010-2011 Calxeda, Inc.
3 * Based on localtimer.c, Copyright (C) 2002 ARM Ltd.
4 *
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.
8 *
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
12 * more details.
13 *
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/>.
16 */
17#include <linux/init.h>
18#include <linux/clockchips.h>
19#include <linux/of.h>
20#include <linux/of_address.h>
21#include <linux/of_irq.h>
22
23#include <asm/smp_twd.h>
24
25/*
26 * Setup the local clock events for a CPU.
27 */
28int __cpuinit local_timer_setup(struct clock_event_device *evt)
29{
30 struct device_node *np;
31
32 np = of_find_compatible_node(NULL, NULL, "arm,smp-twd");
33 if (!twd_base) {
34 twd_base = of_iomap(np, 0);
35 WARN_ON(!twd_base);
36 }
37 evt->irq = irq_of_parse_and_map(np, 0);
38 twd_timer_setup(evt);
39 return 0;
40}
diff --git a/arch/arm/mach-highbank/platsmp.c b/arch/arm/mach-highbank/platsmp.c
new file mode 100644
index 000000000000..d01364c72b45
--- /dev/null
+++ b/arch/arm/mach-highbank/platsmp.c
@@ -0,0 +1,78 @@
1/*
2 * Copyright 2010-2011 Calxeda, Inc.
3 * Based on platsmp.c, Copyright (C) 2002 ARM Ltd.
4 *
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.
8 *
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
12 * more details.
13 *
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/>.
16 */
17#include <linux/init.h>
18#include <linux/smp.h>
19#include <linux/io.h>
20
21#include <asm/smp_scu.h>
22#include <asm/hardware/gic.h>
23
24#include "core.h"
25
26extern void secondary_startup(void);
27
28void __cpuinit platform_secondary_init(unsigned int cpu)
29{
30 gic_secondary_init(0);
31}
32
33int __cpuinit boot_secondary(unsigned int cpu, struct task_struct *idle)
34{
35 gic_raise_softirq(cpumask_of(cpu), 0);
36 return 0;
37}
38
39/*
40 * Initialise the CPU possible map early - this describes the CPUs
41 * which may be present or become present in the system.
42 */
43void __init smp_init_cpus(void)
44{
45 unsigned int i, ncores;
46
47 ncores = scu_get_core_count(scu_base_addr);
48
49 /* sanity check */
50 if (ncores > NR_CPUS) {
51 printk(KERN_WARNING
52 "highbank: no. of cores (%d) greater than configured "
53 "maximum of %d - clipping\n",
54 ncores, NR_CPUS);
55 ncores = NR_CPUS;
56 }
57
58 for (i = 0; i < ncores; i++)
59 set_cpu_possible(i, true);
60
61 set_smp_cross_call(gic_raise_softirq);
62}
63
64void __init platform_smp_prepare_cpus(unsigned int max_cpus)
65{
66 int i;
67
68 scu_enable(scu_base_addr);
69
70 /*
71 * Write the address of secondary startup into the jump table
72 * The cores are in wfi and wait until they receive a soft interrupt
73 * and a non-zero value to jump to. Then the secondary CPU branches
74 * to this address.
75 */
76 for (i = 1; i < max_cpus; i++)
77 highbank_set_cpu_jump(i, secondary_startup);
78}