From: Michal Simek Date: Tue, 15 May 2018 14:47:02 +0000 (+0200) Subject: arm64: timer: Create timer_get_bootus for bootstage support X-Git-Tag: v2018.07-rc1~99 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d0f855f221307dcbaeeef5a58c5ce816d0af6750;p=oweals%2Fu-boot.git 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 --- diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c index 303ba3c00e..bf07a706a0 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(); +}