msm: acpuclock-8960: Reorganize per-cpu initialization

Remove the early_initcall from acpuclock-8960.c and the hook in
platform_secondary_init, which were used for early per-cpu
clock ramp-up.  This is now done as part of msm_acpu_clock_init,
which is called from the arch_initcall level from the board file.

With present bootchains, this means that the CPUs and L2 will now
be left running at 384MHz until msm_acpu_clock_init is called.

Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
diff --git a/arch/arm/mach-msm/acpuclock-8960.c b/arch/arm/mach-msm/acpuclock-8960.c
index bee115f..12173c1 100644
--- a/arch/arm/mach-msm/acpuclock-8960.c
+++ b/arch/arm/mach-msm/acpuclock-8960.c
@@ -819,30 +819,11 @@
 	sc->first_set_call = true;
 }
 
-/* Perform CPU0-specific setup. */
-int __init msm_acpu_clock_early_init(void)
+static void __init per_cpu_init(void *data)
 {
-	init_clock_sources(&scalable[L2],   &l2_freq_tbl[L2_BOOT_IDX].speed);
-	init_clock_sources(&scalable[CPU0], &acpu_freq_tbl[CPU_BOOT_IDX].speed);
-	scalable[CPU0].l2_vote = &l2_freq_tbl[L2_BOOT_IDX];
-
-	return 0;
-}
-early_initcall(msm_acpu_clock_early_init);
-
-/* Perform CPU1-specific setup. */
-void __cpuinit acpuclock_secondary_init(void)
-{
-	static bool warm_boot;
-
-	if (warm_boot)
-		return;
-
-	init_clock_sources(&scalable[CPU1], &acpu_freq_tbl[CPU_BOOT_IDX].speed);
-	scalable[CPU1].l2_vote = &l2_freq_tbl[L2_BOOT_IDX];
-
-	/* Secondary CPU has booted, don't repeat for subsequent warm boots. */
-	warm_boot = true;
+	int cpu = smp_processor_id();
+	init_clock_sources(&scalable[cpu], &acpu_freq_tbl[CPU_BOOT_IDX].speed);
+	scalable[cpu].l2_vote = &l2_freq_tbl[L2_BOOT_IDX];
 }
 
 /* Register with bus driver. */
@@ -961,6 +942,9 @@
 
 void __init msm_acpu_clock_init(struct msm_acpu_clock_platform_data *clkdata)
 {
+	init_clock_sources(&scalable[L2], &l2_freq_tbl[L2_BOOT_IDX].speed);
+	on_each_cpu(&per_cpu_init, NULL, true);
+
 	regulator_init();
 	bus_init();
 	cpufreq_table_init();
diff --git a/arch/arm/mach-msm/acpuclock.h b/arch/arm/mach-msm/acpuclock.h
index 2aa2884..6fa2e3b 100644
--- a/arch/arm/mach-msm/acpuclock.h
+++ b/arch/arm/mach-msm/acpuclock.h
@@ -35,10 +35,5 @@
 uint32_t acpuclk_get_switch_time(void);
 unsigned long acpuclk_wait_for_irq(void);
 unsigned long acpuclk_power_collapse(void);
-#ifdef CONFIG_ARCH_MSM8960
-void acpuclock_secondary_init(void);
-#else
-static inline void acpuclock_secondary_init(void) { }
-#endif
 
 #endif
diff --git a/arch/arm/mach-msm/platsmp.c b/arch/arm/mach-msm/platsmp.c
index c2008d6..fa87466 100644
--- a/arch/arm/mach-msm/platsmp.c
+++ b/arch/arm/mach-msm/platsmp.c
@@ -26,7 +26,6 @@
 
 #include "pm.h"
 #include "scm-boot.h"
-#include "acpuclock.h"
 
 #define SECONDARY_CPU_WAIT_MS 10
 
@@ -169,7 +168,4 @@
 		writel(0x0000FFFF, MSM_QGIC_DIST_BASE + GIC_DIST_ENABLE_SET);
 
 	gic_secondary_init(0);
-
-	/* Setup acpuclock for non-primary CPU. */
-	acpuclock_secondary_init();
 }