aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2013-10-01 04:13:16 -0400
committerSimon Horman <horms+renesas@verge.net.au>2013-10-07 20:29:16 -0400
commit2349199db55bfb99e2ebdce285a7e297ba63a7ef (patch)
tree092b3120ed00aff3704bac57dbe0b4bd4c64789c /arch/arm
parent90e27a05f64b8b4b6021cd996bef957656a8c8ab (diff)
ARM: shmobile: r8a7791 SMP support
Tie in the APMU SMP code on r8a7791. When used together with the secondary CPU device node and smp_ops in the board specific code then this will allow use of the two Cortex-A15 cores in the r8a7791 SoC. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/include/mach/r8a7791.h1
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c1
-rw-r--r--arch/arm/mach-shmobile/smp-r8a7791.c62
4 files changed, 65 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 95e48d129ddc..f2d40edadcc9 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -40,6 +40,7 @@ smp-y := platsmp.o headsmp.o
40smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o 40smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o
41smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o 41smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o
42smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o platsmp-apmu.o 42smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o platsmp-apmu.o
43smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o platsmp-apmu.o
43smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o 44smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o
44 45
45# IRQ objects 46# IRQ objects
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h
index 2a86a5394672..051ead3c286e 100644
--- a/arch/arm/mach-shmobile/include/mach/r8a7791.h
+++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h
@@ -5,5 +5,6 @@ void r8a7791_add_standard_devices(void);
5void r8a7791_add_dt_devices(void); 5void r8a7791_add_dt_devices(void);
6void r8a7791_clock_init(void); 6void r8a7791_clock_init(void);
7void r8a7791_init_early(void); 7void r8a7791_init_early(void);
8extern struct smp_operations r8a7791_smp_ops;
8 9
9#endif /* __ASM_R8A7791_H__ */ 10#endif /* __ASM_R8A7791_H__ */
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index cb3859b4cc95..d9393d61ee27 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -176,6 +176,7 @@ static const char *r8a7791_boards_compat_dt[] __initdata = {
176}; 176};
177 177
178DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") 178DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)")
179 .smp = smp_ops(r8a7791_smp_ops),
179 .init_early = r8a7791_init_early, 180 .init_early = r8a7791_init_early,
180 .init_time = rcar_gen2_timer_init, 181 .init_time = rcar_gen2_timer_init,
181 .dt_compat = r8a7791_boards_compat_dt, 182 .dt_compat = r8a7791_boards_compat_dt,
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c
new file mode 100644
index 000000000000..2df5bd190fe4
--- /dev/null
+++ b/arch/arm/mach-shmobile/smp-r8a7791.c
@@ -0,0 +1,62 @@
1/*
2 * SMP support for r8a7791
3 *
4 * Copyright (C) 2013 Renesas Solutions Corp.
5 * Copyright (C) 2013 Magnus Damm
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16#include <linux/kernel.h>
17#include <linux/init.h>
18#include <linux/smp.h>
19#include <linux/io.h>
20#include <asm/smp_plat.h>
21#include <mach/common.h>
22#include <mach/r8a7791.h>
23
24#define RST 0xe6160000
25#define CA15BAR 0x0020
26#define CA15RESCNT 0x0040
27#define RAM 0xe6300000
28
29static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus)
30{
31 void __iomem *p;
32 u32 bar;
33
34 /* let APMU code install data related to shmobile_boot_vector */
35 shmobile_smp_apmu_prepare_cpus(max_cpus);
36
37 /* RAM for jump stub, because BAR requires 256KB aligned address */
38 p = ioremap_nocache(RAM, shmobile_boot_size);
39 memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size);
40 iounmap(p);
41
42 /* setup reset vectors */
43 p = ioremap_nocache(RST, 0x63);
44 bar = (RAM >> 8) & 0xfffffc00;
45 writel_relaxed(bar, p + CA15BAR);
46 writel_relaxed(bar | 0x10, p + CA15BAR);
47
48 /* enable clocks to all CPUs */
49 writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000,
50 p + CA15RESCNT);
51 iounmap(p);
52}
53
54struct smp_operations r8a7791_smp_ops __initdata = {
55 .smp_prepare_cpus = r8a7791_smp_prepare_cpus,
56 .smp_boot_secondary = shmobile_smp_apmu_boot_secondary,
57#ifdef CONFIG_HOTPLUG_CPU
58 .cpu_disable = shmobile_smp_cpu_disable,
59 .cpu_die = shmobile_smp_apmu_cpu_die,
60 .cpu_kill = shmobile_smp_apmu_cpu_kill,
61#endif
62};