asm volatile("msr cntkctl_el1, %0" : : "r" (cntkctl));
}
+/* FIXME :
+ * For the case which firmware doesn't initialize virtual counter,
+ * it recalls the way of reading physical counter.
+ */
+#if 0
static inline u64 arch_counter_get_cntpct(void)
{
/*
BUG();
return 0;
}
+#endif
+static inline u64 arch_counter_get_cntpct(void)
+{
+ u64 cval;
+
+ isb();
+ asm volatile("mrs %0, cntpct_el0" : "=r" (cval));
+
+ return cval;
+}
static inline u64 arch_counter_get_cntvct(void)
{
/* Register the CP15 based counter if we have one */
if (type & ARCH_CP15_TIMER) {
- if (IS_ENABLED(CONFIG_ARM64) || arch_timer_use_virtual)
+ if (arch_timer_use_virtual)
arch_timer_read_counter = arch_counter_get_cntvct;
else
arch_timer_read_counter = arch_counter_get_cntpct;
arch_timer_c3stop = !of_property_read_bool(np, "always-on");
+ /* FIXME :
+ * ARM recommended to use vcnt for clocksource of ARMv8.
+ * However, On Exynos5433, it seemed that they aren't intialized
+ * properly, each of counters' value are not synchronized.
+ * For Exynos5433, let it uses pcnt for representive clock source.
+ */
+ if (of_machine_is_compatible("samsung,exynos5433"))
+ arch_timer_use_virtual = false;
+
/*
* If we cannot rely on firmware initializing the timer registers then
* we should use the physical timers instead.