|
@@ -16,6 +16,8 @@
|
|
|
|
|
|
#include <linux/kernel.h>
|
|
|
#include <linux/clk.h>
|
|
|
+#include <linux/cpufreq.h>
|
|
|
+#include <linux/delay.h>
|
|
|
#include <linux/io.h>
|
|
|
|
|
|
#include <asm/mach-types.h> /* for machine_is_* */
|
|
@@ -927,16 +929,22 @@ int __init omap1_clk_init(void)
|
|
|
|
|
|
void __init omap1_clk_late_init(void)
|
|
|
{
|
|
|
- if (ck_dpll1.rate >= OMAP1_DPLL1_SANE_VALUE)
|
|
|
+ unsigned long rate = ck_dpll1.rate;
|
|
|
+
|
|
|
+ if (rate >= OMAP1_DPLL1_SANE_VALUE)
|
|
|
return;
|
|
|
|
|
|
+ /* System booting at unusable rate, force reprogramming of DPLL1 */
|
|
|
+ ck_dpll1_p->rate = 0;
|
|
|
+
|
|
|
/* Find the highest supported frequency and enable it */
|
|
|
if (omap1_select_table_rate(&virtual_ck_mpu, ~0)) {
|
|
|
pr_err("System frequencies not set, using default. Check your config.\n");
|
|
|
omap_writew(0x2290, DPLL_CTL);
|
|
|
- omap_writew(cpu_is_omap7xx() ? 0x3005 : 0x1005, ARM_CKCTL);
|
|
|
+ omap_writew(cpu_is_omap7xx() ? 0x2005 : 0x0005, ARM_CKCTL);
|
|
|
ck_dpll1.rate = OMAP1_DPLL1_SANE_VALUE;
|
|
|
}
|
|
|
propagate_rate(&ck_dpll1);
|
|
|
omap1_show_rates();
|
|
|
+ loops_per_jiffy = cpufreq_scale(loops_per_jiffy, rate, ck_dpll1.rate);
|
|
|
}
|