[PATCH 03/10] arm: armv8: generic_timer: Add timer_early functions

Stefan Roese sr at denx.de
Wed Sep 21 16:06:18 CEST 2022


Currently this timer driver provides timer_get_boot_us() to support the
BOOTSTAGE functionality. This patch adds the timer_early functions so
that the "normal" timer functions can be used, when CONFIG_TIMER_EARLY
is enabled.

timer_get_boot_us() will get removed in a follow-up patch, once the
BOOTSTAGE interface is migrated to timer_get_us().

Signed-off-by: Stefan Roese <sr at denx.de>
Cc: Michal Simek <michal.simek at xilinx.com>
Cc: Andre Przywara <andre.przywara at arm.com>
---
 arch/arm/cpu/armv8/generic_timer.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c
index f27a74b9d09b..01a1a167311e 100644
--- a/arch/arm/cpu/armv8/generic_timer.c
+++ b/arch/arm/cpu/armv8/generic_timer.c
@@ -115,3 +115,13 @@ ulong timer_get_boot_us(void)
 
 	return val / get_tbclk();
 }
+
+unsigned long notrace timer_early_get_rate(void)
+{
+	return get_tbclk();
+}
+
+u64 notrace timer_early_get_count(void)
+{
+	return get_ticks();
+}
-- 
2.37.3



More information about the U-Boot mailing list