Skip to content

bootstage: Migrate from timer_get_boot_us() to timer_get_us()

Stefan Roese u-boot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 22 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10arm: arch_timer: Add timer_early functionsarch/arm/cpu/armv7/arch_timer.c+16 -01 reply
2/10arm: imx: syscounter: Add timer_early functionsarch/arm/mach-imx/syscounter.c+16 -01 reply
3/10arm: armv8: generic_timer: Add timer_early functionsarch/arm/cpu/armv8/generic_timer.c+10 -01 reply
4/10timer: cadence-ttc: Add timer_early functionsdrivers/timer/cadence-ttc.c+25 -09 replies
5/10timer: omap-timer: Add timer_early functionsdrivers/timer/omap-timer.c+25 -00 replies
6/10timer: rockchip_timer: Add timer_early functionsdrivers/timer/rockchip_timer.c+50 -01 reply
7/10board_f/r: Allow selection of CONFIG_TIMER_EARLY w/o CONFIG_TIMERcommon/board_f.c common/board_r.c drivers/timer/Kconfig+2 -36 replies
8/10board_f/r: Don't call timer_init() when TIMER is enabledcommon/board_f.c common/board_r.c+3 -20 replies
9/10bootstage: Migrate from timer_get_boot_us() to timer_get_us()boot/Kconfig common/bootstage.c include/bootstage.h+20 -242 replies
10/10bootstage/timer: Treewide remove timer_get_boot_us()arch/arm/cpu/armv7/arch_timer.c arch/arm/cpu/armv8/generic_timer.c arch/arm/mach-imx/syscounter.c +7 more+0 -1581 reply

Reviews trailers per patch

6 of 10 patches have a Reviewed-by or Acked-by.

PatchKever YangSimon Glass
1/10R-b
2/10R-b
3/10R-b
4/10R-b
5/10
6/10R-b
7/10
8/10
9/10
10/10R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/10] bootstage: Migrate from timer_get_boot_us() to timer_get_us()

While working on the bootstage support for Armada XP (orion-timer) I noticed, that we currently have two API's supporting early timer functionality. These are:

a) timer_early_get_rate() & timer_early_get_count() which integrates into the "normal" timer functions like timer_get() & timer_get_us() in the early boot phase, if CONFIG_TIMER_EARLY is enabled
b) timer_get_boot_us(), which was introduced with bootstage IIUTC

IMHO it makes more sense to not introduce a new API for this early timer functionality but re-use the "normal" API instead. This patchset migrates the timer_get_boot_us() implementations to the timer_early functions. This is done by:

- Implementing the timer_early functions in the drivers currently supporting timer_get_boot_us()
- Migrating bootcount to using timer_get_us() instead of timer_get_boot_us()
- Completely removing timer_get_boot_us()

With some minor tweaks in board_r/f for the dm_timer_init() and timer_init() call.

I've tested this on Armada XP and sandbox.

Thanks,
Stefan

Stefan Roese (10):
arm: arch_timer: Add timer_early functions
arm: imx: syscounter: Add timer_early functions
arm: armv8: generic_timer: Add timer_early functions
timer: cadence-ttc: Add timer_early functions
timer: omap-timer: Add timer_early functions
timer: rockchip_timer: Add timer_early functions board_f/r: Allow selection of CONFIG_TIMER_EARLY w/o CONFIG_TIMER board_f/r: Don't call timer_init() when TIMER is enabled
bootstage: Migrate from timer_get_boot_us() to timer_get_us() bootstage/timer: Treewide remove timer_get_boot_us()

 arch/arm/cpu/armv7/arch_timer.c    | 15 ++++++++---
 arch/arm/cpu/armv8/generic_timer.c |  9 ++++---
 arch/arm/mach-imx/syscounter.c     | 12 +++++++--
 arch/sandbox/cpu/cpu.c             | 11 --------
 boot/Kconfig                       |  1 +
 common/board_f.c                   |  4 +--
 common/board_r.c                   |  5 ++--
 common/bootstage.c                 | 26 +++++++++---------
 drivers/timer/Kconfig              |  1 -
 drivers/timer/cadence-ttc.c        |  9 ++++---
 drivers/timer/omap-timer.c         |  9 ++++---
 drivers/timer/orion-timer.c        |  8 ------
 drivers/timer/rockchip_timer.c     | 42 ++++++++++++++++--------------
 drivers/timer/tsc_timer.c          |  5 ----
 include/bootstage.h                | 17 ++++--------
 lib/time.c                         | 20 --------------
 16 files changed, 87 insertions(+), 107 deletions(-)
Signature · 1 line
2.37.3