Skip to contentSkip to conversation

Implement clockevents/clocksource for R4000-style cp0 timer [take #4]

RFC New Franck Bui-Huu 1 participant 1 message Jun 29, 2007 MIPS

lore
Share & tools
lore
#0 lore raw

RFC 1/1 Implement clockevents/clocksource for R4000-style cp0 timer [take #4]

Hi,

This new take takes into account most of points raised by Sergei.

Changes since take #3:
---------------------

- Rename CP0_CLOCKS into CP0_TIMER and get rid of all 'hpt' references.

- perf counter handler is no more integrated in timer-cp0.c. Use shared interrupt instead.

- Do not include any dyntick or hrtimer related stuffs in this patch.

- Killed hpt.h header file. All is now in time.h.

- Minor cleanups.

TODO:
-----

- There are still few places to fix that uses 'mips_hpt_frequency' global.

- If this patch is accepted, fix all platforms that use cp0 counter.

- Rewrite calibrate_timer() to be generic.

Please consider,

Franck

-- 8< --

Subject: [PATCH] Implement clockevents for R4000-style cp0 timer

---
 arch/mips/Kconfig            |    8 +
 arch/mips/kernel/Makefile    |    2 +
 arch/mips/kernel/smp.c       |    2 +
 arch/mips/kernel/time.c      |  436 +++++++-----------------------------------
 arch/mips/kernel/timer-cp0.c |  230 ++++++++++++++++++++++
 include/asm-mips/time.h      |   70 +++----
 6 files changed, 347 insertions(+), 401 deletions(-)
 create mode 100644 arch/mips/kernel/timer-cp0.c
arch/mips/Kconfig +8 -0
index 7bcf38d..a03c13b 100644
@@ -723,6 +723,14 @@ config GENERIC_TIME
 	bool
 	default y
 
+config GENERIC_CLOCKEVENTS
+	bool
+	default y
+
+config CP0_TIMER
+	bool
+	default y
+
 config GENERIC_CMOS_UPDATE
 	bool
 	default y
arch/mips/kernel/Makefile +2 -0
index 4924626..61564ff 100644
@@ -11,6 +11,8 @@ obj-y		+= cpu-probe.o branch.o entry.o genex.o irq.o process.o \
 binfmt_irix-objs	:= irixelf.o irixinv.o irixioctl.o irixsig.o	\
 			   irix5sys.o sysirix.o
 
+obj-$(CONFIG_CP0_TIMER)		+= timer-cp0.o
+
 obj-$(CONFIG_STACKTRACE)	+= stacktrace.o
 obj-$(CONFIG_MODULES)		+= mips_ksyms.o module.o
 
arch/mips/kernel/smp.c +2 -0
index 67edfa7..7677237 100644
@@ -37,6 +37,7 @@
 #include <asm/system.h>
 #include <asm/mmu_context.h>
 #include <asm/smp.h>
+#include <asm/time.h>
 
 #ifdef CONFIG_MIPS_MT_SMTC
 #include <asm/mipsmtregs.h>
@@ -79,6 +80,7 @@ asmlinkage __cpuinit void start_secondary(void)
 	cpu_probe();
 	cpu_report();
 	per_cpu_trap_init();
+	setup_cp0_hpt_clockevent();
 	prom_init_secondary();
 
 	/*
arch/mips/kernel/time.c +74 -362

510 lines not on this page · raw message

arch/mips/kernel/timer-cp0.c new file +230 -0

230 lines not on this page · raw message

include/asm-mips/time.h +31 -39

95 lines not on this page · raw message

Signature · 1 line
1.5.2.2