[PATCH] clockevents: rockchip: Add rockchip timer for rk3288
Heiko Stübner
heiko at sntech.de
Wed Jan 14 09:45:38 PST 2015
Hi Daniel,
Am Mittwoch, 14. Januar 2015, 17:10:24 schrieb Daniel Lezcano:
> On 01/13/2015 12:20 AM, Heiko Stübner wrote:
> >> +- clock-frequency: the frequency the timer is running
> >> +
> >> +Example:
> >> + timer: timer at ff810000 {
> >> + compatible = "rockchip,rk3288-timer";
> >> + reg = <0xff810000 0x20>;
> >> + interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>;
> >> + clock-frequency = <24000000>;
> >
> > wouldn't it make sense to use the actual supplying clock?
> >
> > For the timer you want to use it is just the non-gateable &xin24m, but the
> > timers in the other block (timer0-5) actually do have gateable clocks.
> >
> > Similarly there is a pclk_timer supplying at least one of the two actual
> > blocks. I'll try to inquire how the blocks are actually supplied.
>
> Ok, are you suggesting I should use another timer so we can gate it for
> power efficiency ?
As you want a timer that is running during suspend, I think the one you're
using right now is the correct one ... the others (timer0-5) are in the cpu-
domain instead of the alive-domain
My intention was more to not have a clock-frequency property, but to simply
use the correct cock frequency.
clocks = <&xin24m>, <&cru PCLK_TIMER>;
clock-names = "timer", "pclk";
[same binding as dw_apb_timer]
rockchip_timer.c:
tclk = of_clk_get_by_name(np, "timer");
clk_prepare_enable(tclk);
bc_timer.freq = clk_get_rate(tclk);
etc...
essentially like db_apb_timer_of.c does it :-)
We currently don't implement the gates Jack mentioned, but as they're open
anyway we can just use xin24m directly for now.
And the pclk should probably be enabled too, as with 3.19-rc it gets disabled
when unused.
Heiko
More information about the Linux-rockchip
mailing list