aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2007-07-20 14:22:30 -0400
committerTony Luck <tony.luck@intel.com>2007-07-20 14:22:30 -0400
commit0aa366f351d044703e25c8425e508170e80d83b1 (patch)
tree485040cbef6157b9bcb2e7b1b85920d1e391ab68 /arch/ia64/sn
parent5bae7ac9feba925fd0099057f6b23d7be80b7b41 (diff)
[IA64] Convert to generic timekeeping/clocksource
This is a merge of Peter Keilty's initial patch (which was revived by Bob Picco) for this with Hidetoshi Seto's fixes and scaling improvements. Acked-by: Bob Picco <bob.picco@hp.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/sn')
-rw-r--r--arch/ia64/sn/kernel/sn2/timer.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/arch/ia64/sn/kernel/sn2/timer.c b/arch/ia64/sn/kernel/sn2/timer.c
index 56a88b6df4b4..19e25d2b64fc 100644
--- a/arch/ia64/sn/kernel/sn2/timer.c
+++ b/arch/ia64/sn/kernel/sn2/timer.c
@@ -11,6 +11,7 @@
11#include <linux/sched.h> 11#include <linux/sched.h>
12#include <linux/time.h> 12#include <linux/time.h>
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14#include <linux/clocksource.h>
14 15
15#include <asm/hw_irq.h> 16#include <asm/hw_irq.h>
16#include <asm/system.h> 17#include <asm/system.h>
@@ -22,11 +23,21 @@
22 23
23extern unsigned long sn_rtc_cycles_per_second; 24extern unsigned long sn_rtc_cycles_per_second;
24 25
25static struct time_interpolator sn2_interpolator = { 26static void __iomem *sn2_mc;
26 .drift = -1, 27
27 .shift = 10, 28static cycle_t read_sn2(void)
28 .mask = (1LL << 55) - 1, 29{
29 .source = TIME_SOURCE_MMIO64 30 return (cycle_t)readq(sn2_mc);
31}
32
33static struct clocksource clocksource_sn2 = {
34 .name = "sn2_rtc",
35 .rating = 300,
36 .read = read_sn2,
37 .mask = (1LL << 55) - 1,
38 .mult = 0,
39 .shift = 10,
40 .flags = CLOCK_SOURCE_IS_CONTINUOUS,
30}; 41};
31 42
32/* 43/*
@@ -47,9 +58,11 @@ ia64_sn_udelay (unsigned long usecs)
47 58
48void __init sn_timer_init(void) 59void __init sn_timer_init(void)
49{ 60{
50 sn2_interpolator.frequency = sn_rtc_cycles_per_second; 61 sn2_mc = RTC_COUNTER_ADDR;
51 sn2_interpolator.addr = RTC_COUNTER_ADDR; 62 clocksource_sn2.fsys_mmio = RTC_COUNTER_ADDR;
52 register_time_interpolator(&sn2_interpolator); 63 clocksource_sn2.mult = clocksource_hz2mult(sn_rtc_cycles_per_second,
64 clocksource_sn2.shift);
65 clocksource_register(&clocksource_sn2);
53 66
54 ia64_udelay = &ia64_sn_udelay; 67 ia64_udelay = &ia64_sn_udelay;
55} 68}