diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-08 15:49:13 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-03-11 10:27:44 +0100 |
commit | dece707522434d5c8eb35da8c98d0269112457f7 (patch) | |
tree | c54c782e428a70ad6e7b281873c96561ef3dd4e1 /arch | |
parent | 6f9ff8615c1541941a04431c106fd4576a5d3976 (diff) | |
download | barebox-dece707522434d5c8eb35da8c98d0269112457f7.tar.gz barebox-dece707522434d5c8eb35da8c98d0269112457f7.tar.xz |
clocksource: Enable architected timer support for CPU_V7
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/include/asm/system.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/include/asm/system.h b/arch/arm/include/asm/system.h index 45eeb6e62c..e55b19a13c 100644 --- a/arch/arm/include/asm/system.h +++ b/arch/arm/include/asm/system.h @@ -126,6 +126,25 @@ static inline unsigned long get_cntpct(void) return cntpct; } +#else +static inline unsigned int get_cntfrq(void) +{ + unsigned int val; + + asm volatile("mrc p15, 0, %0, c14, c0, 0" : "=r" (val)); + + return val; +} + +static inline unsigned long long get_cntpct(void) +{ + unsigned long long cval; + + isb(); + asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval)); + + return cval; +} #endif static inline unsigned int get_cr(void) |