diff options
author | Olof Johansson <olof@lixom.net> | 2014-07-12 12:44:52 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2014-07-12 12:44:52 -0400 |
commit | e87d10b29f459e23964b14fe2300f808c5b6282e (patch) | |
tree | 50f3f9dc4edf56c04057bc22942dc906ee7a381a | |
parent | e1ddcdef841f68d175b1a4a5c91d55f383ce5241 (diff) | |
parent | bfe4cfa8ae21628267f2b879b4396ee17ea4fd3a (diff) |
Merge tag 'renesas-soc2-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Merge "Second Round of Renesas ARM Based SoC Updates for v3.17" from Simon
Horman:
* Suspend on non-SMP update for r8a7790
* Move r8a7791.h out of mach directory.
This is part of a multi-stage effort to move headers
out of that directory.
* tag 'renesas-soc2-for-v3.17' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas:
ARM: shmobile: Allow r8a7791 to build non-SMP APMU code
ARM: shmobile: Move r8a7791 reset code to pm-r8a7791.c
ARM: shmobile: Allow r8a7790 to build non-SMP APMU code
ARM: shmobile: Move r8a7790 reset code to pm-r8a7790.c
ARM: shmobile: Use __init for APMU suspend init function
ARM: shmobile: Adjust APMU code to build for non-SMP
ARM: shmobile: Allow use of boot code for non-SMP case
ARM: shmobile: Move r8a7791.h
Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 21 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch-reference.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/headsmp.S | 13 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/platsmp-apmu.c | 13 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/pm-r8a7790.c | 43 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/pm-r8a7791.c | 30 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/r8a7791.h (renamed from arch/arm/mach-shmobile/include/mach/r8a7791.h) | 0 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7791.c | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-r8a7790.c | 31 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-r8a7791.c | 29 |
11 files changed, 108 insertions, 84 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index ccb056327fd4..fe3878a1a69a 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -34,17 +34,19 @@ obj-$(CONFIG_ARCH_R8A7791) += clock-r8a7791.o | |||
34 | obj-$(CONFIG_ARCH_R7S72100) += clock-r7s72100.o | 34 | obj-$(CONFIG_ARCH_R7S72100) += clock-r7s72100.o |
35 | endif | 35 | endif |
36 | 36 | ||
37 | # CPU reset vector handling objects | ||
38 | cpu-y := platsmp.o headsmp.o | ||
39 | cpu-$(CONFIG_ARCH_R8A7790) += platsmp-apmu.o | ||
40 | cpu-$(CONFIG_ARCH_R8A7791) += platsmp-apmu.o | ||
41 | |||
37 | # SMP objects | 42 | # SMP objects |
38 | smp-y := platsmp.o headsmp.o | 43 | smp-y := $(cpu-y) |
39 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o | 44 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o |
40 | smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o | 45 | smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o |
41 | smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o platsmp-apmu.o | 46 | smp-$(CONFIG_ARCH_R8A7790) += smp-r8a7790.o |
42 | smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o platsmp-apmu.o | 47 | smp-$(CONFIG_ARCH_R8A7791) += smp-r8a7791.o |
43 | smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o | 48 | smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o platsmp-scu.o |
44 | 49 | ||
45 | # IRQ objects | ||
46 | obj-$(CONFIG_ARCH_SH7372) += entry-intc.o | ||
47 | |||
48 | # PM objects | 50 | # PM objects |
49 | obj-$(CONFIG_SUSPEND) += suspend.o | 51 | obj-$(CONFIG_SUSPEND) += suspend.o |
50 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o | 52 | obj-$(CONFIG_CPU_IDLE) += cpuidle.o |
@@ -53,8 +55,11 @@ obj-$(CONFIG_ARCH_SH7372) += pm-sh7372.o sleep-sh7372.o pm-rmobile.o | |||
53 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o | 55 | obj-$(CONFIG_ARCH_SH73A0) += pm-sh73a0.o |
54 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o | 56 | obj-$(CONFIG_ARCH_R8A7740) += pm-r8a7740.o pm-rmobile.o |
55 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o | 57 | obj-$(CONFIG_ARCH_R8A7779) += pm-r8a7779.o pm-rcar.o |
56 | obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o | 58 | obj-$(CONFIG_ARCH_R8A7790) += pm-r8a7790.o pm-rcar.o $(cpu-y) |
57 | obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o | 59 | obj-$(CONFIG_ARCH_R8A7791) += pm-r8a7791.o pm-rcar.o $(cpu-y) |
60 | |||
61 | # IRQ objects | ||
62 | obj-$(CONFIG_ARCH_SH7372) += entry-intc.o | ||
58 | 63 | ||
59 | # Board objects | 64 | # Board objects |
60 | ifdef CONFIG_ARCH_SHMOBILE_MULTI | 65 | ifdef CONFIG_ARCH_SHMOBILE_MULTI |
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index 1d3f67d4ccd6..0b1fb2345aa1 100644 --- a/arch/arm/mach-shmobile/board-koelsch-reference.c +++ b/arch/arm/mach-shmobile/board-koelsch-reference.c | |||
@@ -23,11 +23,13 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/of_platform.h> | 24 | #include <linux/of_platform.h> |
25 | #include <linux/platform_data/rcar-du.h> | 25 | #include <linux/platform_data/rcar-du.h> |
26 | #include <mach/r8a7791.h> | 26 | |
27 | #include <asm/mach/arch.h> | 27 | #include <asm/mach/arch.h> |
28 | |||
28 | #include "clock.h" | 29 | #include "clock.h" |
29 | #include "common.h" | 30 | #include "common.h" |
30 | #include "irqs.h" | 31 | #include "irqs.h" |
32 | #include "r8a7791.h" | ||
31 | #include "rcar-gen2.h" | 33 | #include "rcar-gen2.h" |
32 | 34 | ||
33 | /* DU */ | 35 | /* DU */ |
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 0d44e7eb6508..e698b90ae761 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -45,11 +45,13 @@ | |||
45 | #include <linux/spi/flash.h> | 45 | #include <linux/spi/flash.h> |
46 | #include <linux/spi/rspi.h> | 46 | #include <linux/spi/rspi.h> |
47 | #include <linux/spi/spi.h> | 47 | #include <linux/spi/spi.h> |
48 | #include <mach/r8a7791.h> | 48 | |
49 | #include <asm/mach-types.h> | 49 | #include <asm/mach-types.h> |
50 | #include <asm/mach/arch.h> | 50 | #include <asm/mach/arch.h> |
51 | |||
51 | #include "common.h" | 52 | #include "common.h" |
52 | #include "irqs.h" | 53 | #include "irqs.h" |
54 | #include "r8a7791.h" | ||
53 | #include "rcar-gen2.h" | 55 | #include "rcar-gen2.h" |
54 | 56 | ||
55 | /* DU */ | 57 | /* DU */ |
diff --git a/arch/arm/mach-shmobile/headsmp.S b/arch/arm/mach-shmobile/headsmp.S index e5be5c88644b..faf82144a262 100644 --- a/arch/arm/mach-shmobile/headsmp.S +++ b/arch/arm/mach-shmobile/headsmp.S | |||
@@ -10,14 +10,17 @@ | |||
10 | * it under the terms of the GNU General Public License version 2 as | 10 | * it under the terms of the GNU General Public License version 2 as |
11 | * published by the Free Software Foundation. | 11 | * published by the Free Software Foundation. |
12 | */ | 12 | */ |
13 | #include <linux/linkage.h> | ||
14 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/linkage.h> | ||
15 | #include <linux/threads.h> | ||
15 | #include <asm/memory.h> | 16 | #include <asm/memory.h> |
16 | 17 | ||
18 | #ifdef CONFIG_SMP | ||
17 | ENTRY(shmobile_invalidate_start) | 19 | ENTRY(shmobile_invalidate_start) |
18 | bl v7_invalidate_l1 | 20 | bl v7_invalidate_l1 |
19 | b secondary_startup | 21 | b secondary_startup |
20 | ENDPROC(shmobile_invalidate_start) | 22 | ENDPROC(shmobile_invalidate_start) |
23 | #endif | ||
21 | 24 | ||
22 | /* | 25 | /* |
23 | * Reset vector for secondary CPUs. | 26 | * Reset vector for secondary CPUs. |
@@ -68,7 +71,7 @@ shmobile_smp_boot_find_mpidr: | |||
68 | 71 | ||
69 | shmobile_smp_boot_next: | 72 | shmobile_smp_boot_next: |
70 | add r1, r1, #1 | 73 | add r1, r1, #1 |
71 | cmp r1, #CONFIG_NR_CPUS | 74 | cmp r1, #NR_CPUS |
72 | blo shmobile_smp_boot_find_mpidr | 75 | blo shmobile_smp_boot_find_mpidr |
73 | 76 | ||
74 | b shmobile_smp_sleep | 77 | b shmobile_smp_sleep |
@@ -85,10 +88,10 @@ ENDPROC(shmobile_smp_sleep) | |||
85 | 88 | ||
86 | .globl shmobile_smp_mpidr | 89 | .globl shmobile_smp_mpidr |
87 | shmobile_smp_mpidr: | 90 | shmobile_smp_mpidr: |
88 | 1: .space CONFIG_NR_CPUS * 4 | 91 | 1: .space NR_CPUS * 4 |
89 | .globl shmobile_smp_fn | 92 | .globl shmobile_smp_fn |
90 | shmobile_smp_fn: | 93 | shmobile_smp_fn: |
91 | 2: .space CONFIG_NR_CPUS * 4 | 94 | 2: .space NR_CPUS * 4 |
92 | .globl shmobile_smp_arg | 95 | .globl shmobile_smp_arg |
93 | shmobile_smp_arg: | 96 | shmobile_smp_arg: |
94 | 3: .space CONFIG_NR_CPUS * 4 | 97 | 3: .space NR_CPUS * 4 |
diff --git a/arch/arm/mach-shmobile/platsmp-apmu.c b/arch/arm/mach-shmobile/platsmp-apmu.c index 590e35c22a60..a05b16d88257 100644 --- a/arch/arm/mach-shmobile/platsmp-apmu.c +++ b/arch/arm/mach-shmobile/platsmp-apmu.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/of_address.h> | 15 | #include <linux/of_address.h> |
16 | #include <linux/smp.h> | 16 | #include <linux/smp.h> |
17 | #include <linux/suspend.h> | 17 | #include <linux/suspend.h> |
18 | #include <linux/threads.h> | ||
18 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
19 | #include <asm/cp15.h> | 20 | #include <asm/cp15.h> |
20 | #include <asm/proc-fns.h> | 21 | #include <asm/proc-fns.h> |
@@ -25,13 +26,13 @@ | |||
25 | static struct { | 26 | static struct { |
26 | void __iomem *iomem; | 27 | void __iomem *iomem; |
27 | int bit; | 28 | int bit; |
28 | } apmu_cpus[CONFIG_NR_CPUS]; | 29 | } apmu_cpus[NR_CPUS]; |
29 | 30 | ||
30 | #define WUPCR_OFFS 0x10 | 31 | #define WUPCR_OFFS 0x10 |
31 | #define PSTR_OFFS 0x40 | 32 | #define PSTR_OFFS 0x40 |
32 | #define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) | 33 | #define CPUNCR_OFFS(n) (0x100 + (0x10 * (n))) |
33 | 34 | ||
34 | static int apmu_power_on(void __iomem *p, int bit) | 35 | static int __maybe_unused apmu_power_on(void __iomem *p, int bit) |
35 | { | 36 | { |
36 | /* request power on */ | 37 | /* request power on */ |
37 | writel_relaxed(BIT(bit), p + WUPCR_OFFS); | 38 | writel_relaxed(BIT(bit), p + WUPCR_OFFS); |
@@ -50,7 +51,7 @@ static int apmu_power_off(void __iomem *p, int bit) | |||
50 | return 0; | 51 | return 0; |
51 | } | 52 | } |
52 | 53 | ||
53 | static int apmu_power_off_poll(void __iomem *p, int bit) | 54 | static int __maybe_unused apmu_power_off_poll(void __iomem *p, int bit) |
54 | { | 55 | { |
55 | int k; | 56 | int k; |
56 | 57 | ||
@@ -73,7 +74,7 @@ static int apmu_wrap(int cpu, int (*fn)(void __iomem *p, int cpu)) | |||
73 | 74 | ||
74 | static void apmu_init_cpu(struct resource *res, int cpu, int bit) | 75 | static void apmu_init_cpu(struct resource *res, int cpu, int bit) |
75 | { | 76 | { |
76 | if (apmu_cpus[cpu].iomem) | 77 | if ((cpu >= ARRAY_SIZE(apmu_cpus)) || apmu_cpus[cpu].iomem) |
77 | return; | 78 | return; |
78 | 79 | ||
79 | apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); | 80 | apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res)); |
@@ -137,6 +138,7 @@ void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus) | |||
137 | apmu_parse_cfg(apmu_init_cpu); | 138 | apmu_parse_cfg(apmu_init_cpu); |
138 | } | 139 | } |
139 | 140 | ||
141 | #ifdef CONFIG_SMP | ||
140 | int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) | 142 | int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) |
141 | { | 143 | { |
142 | /* For this particular CPU register boot vector */ | 144 | /* For this particular CPU register boot vector */ |
@@ -144,6 +146,7 @@ int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle) | |||
144 | 146 | ||
145 | return apmu_wrap(cpu, apmu_power_on); | 147 | return apmu_wrap(cpu, apmu_power_on); |
146 | } | 148 | } |
149 | #endif | ||
147 | 150 | ||
148 | #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) | 151 | #if defined(CONFIG_HOTPLUG_CPU) || defined(CONFIG_SUSPEND) |
149 | /* nicked from arch/arm/mach-exynos/hotplug.c */ | 152 | /* nicked from arch/arm/mach-exynos/hotplug.c */ |
@@ -237,7 +240,7 @@ static int shmobile_smp_apmu_enter_suspend(suspend_state_t state) | |||
237 | return 0; | 240 | return 0; |
238 | } | 241 | } |
239 | 242 | ||
240 | void shmobile_smp_apmu_suspend_init(void) | 243 | void __init shmobile_smp_apmu_suspend_init(void) |
241 | { | 244 | { |
242 | shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; | 245 | shmobile_suspend_ops.enter = shmobile_smp_apmu_enter_suspend; |
243 | } | 246 | } |
diff --git a/arch/arm/mach-shmobile/pm-r8a7790.c b/arch/arm/mach-shmobile/pm-r8a7790.c index 8845433a00b3..80e8d95e54d3 100644 --- a/arch/arm/mach-shmobile/pm-r8a7790.c +++ b/arch/arm/mach-shmobile/pm-r8a7790.c | |||
@@ -11,12 +11,22 @@ | |||
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | 14 | #include <linux/smp.h> | |
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | 16 | #include "common.h" | |
17 | #include "pm-rcar.h" | 17 | #include "pm-rcar.h" |
18 | #include "r8a7790.h" | 18 | #include "r8a7790.h" |
19 | 19 | ||
20 | /* RST */ | ||
21 | #define RST 0xe6160000 | ||
22 | #define CA15BAR 0x0020 | ||
23 | #define CA7BAR 0x0030 | ||
24 | #define CA15RESCNT 0x0040 | ||
25 | #define CA7RESCNT 0x0044 | ||
26 | |||
27 | /* On-chip RAM */ | ||
28 | #define MERAM 0xe8080000 | ||
29 | |||
20 | /* SYSC */ | 30 | /* SYSC */ |
21 | #define SYSCIER 0x0c | 31 | #define SYSCIER 0x0c |
22 | #define SYSCIMR 0x10 | 32 | #define SYSCIMR 0x10 |
@@ -40,8 +50,33 @@ static inline void r8a7790_sysc_init(void) {} | |||
40 | 50 | ||
41 | void __init r8a7790_pm_init(void) | 51 | void __init r8a7790_pm_init(void) |
42 | { | 52 | { |
53 | void __iomem *p; | ||
54 | u32 bar; | ||
43 | static int once; | 55 | static int once; |
44 | 56 | ||
45 | if (!once++) | 57 | if (once++) |
46 | r8a7790_sysc_init(); | 58 | return; |
59 | |||
60 | /* MERAM for jump stub, because BAR requires 256KB aligned address */ | ||
61 | p = ioremap_nocache(MERAM, shmobile_boot_size); | ||
62 | memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); | ||
63 | iounmap(p); | ||
64 | |||
65 | /* setup reset vectors */ | ||
66 | p = ioremap_nocache(RST, 0x63); | ||
67 | bar = (MERAM >> 8) & 0xfffffc00; | ||
68 | writel_relaxed(bar, p + CA15BAR); | ||
69 | writel_relaxed(bar, p + CA7BAR); | ||
70 | writel_relaxed(bar | 0x10, p + CA15BAR); | ||
71 | writel_relaxed(bar | 0x10, p + CA7BAR); | ||
72 | |||
73 | /* de-assert reset for all CPUs */ | ||
74 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, | ||
75 | p + CA15RESCNT); | ||
76 | writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, | ||
77 | p + CA7RESCNT); | ||
78 | iounmap(p); | ||
79 | |||
80 | r8a7790_sysc_init(); | ||
81 | shmobile_smp_apmu_suspend_init(); | ||
47 | } | 82 | } |
diff --git a/arch/arm/mach-shmobile/pm-r8a7791.c b/arch/arm/mach-shmobile/pm-r8a7791.c index 15190875d507..25f107bb3657 100644 --- a/arch/arm/mach-shmobile/pm-r8a7791.c +++ b/arch/arm/mach-shmobile/pm-r8a7791.c | |||
@@ -10,10 +10,17 @@ | |||
10 | * for more details. | 10 | * for more details. |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <asm/io.h> | ||
14 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
15 | #include <mach/r8a7791.h> | 14 | #include <linux/smp.h> |
15 | #include <asm/io.h> | ||
16 | #include "common.h" | ||
16 | #include "pm-rcar.h" | 17 | #include "pm-rcar.h" |
18 | #include "r8a7791.h" | ||
19 | |||
20 | #define RST 0xe6160000 | ||
21 | #define CA15BAR 0x0020 | ||
22 | #define CA15RESCNT 0x0040 | ||
23 | #define RAM 0xe6300000 | ||
17 | 24 | ||
18 | /* SYSC */ | 25 | /* SYSC */ |
19 | #define SYSCIER 0x0c | 26 | #define SYSCIER 0x0c |
@@ -38,10 +45,29 @@ static inline void r8a7791_sysc_init(void) {} | |||
38 | 45 | ||
39 | void __init r8a7791_pm_init(void) | 46 | void __init r8a7791_pm_init(void) |
40 | { | 47 | { |
48 | void __iomem *p; | ||
49 | u32 bar; | ||
41 | static int once; | 50 | static int once; |
42 | 51 | ||
43 | if (once++) | 52 | if (once++) |
44 | return; | 53 | return; |
45 | 54 | ||
55 | /* RAM for jump stub, because BAR requires 256KB aligned address */ | ||
56 | p = ioremap_nocache(RAM, shmobile_boot_size); | ||
57 | memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); | ||
58 | iounmap(p); | ||
59 | |||
60 | /* setup reset vectors */ | ||
61 | p = ioremap_nocache(RST, 0x63); | ||
62 | bar = (RAM >> 8) & 0xfffffc00; | ||
63 | writel_relaxed(bar, p + CA15BAR); | ||
64 | writel_relaxed(bar | 0x10, p + CA15BAR); | ||
65 | |||
66 | /* enable clocks to all CPUs */ | ||
67 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, | ||
68 | p + CA15RESCNT); | ||
69 | iounmap(p); | ||
70 | |||
46 | r8a7791_sysc_init(); | 71 | r8a7791_sysc_init(); |
72 | shmobile_smp_apmu_suspend_init(); | ||
47 | } | 73 | } |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/r8a7791.h index 86eae7bceb6f..86eae7bceb6f 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ b/arch/arm/mach-shmobile/r8a7791.h | |||
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index 7e970d005f7f..8823324ac5a9 100644 --- a/arch/arm/mach-shmobile/setup-r8a7791.c +++ b/arch/arm/mach-shmobile/setup-r8a7791.c | |||
@@ -26,10 +26,12 @@ | |||
26 | #include <linux/platform_data/irq-renesas-irqc.h> | 26 | #include <linux/platform_data/irq-renesas-irqc.h> |
27 | #include <linux/serial_sci.h> | 27 | #include <linux/serial_sci.h> |
28 | #include <linux/sh_timer.h> | 28 | #include <linux/sh_timer.h> |
29 | #include <mach/r8a7791.h> | 29 | |
30 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
31 | |||
31 | #include "common.h" | 32 | #include "common.h" |
32 | #include "irqs.h" | 33 | #include "irqs.h" |
34 | #include "r8a7791.h" | ||
33 | #include "rcar-gen2.h" | 35 | #include "rcar-gen2.h" |
34 | 36 | ||
35 | static const struct resource pfc_resources[] __initconst = { | 37 | static const struct resource pfc_resources[] __initconst = { |
diff --git a/arch/arm/mach-shmobile/smp-r8a7790.c b/arch/arm/mach-shmobile/smp-r8a7790.c index ad66beab2ea6..2311694636e1 100644 --- a/arch/arm/mach-shmobile/smp-r8a7790.c +++ b/arch/arm/mach-shmobile/smp-r8a7790.c | |||
@@ -24,13 +24,6 @@ | |||
24 | #include "pm-rcar.h" | 24 | #include "pm-rcar.h" |
25 | #include "r8a7790.h" | 25 | #include "r8a7790.h" |
26 | 26 | ||
27 | #define RST 0xe6160000 | ||
28 | #define CA15BAR 0x0020 | ||
29 | #define CA7BAR 0x0030 | ||
30 | #define CA15RESCNT 0x0040 | ||
31 | #define CA7RESCNT 0x0044 | ||
32 | #define MERAM 0xe8080000 | ||
33 | |||
34 | static struct rcar_sysc_ch r8a7790_ca15_scu = { | 27 | static struct rcar_sysc_ch r8a7790_ca15_scu = { |
35 | .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ | 28 | .chan_offs = 0x180, /* PWRSR5 .. PWRER5 */ |
36 | .isr_bit = 12, /* CA15-SCU */ | 29 | .isr_bit = 12, /* CA15-SCU */ |
@@ -43,35 +36,11 @@ static struct rcar_sysc_ch r8a7790_ca7_scu = { | |||
43 | 36 | ||
44 | static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) | 37 | static void __init r8a7790_smp_prepare_cpus(unsigned int max_cpus) |
45 | { | 38 | { |
46 | void __iomem *p; | ||
47 | u32 bar; | ||
48 | |||
49 | /* let APMU code install data related to shmobile_boot_vector */ | 39 | /* let APMU code install data related to shmobile_boot_vector */ |
50 | shmobile_smp_apmu_prepare_cpus(max_cpus); | 40 | shmobile_smp_apmu_prepare_cpus(max_cpus); |
51 | 41 | ||
52 | /* MERAM for jump stub, because BAR requires 256KB aligned address */ | ||
53 | p = ioremap_nocache(MERAM, shmobile_boot_size); | ||
54 | memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); | ||
55 | iounmap(p); | ||
56 | |||
57 | /* setup reset vectors */ | ||
58 | p = ioremap_nocache(RST, 0x63); | ||
59 | bar = (MERAM >> 8) & 0xfffffc00; | ||
60 | writel_relaxed(bar, p + CA15BAR); | ||
61 | writel_relaxed(bar, p + CA7BAR); | ||
62 | writel_relaxed(bar | 0x10, p + CA15BAR); | ||
63 | writel_relaxed(bar | 0x10, p + CA7BAR); | ||
64 | |||
65 | /* enable clocks to all CPUs */ | ||
66 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, | ||
67 | p + CA15RESCNT); | ||
68 | writel_relaxed((readl_relaxed(p + CA7RESCNT) & ~0x0f) | 0x5a5a0000, | ||
69 | p + CA7RESCNT); | ||
70 | iounmap(p); | ||
71 | |||
72 | /* turn on power to SCU */ | 42 | /* turn on power to SCU */ |
73 | r8a7790_pm_init(); | 43 | r8a7790_pm_init(); |
74 | shmobile_smp_apmu_suspend_init(); | ||
75 | rcar_sysc_power_up(&r8a7790_ca15_scu); | 44 | rcar_sysc_power_up(&r8a7790_ca15_scu); |
76 | rcar_sysc_power_up(&r8a7790_ca7_scu); | 45 | rcar_sysc_power_up(&r8a7790_ca7_scu); |
77 | } | 46 | } |
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index c6543b6ec759..f743386166fb 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c | |||
@@ -17,42 +17,19 @@ | |||
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/io.h> | 19 | #include <linux/io.h> |
20 | |||
20 | #include <asm/smp_plat.h> | 21 | #include <asm/smp_plat.h> |
21 | #include <mach/r8a7791.h> | 22 | |
22 | #include "common.h" | 23 | #include "common.h" |
24 | #include "r8a7791.h" | ||
23 | #include "rcar-gen2.h" | 25 | #include "rcar-gen2.h" |
24 | 26 | ||
25 | #define RST 0xe6160000 | ||
26 | #define CA15BAR 0x0020 | ||
27 | #define CA15RESCNT 0x0040 | ||
28 | #define RAM 0xe6300000 | ||
29 | |||
30 | static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) | 27 | static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) |
31 | { | 28 | { |
32 | void __iomem *p; | ||
33 | u32 bar; | ||
34 | |||
35 | /* let APMU code install data related to shmobile_boot_vector */ | 29 | /* let APMU code install data related to shmobile_boot_vector */ |
36 | shmobile_smp_apmu_prepare_cpus(max_cpus); | 30 | shmobile_smp_apmu_prepare_cpus(max_cpus); |
37 | 31 | ||
38 | /* RAM for jump stub, because BAR requires 256KB aligned address */ | ||
39 | p = ioremap_nocache(RAM, shmobile_boot_size); | ||
40 | memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); | ||
41 | iounmap(p); | ||
42 | |||
43 | /* setup reset vectors */ | ||
44 | p = ioremap_nocache(RST, 0x63); | ||
45 | bar = (RAM >> 8) & 0xfffffc00; | ||
46 | writel_relaxed(bar, p + CA15BAR); | ||
47 | writel_relaxed(bar | 0x10, p + CA15BAR); | ||
48 | |||
49 | /* enable clocks to all CPUs */ | ||
50 | writel_relaxed((readl_relaxed(p + CA15RESCNT) & ~0x0f) | 0xa5a50000, | ||
51 | p + CA15RESCNT); | ||
52 | iounmap(p); | ||
53 | |||
54 | r8a7791_pm_init(); | 32 | r8a7791_pm_init(); |
55 | shmobile_smp_apmu_suspend_init(); | ||
56 | } | 33 | } |
57 | 34 | ||
58 | static int r8a7791_smp_boot_secondary(unsigned int cpu, | 35 | static int r8a7791_smp_boot_secondary(unsigned int cpu, |