Skip to content

clocksource/drivers/stm32: Consolidate the timer

Daniel Lezcano linux-arm-kernel lkml stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest12 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/12clocksource/drivers/timer-of: Store the device node pointerdrivers/clocksource/timer-of.c drivers/clocksource/timer-of.h+4 -00 replies
2/12clocksource/drivers/timer-of: Don't request the resource by namedrivers/clocksource/timer-of.c+4 -40 replies
3/12clocksource/drivers/stm32: Fix kernel panic with multiple timersdrivers/clocksource/timer-stm32.c+6 -10 replies
4/12clocksource/drivers/stm32: Convert the driver to timer-ofdrivers/clocksource/Kconfig drivers/clocksource/timer-stm32.c+74 -1140 replies
5/12clocksource/drivers/stm32: Use the node name as timer namedrivers/clocksource/timer-stm32.c+1 -10 replies
6/12clocksource/drivers/stm32: Encapsulate the timer width sorting out functiondrivers/clocksource/timer-stm32.c+23 -70 replies
7/12clocksource/drivers/stm32: Compute a prescaler value with a targeted ratedrivers/clocksource/timer-stm32.c+11 -10 replies
8/12clocksource/drivers/stm32: Add the oneshot modedrivers/clocksource/timer-stm32.c+44 -120 replies
9/12clocksource/drivers/stm32: Encapsulate more the clockevent codedrivers/clocksource/timer-stm32.c+82 -250 replies
10/12clocksource/drivers/stm32: Add the clocksourcedrivers/clocksource/timer-stm32.c+37 -00 replies
11/12clocksource/drivers/stm32: Add the timer delaydrivers/clocksource/timer-stm32.c+13 -00 replies
12/12clocksource/drivers/stm32: Start the timer's counter soonerdrivers/clocksource/timer-stm32.c+18 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/12] clocksource/drivers/stm32: Consolidate the timer

This series fixes an issue in the stm32 driver and adds the clocksource.

Previous discussion for the stm32 changes ended up in no consensus because of the 16bits and 32bits timers. The proposed change were removing the 16bits timers or wasn't providing the changes in a sane way.

This series fixes a bug when several timers are enabled in the DT. Now, the DT can enable any timer 16bits or 32bits and the time framework will choose the one with the best rating. So 16bits timer removal is no longer needed.

The fix is written in a way it can picked up for stable@.

When the driver is dealing with a 16bits timer, it computes and sets the prescaler to a value as the timer was running at 10MHz. It is a good trade off between wrapping interval and resolution.

The oneshot mode is implemented and the periodic mode of the timer is replaced by the register comparison, that allows to have a free running wheel for the clocksource.

After setting the scene by encaspulating the code, the clocksource is added and again it relies on the time framework to choose the right one. On this platform, the armv7_systick clocksource is better than the 16bits timers, so if only 16bits are used, only the clockevents will be used, the clocksource will be the armv7_systick.

In addition the timer delay is added, it saves 90ms of boot time.

A couple of trivial changes are done in timer-of in order to make the stm32 code nicer and more self-contained.

Benjamin Gaignard (4):
clocksource/drivers/stm32: Convert the driver to timer-of clocksource/drivers/stm32: Compute a prescaler value with a targeted
rate
clocksource/drivers/stm32: Add the oneshot mode clocksource/drivers/stm32: Add the clocksource

Daniel Lezcano (8):
clocksource/drivers/timer-of: Store the device node pointer clocksource/drivers/timer-of: Don't request the resource by name clocksource/drivers/stm32: Fix kernel panic with multiple timers clocksource/drivers/stm32: Use the node name as timer name clocksource/drivers/stm32: Encapsulate the timer width sorting out
function
clocksource/drivers/stm32: Encapsulate more the clockevent code clocksource/drivers/stm32: Add the timer delay clocksource/drivers/stm32: Start the timer's counter sooner

 drivers/clocksource/Kconfig       |   1 +
 drivers/clocksource/timer-of.c    |  11 +-
 drivers/clocksource/timer-of.h    |   1 +
 drivers/clocksource/timer-stm32.c | 358 ++++++++++++++++++++++++++------------
 4 files changed, 260 insertions(+), 111 deletions(-)
Signature · 1 line
2.7.4