[PATCH 10/10] arm: add basic support for Rockchip RK3066a boards
Arnd Bergmann
arnd at arndb.de
Mon Jun 3 20:26:49 EST 2013
On Monday 03 June 2013 11:46:57 Heiko Stübner wrote:
>
> The timers are of the same type and the clocksource driver just grabs the
> first of them as clockevent and the second as clocksource, so I think two
> CLOCKSOURCE_OF_DECLARE lines won't do.
Ok, got it. I was confused by the fact that the existing two sets of
"compatible" strings have separate sets of strings:
static const struct of_device_id sptimer_ids[] __initconst = {
{ .compatible = "picochip,pc3x2-rtc" },
{ .compatible = "snps,dw-apb-timer-sp" },
{ /* Sentinel */ },
};
static const struct of_device_id osctimer_ids[] __initconst = {
{ .compatible = "picochip,pc3x2-timer" },
{ .compatible = "snps,dw-apb-timer-osc" },
{},
};
and thought they were for clocksource and clockevent respectively,
which is wrong.
> But I just looked at clocksource_of_init a bit more closely, which does a
> for_each_matching_node_and_match over the nodes. So the init_func could grab
> the device for the clockevent on the first call and the clocksource when it
> gets called for the second matching node.
Yes, I think that should work. You just have to be careful about calling
init_sched_clock() only once.
Arnd
More information about the devicetree-discuss
mailing list