mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
clock: set arm_clk rate to 576MHz early
This commit is contained in:
@@ -1601,13 +1601,12 @@ static void clk_enable_init_clocks(void)
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
@@ -1619,7 +1618,9 @@ static int __init clk_setup(char *str)
|
||||
|
||||
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.
|
||||
@@ -1638,6 +1639,8 @@ static int __init rk2818_clk_arch_init(void)
|
||||
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);
|
||||
|
||||
|
||||
@@ -16,6 +16,6 @@
|
||||
#ifndef __ASM_ARCH_RK2818_TIMEX_H
|
||||
#define __ASM_ARCH_RK2818_TIMEX_H
|
||||
|
||||
#define CLOCK_TICK_RATE 50000000
|
||||
#define CLOCK_TICK_RATE 1000000
|
||||
|
||||
#endif
|
||||
|
||||
@@ -58,6 +58,12 @@
|
||||
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);
|
||||
@@ -113,7 +119,7 @@ static struct irqaction rk2818_timer_clockevent_irq = {
|
||||
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;
|
||||
@@ -137,7 +143,7 @@ static __init int rk2818_timer_init_clockevent(void)
|
||||
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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user