Skip to content

Optimize udelay for aarch64 boards

Peter Hoyes u-boot 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 4 repliesIn review
  2. v12 patches 7 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2arm: Move sev() and wfe() definitions to common Arm header filearch/arm/include/asm/system.h arch/arm/mach-exynos/include/mach/system.h+9 -192 replies
2/2armv8: generic_timer: Use event stream for udelayarch/arm/cpu/armv8/Kconfig arch/arm/cpu/armv8/generic_timer.c arch/arm/include/asm/system.h+39 -22 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchAndre Przywara
1/2R-b
2/2R-b

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

Read the v2 thread

Cover letter [PATCH v2 0/2] Optimize udelay for aarch64 boards

Arm boards currently use the default implementation of __udelay which consists of a spin-loop. AArch64 however provides an architectural timer with an event stream which can be enabled and waited upon with a few lines of assembly. This is more efficient and also avoids an issue on Arm FVPs where polling the counter frequently takes much longer than real-time.

Therefore, overrride __udelay for all armv8 boards to use the event stream.

Macros for the relevant instructions already existed for mach-exynos, so pull these up to a common header file.

I have tested this patch chain on qemu-system-aarch64 (virt,secure=on), FVP_Base_RevC and a Raspberry Pi 4.

Peter Hoyes (2):
arm: Move sev() and wfe() definitions to common Arm header file
armv8: generic_timer: Use event stream for udelay

 arch/arm/cpu/armv8/Kconfig                 |  8 +++++++
 arch/arm/cpu/armv8/generic_timer.c         | 27 ++++++++++++++++++++++
 arch/arm/include/asm/system.h              | 15 ++++++++++--
 arch/arm/mach-exynos/include/mach/system.h | 19 ---------------
 4 files changed, 48 insertions(+), 21 deletions(-)
Signature · 1 line
2.34.1