Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1209832 > unrolled thread

[PATCH] clocksource: arm_global_timer: register delay timer

Started byRabin Vincent <rabin.vincent@axis.com>
First post2015-08-19 15:50 +0200
Last post2015-08-20 21:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] clocksource: arm_global_timer: register delay timer Rabin Vincent <rabin.vincent@axis.com> - 2015-08-19 15:50 +0200
    Re: [PATCH] clocksource: arm_global_timer: register delay timer Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-08-20 21:10 +0200

#1209832 — [PATCH] clocksource: arm_global_timer: register delay timer

FromRabin Vincent <rabin.vincent@axis.com>
Date2015-08-19 15:50 +0200
Subject[PATCH] clocksource: arm_global_timer: register delay timer
Message-ID<pZbUC-7wP-9@gated-at.bofh.it>
Provide a delay timer using the lower 32-bits of the global timer so
that we can use that instead of having to calibrating delays.

Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>
---
 drivers/clocksource/arm_global_timer.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/clocksource/arm_global_timer.c b/drivers/clocksource/arm_global_timer.c
index e683377..f92a77d 100644
--- a/drivers/clocksource/arm_global_timer.c
+++ b/drivers/clocksource/arm_global_timer.c
@@ -16,6 +16,7 @@
 #include <linux/clockchips.h>
 #include <linux/cpu.h>
 #include <linux/clk.h>
+#include <linux/delay.h>
 #include <linux/err.h>
 #include <linux/io.h>
 #include <linux/of.h>
@@ -208,6 +209,21 @@ static u64 notrace gt_sched_clock_read(void)
 }
 #endif
 
+static unsigned long gt_read_long(void)
+{
+	return readl_relaxed(gt_base + GT_COUNTER0);
+}
+
+static struct delay_timer gt_delay_timer = {
+	.read_current_timer = gt_read_long,
+};
+
+static void __init gt_delay_timer_init(void)
+{
+	gt_delay_timer.freq = gt_clk_rate;
+	register_current_timer_delay(&gt_delay_timer);
+}
+
 static void __init gt_clocksource_init(void)
 {
 	writel(0, gt_base + GT_CONTROL);
@@ -304,6 +320,7 @@ static void __init global_timer_of_register(struct device_node *np)
 	/* Immediately configure the timer on the boot CPU */
 	gt_clocksource_init();
 	gt_clockevents_init(this_cpu_ptr(gt_evt));
+	gt_delay_timer_init();
 
 	return;
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1210680

FromDaniel Lezcano <daniel.lezcano@linaro.org>
Date2015-08-20 21:10 +0200
Message-ID<pZDnQ-5qX-21@gated-at.bofh.it>
In reply to#1209832
On 08/19/2015 03:43 PM, Rabin Vincent wrote:
> Provide a delay timer using the lower 32-bits of the global timer so
> that we can use that instead of having to calibrating delays.
>
> Signed-off-by: Rabin Vincent <rabin.vincent@axis.com>

Applied to my tree for 4.4

Thanks !

   -- Daniel

-- 
  <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web