Skip to content

Commit 864f893

Browse files
committed
Merge branch 'clockevents/4.19-fixes' of https://git.linaro.org/people/daniel.lezcano/linux into timers/urgent
Pull clockevent fixed from Daniel Lezcano: - Add the CLOCK_SOURCE_SUSPEND_NONSTOP for non-am43 SoCs (Keerthy) - Fix set_next_event handler for the fttmr010 (Tao Ren)
2 parents 6bf4ca7 + 4451d3f commit 864f893

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

drivers/clocksource/timer-fttmr010.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,17 @@ static int fttmr010_timer_set_next_event(unsigned long cycles,
130130
cr &= ~fttmr010->t1_enable_val;
131131
writel(cr, fttmr010->base + TIMER_CR);
132132

133-
/* Setup the match register forward/backward in time */
134-
cr = readl(fttmr010->base + TIMER1_COUNT);
135-
if (fttmr010->count_down)
136-
cr -= cycles;
137-
else
138-
cr += cycles;
139-
writel(cr, fttmr010->base + TIMER1_MATCH1);
133+
if (fttmr010->count_down) {
134+
/*
135+
* ASPEED Timer Controller will load TIMER1_LOAD register
136+
* into TIMER1_COUNT register when the timer is re-enabled.
137+
*/
138+
writel(cycles, fttmr010->base + TIMER1_LOAD);
139+
} else {
140+
/* Setup the match register forward in time */
141+
cr = readl(fttmr010->base + TIMER1_COUNT);
142+
writel(cr + cycles, fttmr010->base + TIMER1_MATCH1);
143+
}
140144

141145
/* Start */
142146
cr = readl(fttmr010->base + TIMER_CR);

drivers/clocksource/timer-ti-32k.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ static int __init ti_32k_timer_init(struct device_node *np)
9797
return -ENXIO;
9898
}
9999

100+
if (!of_machine_is_compatible("ti,am43"))
101+
ti_32k_timer.cs.flags |= CLOCK_SOURCE_SUSPEND_NONSTOP;
102+
100103
ti_32k_timer.counter = ti_32k_timer.base;
101104

102105
/*

0 commit comments

Comments
 (0)