From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] ARM: mxs: look up timrot clock from device tree
Date: Thu, 11 Jul 2013 12:56:26 +0200 [thread overview]
Message-ID: <20130711105625.GB12139@pengutronix.de> (raw)
In-Reply-To: <1364224652-28332-3-git-send-email-shawn.guo@linaro.org>
Hello Shawn,
On Mon, Mar 25, 2013 at 11:17:28PM +0800, Shawn Guo wrote:
> Change call clk_get_sys() to of_clk_get() to look up timrot clock from
> device tree, so that the clk_register_clkdev() call for timrot can be
> saved in clock driver.
I'm currently using an i.MX28 with 3.8-rt13 and patched the clocksource
and clockevent to use the 24 MHz clock source
(BV_TIMROTv2_TIMCTRLn_SELECT__ALWAYS instead of
BV_TIMROTv2_TIMCTRLn_SELECT__32KHZ_XTAL). Currently my patch is a hack
because I hard code the 24 MHz. I wonder how to do it properly?
Add another item to the "clocks = <...>" entry and use the first entry
for enable and the 2nd for clk_get_rate?
Something like:
always_clk = of_clk_get(np, 1);
if (always_clk)
register timers using always clk (24 MHz, SELECT__ALWAYS)
else
fall back to timer_clk (32 kHz, 32KHZ_XTAL)
and then
timrot at 80068000 {
compatible = "fsl,imx28-timrot", "fsl,timrot";
reg = <0x80068000 0x2000>;
interrupts = <48 49 50 51>;
clocks = <&clks 26 &clks 0>;
};
If you like it, too, I can prepare a patch.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
next prev parent reply other threads:[~2013-07-11 10:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-25 15:17 [PATCH 0/6] ARM: mxs: timer code cleanup Shawn Guo
2013-03-25 15:17 ` [PATCH 1/6] ARM: mxs: use CLKSRC_OF helper to initialize timer Shawn Guo
2013-03-25 15:17 ` [PATCH 2/6] ARM: mxs: look up timrot clock from device tree Shawn Guo
2013-07-11 10:56 ` Uwe Kleine-König [this message]
2013-07-11 13:57 ` Shawn Guo
2013-03-25 15:17 ` [PATCH 3/6] ARM: mxs: get timrot base address " Shawn Guo
2013-03-25 15:17 ` [PATCH 4/6] ARM: mxs: remove cpu_is_mx23() call from timer code Shawn Guo
2013-03-25 15:17 ` [PATCH 5/6] ARM: mxs: select STMP_DEVICE and use it for " Shawn Guo
2013-03-25 15:17 ` [PATCH 6/6] ARM: mxs: move timer driver into drivers/clocksource Shawn Guo
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=20130711105625.GB12139@pengutronix.de \
--to=u.kleine-koenig@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).