diff options
-rw-r--r-- | arch/arm/cpu/armv8/generic_timer.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/generic_timer.c b/arch/arm/cpu/armv8/generic_timer.c index 8f47a82043..cd92b2c761 100644 --- a/arch/arm/cpu/armv8/generic_timer.c +++ b/arch/arm/cpu/armv8/generic_timer.c @@ -9,6 +9,8 @@ #include <command.h> #include <asm/system.h> +DECLARE_GLOBAL_DATA_PTR; + /* * Generic timer implementation of get_tbclk() */ @@ -41,6 +43,15 @@ unsigned long timer_read_counter(void) return cntpct; } +unsigned long long get_ticks(void) +{ + unsigned long ticks = timer_read_counter(); + + gd->arch.tbl = ticks; + + return ticks; +} + unsigned long usec2ticks(unsigned long usec) { ulong ticks; |