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();