From 3775f1c0e177b3667753bbf0087b7975f3ec712e Mon Sep 17 00:00:00 2001 From: T Michael Turney Date: Tue, 24 Apr 2018 10:15:46 -0700 Subject: arm64: Add ARCH Timer SoC sdm845 uses ARCH Timer Change-Id: I45e2d4d2c16a2cded3df20d393d2b8820050ac80 Signed-off-by: T Michael Turney Reviewed-on: https://review.coreboot.org/25612 Tested-by: build bot (Jenkins) Reviewed-by: Julius Werner --- src/arch/arm64/armv8/lib/sysctrl.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/arch/arm64/armv8/lib') diff --git a/src/arch/arm64/armv8/lib/sysctrl.c b/src/arch/arm64/armv8/lib/sysctrl.c index 9cf26a5c69..ef3b455b65 100644 --- a/src/arch/arm64/armv8/lib/sysctrl.c +++ b/src/arch/arm64/armv8/lib/sysctrl.c @@ -1059,3 +1059,11 @@ void raw_write_cntfrq_el0(uint32_t cntfrq_el0) { __asm__ __volatile__("msr CNTFRQ_EL0, %0\n\t" : : "r" ((uint64_t)cntfrq_el0) : "memory"); } + +uint64_t raw_read_cntpct_el0(void) +{ + uint64_t cntpct_el0; + + __asm__ __volatile__("mrs %0, CNTPCT_EL0\n\t" : "=r" (cntpct_el0) : : "memory"); + return cntpct_el0; +} -- cgit v1.2.3