summaryrefslogtreecommitdiff
path: root/arch/cris/arch-v32
diff options
context:
space:
mode:
authorRabin Vincent <rabin@rab.in>2015-03-09 18:51:31 +0100
committerJesper Nilsson <jespern@axis.com>2015-03-25 11:03:41 +0100
commitd3dad475b2839b9964ef54211e135eb6fb9952f9 (patch)
treefcb7df761ed78f5899df8a74dd1726c0fdb43030 /arch/cris/arch-v32
parentedfb6d5f1a05627204d1640ba527312dc8ea745a (diff)
downloadlwn-d3dad475b2839b9964ef54211e135eb6fb9952f9.tar.gz
lwn-d3dad475b2839b9964ef54211e135eb6fb9952f9.zip
CRISv32: use GENERIC_SCHED_CLOCK
Provide a fast sched clock using the free-running timer and the generic sched_clock infrastructure. Signed-off-by: Rabin Vincent <rabin@rab.in> Signed-off-by: Jesper Nilsson <jespern@axis.com>
Diffstat (limited to 'arch/cris/arch-v32')
-rw-r--r--arch/cris/arch-v32/kernel/time.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/cris/arch-v32/kernel/time.c b/arch/cris/arch-v32/kernel/time.c
index 7c802121c0c3..4fce9f1f7cc0 100644
--- a/arch/cris/arch-v32/kernel/time.c
+++ b/arch/cris/arch-v32/kernel/time.c
@@ -15,6 +15,7 @@
#include <linux/init.h>
#include <linux/threads.h>
#include <linux/cpufreq.h>
+#include <linux/sched_clock.h>
#include <linux/mm.h>
#include <asm/types.h>
#include <asm/signal.h>
@@ -242,6 +243,11 @@ static struct irqaction irq_timer = {
.dev_id = &crisv32_clockevent,
};
+static u64 notrace crisv32_timer_sched_clock(void)
+{
+ return REG_RD(timer, timer_base, r_time);
+}
+
static void __init crisv32_timer_init(void)
{
reg_timer_rw_intr_mask timer_intr_mask;
@@ -275,6 +281,9 @@ void __init time_init(void)
crisv32_timer_init();
+ sched_clock_register(crisv32_timer_sched_clock, 32,
+ CRISV32_TIMER_FREQ);
+
clocksource_mmio_init(timer_base + REG_RD_ADDR_timer_r_time,
"crisv32-timer", CRISV32_TIMER_FREQ,
300, 32, clocksource_mmio_readl_up);