From: Soren Brinkmann <soren.brinkmann@xilinx.com>
To: Michal Simek <michal.simek@xilinx.com>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Thomas Gleixner <tglx@linutronix.de>,
John Stultz <john.stultz@linaro.org>
Cc: linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Soren Brinkmann <soren.brinkmann@xilinx.com>
Subject: [PATCH RFC 2/3] clocksource/cadence_ttc: Make clocksource optional
Date: Thu, 29 Aug 2013 10:53:09 -0700 [thread overview]
Message-ID: <1377798790-28927-3-git-send-email-soren.brinkmann@xilinx.com> (raw)
In-Reply-To: <1377798790-28927-1-git-send-email-soren.brinkmann@xilinx.com>
On some platforms, like Zynq, the input clock for the TTC is directly
derived from the CPU clock, which means it scales when cpufreq adjusts
the CPU frequency.
At the same time the clocksource core expects a clocksource to be
stable and doesn't allow frequency adjustments.
Therefore a new flag - 'input-clock-unstable' - is added to the DT
bindings for this driver. In case the flag is present the driver does
not register the timer as clocksource.
Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com>
---
Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt | 4 ++++
drivers/clocksource/cadence_ttc_timer.c | 3 ++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt b/Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt
index 993695c..a936c0a 100644
--- a/Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt
+++ b/Documentation/devicetree/bindings/timer/cadence,ttc-timer.txt
@@ -6,6 +6,10 @@ Required properties:
- interrupts : A list of 3 interrupts; one per timer channel.
- clocks: phandle to the source clock
+Optional properties:
+- input-clock-unstable : Mark the timer's input clock as unstable. E.g. it
+ scales with cpufreq.
+
Example:
ttc0: ttc0@f8001000 {
diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c
index 99ec898..66aaf6a 100644
--- a/drivers/clocksource/cadence_ttc_timer.c
+++ b/drivers/clocksource/cadence_ttc_timer.c
@@ -407,7 +407,8 @@ static void __init ttc_timer_init(struct device_node *timer)
BUG();
}
- ttc_setup_clocksource(clk_cs, timer_baseaddr);
+ if (!of_property_read_bool(timer, "input-clock-unstable"))
+ ttc_setup_clocksource(clk_cs, timer_baseaddr);
ttc_setup_clockevent(clk_ce, timer_baseaddr + 4, irq);
pr_info("%s #0 at %p, irq=%d\n", timer->name, timer_baseaddr, irq);
--
1.8.4
next prev parent reply other threads:[~2013-08-29 17:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 17:53 [PATCH RFC 0/3] clocksource/cadence_ttc: Handle frequency changes Soren Brinkmann
2013-08-29 17:53 ` [PATCH RFC 1/3] clocksource/cadence_ttc: Remove clocksource clock notifier Soren Brinkmann
2013-08-29 17:53 ` Soren Brinkmann [this message]
2013-08-29 17:53 ` [PATCH RFC 3/3] arm: dt: zynq: Mark TTC input clock as unstable Soren Brinkmann
2013-08-29 17:55 ` [PATCH RFC] clocksource/cadence_ttc: Overhaul clocksource frequency adjustment Soren Brinkmann
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=1377798790-28927-3-git-send-email-soren.brinkmann@xilinx.com \
--to=soren.brinkmann@xilinx.com \
--cc=daniel.lezcano@linaro.org \
--cc=john.stultz@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michal.simek@xilinx.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®