aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/mips/kernel/cevt-txx9.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/mips/kernel/cevt-txx9.c b/arch/mips/kernel/cevt-txx9.c
index 2ae08462e46e..723932441ecc 100644
--- a/arch/mips/kernel/cevt-txx9.c
+++ b/arch/mips/kernel/cevt-txx9.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/interrupt.h> 15#include <linux/interrupt.h>
16#include <linux/irq.h> 16#include <linux/irq.h>
17#include <linux/sched_clock.h>
17#include <asm/time.h> 18#include <asm/time.h>
18#include <asm/txx9tmr.h> 19#include <asm/txx9tmr.h>
19 20
@@ -46,6 +47,11 @@ static struct txx9_clocksource txx9_clocksource = {
46 }, 47 },
47}; 48};
48 49
50static u64 notrace txx9_read_sched_clock(void)
51{
52 return __raw_readl(&txx9_clocksource.tmrptr->trr);
53}
54
49void __init txx9_clocksource_init(unsigned long baseaddr, 55void __init txx9_clocksource_init(unsigned long baseaddr,
50 unsigned int imbusclk) 56 unsigned int imbusclk)
51{ 57{
@@ -61,6 +67,9 @@ void __init txx9_clocksource_init(unsigned long baseaddr,
61 __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra); 67 __raw_writel(1 << TXX9_CLOCKSOURCE_BITS, &tmrptr->cpra);
62 __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr); 68 __raw_writel(TCR_BASE | TXx9_TMTCR_TCE, &tmrptr->tcr);
63 txx9_clocksource.tmrptr = tmrptr; 69 txx9_clocksource.tmrptr = tmrptr;
70
71 sched_clock_register(txx9_read_sched_clock, TXX9_CLOCKSOURCE_BITS,
72 TIMER_CLK(imbusclk));
64} 73}
65 74
66struct txx9_clock_event_device { 75struct txx9_clock_event_device {