From: Daniel Lezcano <daniel.lezcano@linaro.org>
To: tglx@linutronix.de
Cc: Rabin Vincent <rabin.vincent@axis.com>,
Srinivas Kandagatla <srinivas.kandagatla@gmail.com>,
Maxime Coquelin <maxime.coquelin@st.com>,
Patrice Chotard <patrice.chotard@st.com>,
linux-arm-kernel@lists.infradead.org (moderated list:ARM/STI
ARCHITECTURE),
kernel@stlinux.com (open list:ARM/STI ARCHITECTURE),
linux-kernel@vger.kernel.org (open list:CLOCKSOURCE, CLOC...)
Subject: [PATCH 6/9] clocksource/drivers/arm_global_timer: Register delay timer
Date: Thu, 25 Feb 2016 14:37:14 +0100 [thread overview]
Message-ID: <1456407438-6131-6-git-send-email-daniel.lezcano@linaro.org> (raw)
In-Reply-To: <1456407438-6131-1-git-send-email-daniel.lezcano@linaro.org>
From: Rabin Vincent <rabin.vincent@axis.com>
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>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
---
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 d189d8c..36998fa 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>
@@ -221,6 +222,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(>_delay_timer);
+}
+
static void __init gt_clocksource_init(void)
{
writel(0, gt_base + GT_CONTROL);
@@ -317,6 +333,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.9.1
next prev parent reply other threads:[~2016-02-25 13:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-25 13:26 [PULL] : clockevents for 4.6 Daniel Lezcano
2016-02-25 13:37 ` [PATCH 1/9] clocksource/drivers/arm_arch_timer: Enable and verify MMIO access Daniel Lezcano
2016-02-25 13:37 ` [PATCH 2/9] clocksource/drivers/rockchip: Add err handle for rk_timer_init Daniel Lezcano
2016-02-25 13:37 ` [PATCH 3/9] clocksource/drivers/lpc32xx: Don't use the prescaler counter for clockevents Daniel Lezcano
2016-02-25 13:37 ` [PATCH 4/9] clocksource/drivers/lpc32xx: Support periodic mode Daniel Lezcano
2016-02-25 13:37 ` [PATCH 5/9] clocksource/drivers/lpc32xx: Support timer-based ARM delay Daniel Lezcano
2016-02-25 13:37 ` Daniel Lezcano [this message]
2016-02-25 13:37 ` [PATCH 7/9] clockevents/drivers/arm_arch_timer: Implement ->set_state_oneshot_stopped() Daniel Lezcano
2016-02-25 13:37 ` [PATCH 8/9] clockevents/drivers/arm_global_timer: " Daniel Lezcano
2016-02-26 9:43 ` Jisheng Zhang
2016-02-25 13:37 ` [PATCH 9/9] clockevents/drivers/exynos_mct: " Daniel Lezcano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1456407438-6131-6-git-send-email-daniel.lezcano@linaro.org \
--to=daniel.lezcano@linaro.org \
--cc=kernel@stlinux.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maxime.coquelin@st.com \
--cc=patrice.chotard@st.com \
--cc=rabin.vincent@axis.com \
--cc=srinivas.kandagatla@gmail.com \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®