summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-12-04 23:32:16 -0800
committerOlof Johansson <olof@lixom.net>2014-12-04 23:32:16 -0800
commit6b34df9e30c8b596f9d0173ca17714076474458e (patch)
treea47b26e4ebb4d0aea10b3abbb620efa2a004ba8c /arch
parente58e501a9b3e0db722263b02d6c06f1656a5dee7 (diff)
parent65b5732d241b8b39e07653794eefffd0d8028cbb (diff)
Merge branch 'clocksource/physical-timers' into next/drivers
* clocksource/physical-timers: clocksource: arch_timer: Allow the device tree to specify uninitialized timer registers clocksource: arch_timer: Fix code to use physical timers when requested
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/include/asm/arch_timer.h9
-rw-r--r--arch/arm64/include/asm/arch_timer.h9
2 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch_timer.h b/arch/arm/include/asm/arch_timer.h
index 92793ba69c4..d4ebf5679f1 100644
--- a/arch/arm/include/asm/arch_timer.h
+++ b/arch/arm/include/asm/arch_timer.h
@@ -78,6 +78,15 @@ static inline u32 arch_timer_get_cntfrq(void)
return val;
}
+static inline u64 arch_counter_get_cntpct(void)
+{
+ u64 cval;
+
+ isb();
+ asm volatile("mrrc p15, 0, %Q0, %R0, c14" : "=r" (cval));
+ return cval;
+}
+
static inline u64 arch_counter_get_cntvct(void)
{
u64 cval;
diff --git a/arch/arm64/include/asm/arch_timer.h b/arch/arm64/include/asm/arch_timer.h
index f19097134b0..b1fa4e61471 100644
--- a/arch/arm64/include/asm/arch_timer.h
+++ b/arch/arm64/include/asm/arch_timer.h
@@ -104,6 +104,15 @@ static inline void arch_timer_set_cntkctl(u32 cntkctl)
asm volatile("msr cntkctl_el1, %0" : : "r" (cntkctl));
}
+static inline u64 arch_counter_get_cntpct(void)
+{
+ /*
+ * AArch64 kernel and user space mandate the use of CNTVCT.
+ */
+ BUG();
+ return 0;
+}
+
static inline u64 arch_counter_get_cntvct(void)
{
u64 cval;