[PATCH 2/6] ARM: mxs: look up timrot clock from device tree

Shawn Guo shawn.guo at linaro.org
Thu Jul 11 09:57:43 EDT 2013


Hi Uwe,

On Thu, Jul 11, 2013 at 12:56:26PM +0200, Uwe Kleine-König wrote:
> 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?
> 

You may want to take a look at commit 2fb318f (ARM: mxs: use apbx bus
clock to drive the timers on timrotv2), which hit mainline in v3.9.

Shawn

> 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/  |




More information about the linux-arm-kernel mailing list