diff options
author | Magnus Damm <damm@opensource.se> | 2013-07-31 03:07:31 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-08-06 05:07:25 -0400 |
commit | 0ca2894b5a9007091ad1a4d82b9f3132d4dd9410 (patch) | |
tree | c94d6f05f78ee35b8f9e6e21ddb9509d414d5697 /arch/arm/mach-shmobile | |
parent | 12eb8474386228c91e35be031d7c3eaa1318b5cf (diff) |
ARM: shmobile: Use shared SCU SMP boot code on r8a7779
Use shared SCU code on r8a7779 for SMP boot.
Signed-off-by: Magnus Damm <damm@opensource.se>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/smp-r8a7779.c | 23 |
2 files changed, 13 insertions, 12 deletions
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index a32dc1584a25..42bbf45493e5 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -18,7 +18,7 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o clock-emev2.o | |||
18 | # SMP objects | 18 | # SMP objects |
19 | smp-y := platsmp.o headsmp.o | 19 | smp-y := platsmp.o headsmp.o |
20 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o | 20 | smp-$(CONFIG_ARCH_SH73A0) += smp-sh73a0.o headsmp-scu.o platsmp-scu.o |
21 | smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o | 21 | smp-$(CONFIG_ARCH_R8A7779) += smp-r8a7779.o headsmp-scu.o platsmp-scu.o |
22 | smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o | 22 | smp-$(CONFIG_ARCH_EMEV2) += smp-emev2.o headsmp-scu.o |
23 | 23 | ||
24 | # IRQ objects | 24 | # IRQ objects |
diff --git a/arch/arm/mach-shmobile/smp-r8a7779.c b/arch/arm/mach-shmobile/smp-r8a7779.c index bb3adae7de0f..1963d0d42afb 100644 --- a/arch/arm/mach-shmobile/smp-r8a7779.c +++ b/arch/arm/mach-shmobile/smp-r8a7779.c | |||
@@ -84,33 +84,34 @@ static int r8a7779_platform_cpu_kill(unsigned int cpu) | |||
84 | static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) | 84 | static int __cpuinit r8a7779_boot_secondary(unsigned int cpu, struct task_struct *idle) |
85 | { | 85 | { |
86 | struct r8a7779_pm_ch *ch = NULL; | 86 | struct r8a7779_pm_ch *ch = NULL; |
87 | int ret = -EIO; | 87 | unsigned int lcpu = cpu_logical_map(cpu); |
88 | int ret; | ||
88 | 89 | ||
89 | cpu = cpu_logical_map(cpu); | 90 | ret = shmobile_smp_scu_boot_secondary(cpu, idle); |
91 | if (ret) | ||
92 | return ret; | ||
90 | 93 | ||
91 | if (cpu < ARRAY_SIZE(r8a7779_ch_cpu)) | 94 | if (lcpu < ARRAY_SIZE(r8a7779_ch_cpu)) |
92 | ch = r8a7779_ch_cpu[cpu]; | 95 | ch = r8a7779_ch_cpu[lcpu]; |
93 | 96 | ||
94 | if (ch) | 97 | if (ch) |
95 | ret = r8a7779_sysc_power_up(ch); | 98 | ret = r8a7779_sysc_power_up(ch); |
99 | else | ||
100 | ret = -EIO; | ||
96 | 101 | ||
97 | return ret; | 102 | return ret; |
98 | } | 103 | } |
99 | 104 | ||
100 | static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) | 105 | static void __init r8a7779_smp_prepare_cpus(unsigned int max_cpus) |
101 | { | 106 | { |
102 | |||
103 | /* setup r8a7779 specific SCU base */ | ||
104 | shmobile_scu_base = IOMEM(R8A7779_SCU_BASE); | ||
105 | scu_enable(shmobile_scu_base); | ||
106 | |||
107 | /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ | 107 | /* Map the reset vector (in headsmp-scu.S, headsmp.S) */ |
108 | __raw_writel(__pa(shmobile_boot_vector), AVECR); | 108 | __raw_writel(__pa(shmobile_boot_vector), AVECR); |
109 | shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); | 109 | shmobile_boot_fn = virt_to_phys(shmobile_boot_scu); |
110 | shmobile_boot_arg = (unsigned long)shmobile_scu_base; | 110 | shmobile_boot_arg = (unsigned long)shmobile_scu_base; |
111 | 111 | ||
112 | /* enable cache coherency on booting CPU */ | 112 | /* setup r8a7779 specific SCU bits */ |
113 | scu_power_mode(shmobile_scu_base, SCU_PM_NORMAL); | 113 | shmobile_scu_base = IOMEM(R8A7779_SCU_BASE); |
114 | shmobile_smp_scu_prepare_cpus(max_cpus); | ||
114 | 115 | ||
115 | r8a7779_pm_init(); | 116 | r8a7779_pm_init(); |
116 | 117 | ||