| // SPDX-License-Identifier: GPL-2.0+ |
| * (C) Copyright 2012-2014 |
| * Texas Instruments Incorporated, <www.ti.com> |
| #include <asm/global_data.h> |
| static inline u32 read_cntfrq(void) |
| asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (frq)); |
| gd->arch.timer_rate_hz = CFG_SYS_HZ_CLOCK; |
| gd->arch.timer_rate_hz = read_cntfrq(); |
| unsigned long long get_ticks(void) |
| asm volatile("mrrc p15, 0, %0, %1, c14" : "=r" (nowl), "=r" (nowu)); |
| return (((unsigned long long)gd->arch.tbu) << 32) | gd->arch.tbl; |
| ulong timer_get_boot_us(void) |
| if (!gd->arch.timer_rate_hz) |
| return lldiv(get_ticks(), gd->arch.timer_rate_hz / 1000000); |
| return gd->arch.timer_rate_hz; |