[U-Boot] [PATCH] arm64: timer: Create timer_get_bootus for bootstage support

Implement timer_get_boot_us() based on available functions to support bootstage command.
Signed-off-by: Michal Simek michal.simek@xilinx.com ---
arch/arm/cpu/armv8/generic_timer.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c index 303ba3c00efb..bf07a706a029 100644 --- a/arch/arm/cpu/armv8/generic_timer.c +++ b/arch/arm/cpu/armv8/generic_timer.c @@ -61,3 +61,10 @@ unsigned long usec2ticks(unsigned long usec)
return ticks; } + +ulong timer_get_boot_us(void) +{ + u64 val = get_ticks() * 1000000; + + return val / get_tbclk(); +}

On Tue, May 15, 2018 at 04:47:02PM +0200, Michal Simek wrote:
Implement timer_get_boot_us() based on available functions to support bootstage command.
Signed-off-by: Michal Simek michal.simek@xilinx.com
Applied to u-boot/master, thanks!
participants (2)
-
Michal Simek
-
Tom Rini