diff options
| author | Arnd Bergmann <arnd@arndb.de> | 2017-04-21 17:55:28 -0400 |
|---|---|---|
| committer | Arnd Bergmann <arnd@arndb.de> | 2017-05-09 15:13:25 -0400 |
| commit | 6f92120892d94ef6c551da5aa2cf7bc9401c9903 (patch) | |
| tree | 16c32c0e842bf59861f81f52dc1c12cc9a8c02b9 | |
| parent | c6778ff813d2ca3e3c8733c87dc8b6831a64578b (diff) | |
ARM: omap2+: make omap4_get_cpu1_ns_pa_addr declaration usable
When CONFIG_PM is disabled, we get a build error:
arch/arm/mach-omap2/omap-smp.c: In function 'omap4_smp_maybe_reset_cpu1':
arch/arm/mach-omap2/omap-smp.c:309:20: error: implicit declaration of function 'omap4_get_cpu1_ns_pa_addr'; did you mean 'omap4_get_scu_base'? [-Werror=implicit-function-declaration]
We need to fix this in multiple files, to ensure the declaration is visible,
to actually build the function without CONFIG_PM, and to only call it
when OMAP4 and/or OMAP5 are enabled.
Fixes: 351b7c490700 ("ARM: omap2+: Revert omap-smp.c changes resetting CPU1 during boot")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap2/common.h | 3 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-mpuss-lowpower.c | 10 | ||||
| -rw-r--r-- | arch/arm/mach-omap2/omap-smp.c | 11 |
3 files changed, 14 insertions, 10 deletions
diff --git a/arch/arm/mach-omap2/common.h b/arch/arm/mach-omap2/common.h index 3089d3bfa19b..8cc6338fcb12 100644 --- a/arch/arm/mach-omap2/common.h +++ b/arch/arm/mach-omap2/common.h | |||
| @@ -266,11 +266,12 @@ extern int omap4_cpu_kill(unsigned int cpu); | |||
| 266 | extern const struct smp_operations omap4_smp_ops; | 266 | extern const struct smp_operations omap4_smp_ops; |
| 267 | #endif | 267 | #endif |
| 268 | 268 | ||
| 269 | extern u32 omap4_get_cpu1_ns_pa_addr(void); | ||
| 270 | |||
| 269 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) | 271 | #if defined(CONFIG_SMP) && defined(CONFIG_PM) |
| 270 | extern int omap4_mpuss_init(void); | 272 | extern int omap4_mpuss_init(void); |
| 271 | extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state); | 273 | extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state); |
| 272 | extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state); | 274 | extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state); |
| 273 | extern u32 omap4_get_cpu1_ns_pa_addr(void); | ||
| 274 | #else | 275 | #else |
| 275 | static inline int omap4_enter_lowpower(unsigned int cpu, | 276 | static inline int omap4_enter_lowpower(unsigned int cpu, |
| 276 | unsigned int power_state) | 277 | unsigned int power_state) |
diff --git a/arch/arm/mach-omap2/omap-mpuss-lowpower.c b/arch/arm/mach-omap2/omap-mpuss-lowpower.c index 03ec6d307c82..4cfc4f9b2c69 100644 --- a/arch/arm/mach-omap2/omap-mpuss-lowpower.c +++ b/arch/arm/mach-omap2/omap-mpuss-lowpower.c | |||
| @@ -213,11 +213,6 @@ static void __init save_l2x0_context(void) | |||
| 213 | {} | 213 | {} |
| 214 | #endif | 214 | #endif |
| 215 | 215 | ||
| 216 | u32 omap4_get_cpu1_ns_pa_addr(void) | ||
| 217 | { | ||
| 218 | return old_cpu1_ns_pa_addr; | ||
| 219 | } | ||
| 220 | |||
| 221 | /** | 216 | /** |
| 222 | * omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function | 217 | * omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function |
| 223 | * The purpose of this function is to manage low power programming | 218 | * The purpose of this function is to manage low power programming |
| @@ -457,6 +452,11 @@ int __init omap4_mpuss_init(void) | |||
| 457 | 452 | ||
| 458 | #endif | 453 | #endif |
| 459 | 454 | ||
| 455 | u32 omap4_get_cpu1_ns_pa_addr(void) | ||
| 456 | { | ||
| 457 | return old_cpu1_ns_pa_addr; | ||
| 458 | } | ||
| 459 | |||
| 460 | /* | 460 | /* |
| 461 | * For kexec, we must set CPU1_WAKEUP_NS_PA_ADDR to point to | 461 | * For kexec, we must set CPU1_WAKEUP_NS_PA_ADDR to point to |
| 462 | * current kernel's secondary_startup() early before | 462 | * current kernel's secondary_startup() early before |
diff --git a/arch/arm/mach-omap2/omap-smp.c b/arch/arm/mach-omap2/omap-smp.c index 3faf454ba487..33e4953c61a8 100644 --- a/arch/arm/mach-omap2/omap-smp.c +++ b/arch/arm/mach-omap2/omap-smp.c | |||
| @@ -306,7 +306,6 @@ static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c) | |||
| 306 | 306 | ||
| 307 | cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base + | 307 | cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base + |
| 308 | OMAP_AUX_CORE_BOOT_1); | 308 | OMAP_AUX_CORE_BOOT_1); |
| 309 | cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr(); | ||
| 310 | 309 | ||
| 311 | /* Did the configured secondary_startup() get overwritten? */ | 310 | /* Did the configured secondary_startup() get overwritten? */ |
| 312 | if (!omap4_smp_cpu1_startup_valid(cpu1_startup_pa)) | 311 | if (!omap4_smp_cpu1_startup_valid(cpu1_startup_pa)) |
| @@ -316,9 +315,13 @@ static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c) | |||
| 316 | * If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a | 315 | * If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a |
| 317 | * deeper idle state in WFI and will wake to an invalid address. | 316 | * deeper idle state in WFI and will wake to an invalid address. |
| 318 | */ | 317 | */ |
| 319 | if ((soc_is_omap44xx() || soc_is_omap54xx()) && | 318 | if ((soc_is_omap44xx() || soc_is_omap54xx())) { |
| 320 | !omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr)) | 319 | cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr(); |
| 321 | needs_reset = true; | 320 | if (!omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr)) |
| 321 | needs_reset = true; | ||
| 322 | } else { | ||
| 323 | cpu1_ns_pa_addr = 0; | ||
| 324 | } | ||
| 322 | 325 | ||
| 323 | if (!needs_reset || !c->cpu1_rstctrl_va) | 326 | if (!needs_reset || !c->cpu1_rstctrl_va) |
| 324 | return; | 327 | return; |
