Skip to contentSkip to conversation

ARM: shmobile: Also build APMU code for non-SMP r8a7790

PATCH New Magnus Damm 1 participant 1 message Mar 16, 2014

Subsystems (4)
lore
Share & tools
lore

Magnus Damm

author maintainer
#0 lore raw

PATCH 4/6 ARM: shmobile: Also build APMU code for non-SMP r8a7790

From: Magnus Damm <[email protected]>

Build APMU code on r8a7790 when CPUIdle is enabled regardless if SMP is enabled or not.

Not-Yet-Signed-off-by Magnus Damm <[email protected]>

---

 arch/arm/mach-shmobile/Makefile       |    1 +
 arch/arm/mach-shmobile/platsmp-apmu.c |    4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
arch/arm/mach-shmobile/Makefile +1 -0
@@ -55,6 +55,7 @@ obj-$(CONFIG_ARCH_R8A7790)	+= pm-r8a7790
 
 # CPU PM objects
 cpu-y				:= cpuidle.o platsmp.o headsmp.o
+cpu-$(CONFIG_ARCH_R8A7790)	+= platsmp-apmu.o
 
 # Board objects
 ifdef CONFIG_ARCH_SHMOBILE_MULTI
arch/arm/mach-shmobile/platsmp-apmu.c +3 -1
@@ -69,7 +69,7 @@ static int apmu_wrap(int cpu, int (*fn)(
 
 static void apmu_init_cpu(struct resource *res, int cpu, int bit)
 {
-	if (apmu_cpus[cpu].iomem)
+	if ((cpu >= ARRAY_SIZE(apmu_cpus)) || apmu_cpus[cpu].iomem)
 		return;
 
 	apmu_cpus[cpu].iomem = ioremap_nocache(res->start, resource_size(res));
@@ -133,6 +133,7 @@ void __init shmobile_smp_apmu_prepare_cp
 	apmu_parse_cfg(apmu_init_cpu);
 }
 
+#ifdef CONFIG_SMP
 int shmobile_smp_apmu_boot_secondary(unsigned int cpu, struct task_struct *idle)
 {
 	/* For this particular CPU register boot vector */
@@ -140,6 +141,7 @@ int shmobile_smp_apmu_boot_secondary(uns
 
 	return apmu_wrap(cpu, apmu_power_on);
 }
+#endif
 
 #ifdef CONFIG_HOTPLUG_CPU
 /* nicked from arch/arm/mach-exynos/hotplug.c */