Skip to content

Commit cea931c

Browse files
brglnsekhar
authored andcommitted
clocksource: davinci: only enable clockevents once tim34 is initialized
The DM365 platform has a strange quirk (only present when using ancient u-boot - mainline u-boot v2013.01 and later works fine) where if we enable the second half of the timer in periodic mode before we do its initialization - the time won't start flowing and we can't boot. When using more recent u-boot, we can enable the timer, then reinitialize it and all works fine. To work around this issue only enable clockevents once tim34 is initialized i.e. move clockevents_config_and_register() below tim34 initialization. Signed-off-by: Bartosz Golaszewski <[email protected]> Signed-off-by: Sekhar Nori <[email protected]>
1 parent e42617b commit cea931c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/clocksource/timer-davinci.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -302,10 +302,6 @@ int __init davinci_timer_register(struct clk *clk,
302302
return rv;
303303
}
304304

305-
clockevents_config_and_register(&clockevent->dev, tick_rate,
306-
DAVINCI_TIMER_MIN_DELTA,
307-
DAVINCI_TIMER_MAX_DELTA);
308-
309305
davinci_clocksource.dev.rating = 300;
310306
davinci_clocksource.dev.read = davinci_clocksource_read;
311307
davinci_clocksource.dev.mask =
@@ -323,6 +319,10 @@ int __init davinci_timer_register(struct clk *clk,
323319
davinci_clocksource_init_tim34(base);
324320
}
325321

322+
clockevents_config_and_register(&clockevent->dev, tick_rate,
323+
DAVINCI_TIMER_MIN_DELTA,
324+
DAVINCI_TIMER_MAX_DELTA);
325+
326326
rv = clocksource_register_hz(&davinci_clocksource.dev, tick_rate);
327327
if (rv) {
328328
pr_err("Unable to register clocksource");

0 commit comments

Comments
 (0)