}
}
-static unsigned int __initdata armclk;
+static unsigned int __initdata armclk = 576000000;
/*
- * By default we use the rate set by the bootloader.
- * You can override this with armclk= cmdline option.
+ * You can override arm_clk rate with armclk= cmdline option.
*/
-static int __init clk_setup(char *str)
+static int __init armclk_setup(char *str)
{
get_option(&str, &armclk);
return 1;
}
-__setup("armclk=", clk_setup);
+__setup("armclk=", armclk_setup);
+
+extern void rk2818_timer_update_mult(void);
/*
* Switch the arm_clk rate if specified on cmdline.
arm_pll_clk.rate / 1000000, arm_clk.rate / 1000000,
arm_hclk.rate / 1000000, arm_pclk.rate / 1000000);
+ /* cpufreq is not active now, so change timer_mult and loops_per_jiffy manually */
+ rk2818_timer_update_mult();
calibrate_delay();
printk(KERN_INFO "%lu.%02lu BogoMIPS (lpj=%lu)\n", loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy);
static struct clk *timer_clk;
static volatile unsigned long timer_mult; /* timer count = cycle * timer_mult */
+void rk2818_timer_update_mult(void)
+{
+ if (timer_clk)
+ timer_mult = clk_get_rate(timer_clk) / 1000000;
+}
+
static int rk2818_timer_set_next_event(unsigned long cycles, struct clock_event_device *evt)
{
RK_TIMER_DISABLE(TIMER_CLKEVT);
static int rk2818_timer_cpufreq_notifier(struct notifier_block *nb, unsigned long val, void *data)
{
if (val == CPUFREQ_POSTCHANGE) {
- timer_mult = clk_get_rate(timer_clk) / 1000000;
+ rk2818_timer_update_mult();
}
return 0;
struct clock_event_device *ce = &rk2818_timer_clockevent;
timer_clk = clk_get(NULL, "timer");
- timer_mult = clk_get_rate(timer_clk) / 1000000;
+ rk2818_timer_update_mult();
RK_TIMER_DISABLE(TIMER_CLKEVT);