summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/include/asm/system.h19
-rw-r--r--drivers/clocksource/Kconfig2
-rw-r--r--drivers/clocksource/armv8-timer.c1
3 files changed, 21 insertions, 1 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)
diff --git a/drivers/clocksource/Kconfig b/drivers/clocksource/Kconfig
index b0502c3036..43c5bfc973 100644
--- a/drivers/clocksource/Kconfig
+++ b/drivers/clocksource/Kconfig
@@ -73,7 +73,7 @@ config CLOCKSOURCE_ATMEL_PIT
config CLOCKSOURCE_ARMV8_TIMER
bool
default y
- depends on ARM && CPU_64v8
+ depends on ARM && (CPU_64v8 || CPU_V7)
config CLOCKSOURCE_ARM_GLOBAL_TIMER
bool
diff --git a/drivers/clocksource/armv8-timer.c b/drivers/clocksource/armv8-timer.c
index 918232e0e0..3095f8cfc4 100644
--- a/drivers/clocksource/armv8-timer.c
+++ b/drivers/clocksource/armv8-timer.c
@@ -39,6 +39,7 @@ static int armv8_timer_probe(struct device_d *dev)
}
static struct of_device_id armv8_timer_dt_ids[] = {
+ { .compatible = "arm,armv7-timer", },
{ .compatible = "arm,armv8-timer", },
{ }
};