diff options
author | Olof Johansson <olof@lixom.net> | 2014-06-03 00:47:46 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2014-06-17 11:09:45 -0400 |
commit | 1754c42e3db5f45dbd8d509f0366b4ed97687180 (patch) | |
tree | e874d8829f951f81e43a4bdd65cc0409d56385d9 /arch/arm/mach-exynos | |
parent | 1ad58443cfa7a60a058f1b956054f19a1d00162d (diff) |
ARM: exynos: move sysram info to exynos.c
This solves a problem with building with CONFIG_SMP=n due to missing
sysram_base_addr (or sysram_ns_base_addr) variables.
The new setup method is more awkward than I'd like for it to be, but
it can't be done in init_early() since ioremap is not yet available,
but it needs to happen before SMP.
Reported-by: Russell King <linux@arm.linux.org.uk>
Cc: Kukjin Kim <kgene.kim@samsung.com>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Olof Johansson <olof@lixom.net>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r-- | arch/arm/mach-exynos/common.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-exynos/exynos.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-exynos/platsmp.c | 26 |
3 files changed, 32 insertions, 24 deletions
diff --git a/arch/arm/mach-exynos/common.h b/arch/arm/mach-exynos/common.h index 16617bdb37a9..1ee91763fa7c 100644 --- a/arch/arm/mach-exynos/common.h +++ b/arch/arm/mach-exynos/common.h | |||
@@ -118,6 +118,7 @@ extern void __iomem *sysram_ns_base_addr; | |||
118 | extern void __iomem *sysram_base_addr; | 118 | extern void __iomem *sysram_base_addr; |
119 | void exynos_init_io(void); | 119 | void exynos_init_io(void); |
120 | void exynos_restart(enum reboot_mode mode, const char *cmd); | 120 | void exynos_restart(enum reboot_mode mode, const char *cmd); |
121 | void exynos_sysram_init(void); | ||
121 | void exynos_cpuidle_init(void); | 122 | void exynos_cpuidle_init(void); |
122 | void exynos_cpufreq_init(void); | 123 | void exynos_cpufreq_init(void); |
123 | void exynos_init_late(void); | 124 | void exynos_init_late(void); |
diff --git a/arch/arm/mach-exynos/exynos.c b/arch/arm/mach-exynos/exynos.c index 90aab4d75d08..fb1eadd9e30c 100644 --- a/arch/arm/mach-exynos/exynos.c +++ b/arch/arm/mach-exynos/exynos.c | |||
@@ -184,6 +184,28 @@ void __init exynos_cpufreq_init(void) | |||
184 | platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); | 184 | platform_device_register_simple("exynos-cpufreq", -1, NULL, 0); |
185 | } | 185 | } |
186 | 186 | ||
187 | void __iomem *sysram_base_addr; | ||
188 | void __iomem *sysram_ns_base_addr; | ||
189 | |||
190 | void __init exynos_sysram_init(void) | ||
191 | { | ||
192 | struct device_node *node; | ||
193 | |||
194 | for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { | ||
195 | if (!of_device_is_available(node)) | ||
196 | continue; | ||
197 | sysram_base_addr = of_iomap(node, 0); | ||
198 | break; | ||
199 | } | ||
200 | |||
201 | for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { | ||
202 | if (!of_device_is_available(node)) | ||
203 | continue; | ||
204 | sysram_ns_base_addr = of_iomap(node, 0); | ||
205 | break; | ||
206 | } | ||
207 | } | ||
208 | |||
187 | void __init exynos_init_late(void) | 209 | void __init exynos_init_late(void) |
188 | { | 210 | { |
189 | if (of_machine_is_compatible("samsung,exynos5440")) | 211 | if (of_machine_is_compatible("samsung,exynos5440")) |
@@ -271,6 +293,13 @@ static void __init exynos_dt_machine_init(void) | |||
271 | } | 293 | } |
272 | } | 294 | } |
273 | 295 | ||
296 | /* | ||
297 | * This is called from smp_prepare_cpus if we've built for SMP, but | ||
298 | * we still need to set it up for PM and firmware ops if not. | ||
299 | */ | ||
300 | if (!IS_ENABLED(SMP)) | ||
301 | exynos_sysram_init(); | ||
302 | |||
274 | exynos_cpuidle_init(); | 303 | exynos_cpuidle_init(); |
275 | exynos_cpufreq_init(); | 304 | exynos_cpufreq_init(); |
276 | 305 | ||
diff --git a/arch/arm/mach-exynos/platsmp.c b/arch/arm/mach-exynos/platsmp.c index ec02422e8499..1c8d31e39520 100644 --- a/arch/arm/mach-exynos/platsmp.c +++ b/arch/arm/mach-exynos/platsmp.c | |||
@@ -32,28 +32,6 @@ | |||
32 | 32 | ||
33 | extern void exynos4_secondary_startup(void); | 33 | extern void exynos4_secondary_startup(void); |
34 | 34 | ||
35 | void __iomem *sysram_base_addr; | ||
36 | void __iomem *sysram_ns_base_addr; | ||
37 | |||
38 | static void __init exynos_smp_prepare_sysram(void) | ||
39 | { | ||
40 | struct device_node *node; | ||
41 | |||
42 | for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram") { | ||
43 | if (!of_device_is_available(node)) | ||
44 | continue; | ||
45 | sysram_base_addr = of_iomap(node, 0); | ||
46 | break; | ||
47 | } | ||
48 | |||
49 | for_each_compatible_node(node, NULL, "samsung,exynos4210-sysram-ns") { | ||
50 | if (!of_device_is_available(node)) | ||
51 | continue; | ||
52 | sysram_ns_base_addr = of_iomap(node, 0); | ||
53 | break; | ||
54 | } | ||
55 | } | ||
56 | |||
57 | static inline void __iomem *cpu_boot_reg_base(void) | 35 | static inline void __iomem *cpu_boot_reg_base(void) |
58 | { | 36 | { |
59 | if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) | 37 | if (soc_is_exynos4210() && samsung_rev() == EXYNOS4210_REV_1_1) |
@@ -234,11 +212,11 @@ static void __init exynos_smp_prepare_cpus(unsigned int max_cpus) | |||
234 | { | 212 | { |
235 | int i; | 213 | int i; |
236 | 214 | ||
215 | exynos_sysram_init(); | ||
216 | |||
237 | if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9) | 217 | if (read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9) |
238 | scu_enable(scu_base_addr()); | 218 | scu_enable(scu_base_addr()); |
239 | 219 | ||
240 | exynos_smp_prepare_sysram(); | ||
241 | |||
242 | /* | 220 | /* |
243 | * Write the address of secondary startup into the | 221 | * Write the address of secondary startup into the |
244 | * system-wide flags register. The boot monitor waits | 222 | * system-wide flags register. The boot monitor waits |