Commit 1a15f2ea authored by Philippe Gerum's avatar Philippe Gerum
Browse files

arm/ipipe: cortex: handle CPUFREQ transitions at boot

Handle frequency changes of ARM Global Timer (gt) and Timer Watchdog
(twd) during boot.
parent bb8b87fc
......@@ -226,6 +226,13 @@ core_initcall(twd_cpufreq_init);
#endif
#ifdef CONFIG_IPIPE
static unsigned int twd_refresh_freq(void)
{
return clk_get_rate(twd_clk);
}
#endif
static void twd_calibrate_rate(void)
{
unsigned long count;
......@@ -349,6 +356,7 @@ static void twd_timer_setup(void)
clk->ipipe_timer->irq = clk->irq;
clk->ipipe_timer->ack = twd_ack;
clk->ipipe_timer->min_delay_ticks = 0xf;
clk->ipipe_timer->refresh_freq = twd_refresh_freq;
#endif
clk->cpumask = cpumask_of(cpu);
......
......@@ -50,6 +50,7 @@
*/
static void __iomem *gt_base;
static unsigned long gt_pbase;
static struct clk *gt_clk;
static unsigned long gt_clk_rate;
static int gt_ppi;
static struct clock_event_device __percpu *gt_evt;
......@@ -210,6 +211,17 @@ static u64 notrace gt_sched_clock_read(void)
}
#endif
#ifdef CONFIG_IPIPE
static unsigned int refresh_gt_freq(void)
{
gt_clk_rate = clk_get_rate(gt_clk);
return gt_clk_rate;
}
#endif
static void __init gt_clocksource_init(void)
{
#ifdef CONFIG_IPIPE
......@@ -223,6 +235,7 @@ static void __init gt_clocksource_init(void)
.mask = 0xffffffff,
}
},
.refresh_freq = refresh_gt_freq,
};
#endif
......@@ -263,7 +276,6 @@ static void __init global_timer_of_register(struct device_node *np)
{
int err = 0, usable_timer = 1;
struct resource res;
struct clk *gt_clk;
/*
* In A9 r2p0 the comparators for each processor with the global timer
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment