aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/clocksource
diff options
context:
space:
mode:
authorEzequiel Garcia <ezequiel.garcia@free-electrons.com>2014-11-04 08:21:33 -0500
committerDaniel Lezcano <daniel.lezcano@linaro.org>2014-11-26 07:51:08 -0500
commit4a22d9c93af1f2b2c40354c4bc59fd007f33f05e (patch)
tree490a796cf43f6e08c474ff71df8023a47603f2ec /drivers/clocksource
parent8067042ad9543b410b7dc355ec312c2b61979eec (diff)
clocksource: armada-370-xp: Use the reference clock on A375 SoC
The 25 MHz reference clock has better stability so its use is preferred over the core clock. This commit takes advantage of the already introduced Armada 375 devicetree compatible string and adds a new timer initialization. If available, the timer will use the reference clock (named as 'fixed'). Otherwise, it falls back to the previous behavior. Acked-by: Jason Cooper <jason@lakedaemon.net> Acked-by: Gregory CLEMENT <gregory.clement@free-electrons.com> Acked-by: Wim Van Sebroeck <wim@iguana.be> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Diffstat (limited to 'drivers/clocksource')
-rw-r--r--drivers/clocksource/time-armada-370-xp.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/clocksource/time-armada-370-xp.c b/drivers/clocksource/time-armada-370-xp.c
index d8555f9edc50..3a0704b0d739 100644
--- a/drivers/clocksource/time-armada-370-xp.c
+++ b/drivers/clocksource/time-armada-370-xp.c
@@ -301,6 +301,34 @@ static void __init armada_xp_timer_init(struct device_node *np)
301CLOCKSOURCE_OF_DECLARE(armada_xp, "marvell,armada-xp-timer", 301CLOCKSOURCE_OF_DECLARE(armada_xp, "marvell,armada-xp-timer",
302 armada_xp_timer_init); 302 armada_xp_timer_init);
303 303
304static void __init armada_375_timer_init(struct device_node *np)
305{
306 struct clk *clk;
307
308 clk = of_clk_get_by_name(np, "fixed");
309 if (!IS_ERR(clk)) {
310 clk_prepare_enable(clk);
311 timer_clk = clk_get_rate(clk);
312 } else {
313
314 /*
315 * This fallback is required in order to retain proper
316 * devicetree backwards compatibility.
317 */
318 clk = of_clk_get(np, 0);
319
320 /* Must have at least a clock */
321 BUG_ON(IS_ERR(clk));
322 clk_prepare_enable(clk);
323 timer_clk = clk_get_rate(clk) / TIMER_DIVIDER;
324 timer25Mhz = false;
325 }
326
327 armada_370_xp_timer_common_init(np);
328}
329CLOCKSOURCE_OF_DECLARE(armada_375, "marvell,armada-375-timer",
330 armada_375_timer_init);
331
304static void __init armada_370_timer_init(struct device_node *np) 332static void __init armada_370_timer_init(struct device_node *np)
305{ 333{
306 struct clk *clk = of_clk_get(np, 0); 334 struct clk *clk = of_clk_get(np, 0);