Skip to content

Commit 6f92120

Browse files
committed
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: 351b7c4 ("ARM: omap2+: Revert omap-smp.c changes resetting CPU1 during boot") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Tony Lindgren <[email protected]>
1 parent c6778ff commit 6f92120

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

arch/arm/mach-omap2/common.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,11 +266,12 @@ extern int omap4_cpu_kill(unsigned int cpu);
266266
extern const struct smp_operations omap4_smp_ops;
267267
#endif
268268

269+
extern u32 omap4_get_cpu1_ns_pa_addr(void);
270+
269271
#if defined(CONFIG_SMP) && defined(CONFIG_PM)
270272
extern int omap4_mpuss_init(void);
271273
extern int omap4_enter_lowpower(unsigned int cpu, unsigned int power_state);
272274
extern int omap4_hotplug_cpu(unsigned int cpu, unsigned int power_state);
273-
extern u32 omap4_get_cpu1_ns_pa_addr(void);
274275
#else
275276
static inline int omap4_enter_lowpower(unsigned int cpu,
276277
unsigned int power_state)

arch/arm/mach-omap2/omap-mpuss-lowpower.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,11 +213,6 @@ static void __init save_l2x0_context(void)
213213
{}
214214
#endif
215215

216-
u32 omap4_get_cpu1_ns_pa_addr(void)
217-
{
218-
return old_cpu1_ns_pa_addr;
219-
}
220-
221216
/**
222217
* omap4_enter_lowpower: OMAP4 MPUSS Low Power Entry Function
223218
* The purpose of this function is to manage low power programming
@@ -457,6 +452,11 @@ int __init omap4_mpuss_init(void)
457452

458453
#endif
459454

455+
u32 omap4_get_cpu1_ns_pa_addr(void)
456+
{
457+
return old_cpu1_ns_pa_addr;
458+
}
459+
460460
/*
461461
* For kexec, we must set CPU1_WAKEUP_NS_PA_ADDR to point to
462462
* current kernel's secondary_startup() early before

arch/arm/mach-omap2/omap-smp.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ static void __init omap4_smp_maybe_reset_cpu1(struct omap_smp_config *c)
306306

307307
cpu1_startup_pa = readl_relaxed(cfg.wakeupgen_base +
308308
OMAP_AUX_CORE_BOOT_1);
309-
cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr();
310309

311310
/* Did the configured secondary_startup() get overwritten? */
312311
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)
316315
* If omap4 or 5 has NS_PA_ADDR configured, CPU1 may be in a
317316
* deeper idle state in WFI and will wake to an invalid address.
318317
*/
319-
if ((soc_is_omap44xx() || soc_is_omap54xx()) &&
320-
!omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr))
321-
needs_reset = true;
318+
if ((soc_is_omap44xx() || soc_is_omap54xx())) {
319+
cpu1_ns_pa_addr = omap4_get_cpu1_ns_pa_addr();
320+
if (!omap4_smp_cpu1_startup_valid(cpu1_ns_pa_addr))
321+
needs_reset = true;
322+
} else {
323+
cpu1_ns_pa_addr = 0;
324+
}
322325

323326
if (!needs_reset || !c->cpu1_rstctrl_va)
324327
return;

0 commit comments

Comments
 (0)