summaryrefslogtreecommitdiffstats
path: root/arch/ia64/sn/kernel/sn2/timer.c
diff options
context:
space:
mode:
authorTony Luck <tony.luck@intel.com>2007-07-20 11:26:47 -0700
committerTony Luck <tony.luck@intel.com>2007-07-20 11:26:47 -0700
commitc36c282b88963d0957368a443168588e62301fda (patch)
tree6343887ae42a65635a61b4ad99fd7f3e8dd24758 /arch/ia64/sn/kernel/sn2/timer.c
parentf4fbfb0dda5577075a049eec7fb7ad38abca1912 (diff)
parent1f564ad6d4182859612cbae452122e5eb2d62a76 (diff)
downloadtalos-op-linux-c36c282b88963d0957368a443168588e62301fda.tar.gz
talos-op-linux-c36c282b88963d0957368a443168588e62301fda.zip
Pull ia64-clocksource into release branch
Diffstat (limited to 'arch/ia64/sn/kernel/sn2/timer.c')
-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 @@
#include <linux/sched.h>
#include <linux/time.h>
#include <linux/interrupt.h>
+#include <linux/clocksource.h>
#include <asm/hw_irq.h>
#include <asm/system.h>
@@ -22,11 +23,21 @@
extern unsigned long sn_rtc_cycles_per_second;
-static struct time_interpolator sn2_interpolator = {
- .drift = -1,
- .shift = 10,
- .mask = (1LL << 55) - 1,
- .source = TIME_SOURCE_MMIO64
+static void __iomem *sn2_mc;
+
+static cycle_t read_sn2(void)
+{
+ return (cycle_t)readq(sn2_mc);
+}
+
+static struct clocksource clocksource_sn2 = {
+ .name = "sn2_rtc",
+ .rating = 300,
+ .read = read_sn2,
+ .mask = (1LL << 55) - 1,
+ .mult = 0,
+ .shift = 10,
+ .flags = CLOCK_SOURCE_IS_CONTINUOUS,
};
/*
@@ -47,9 +58,11 @@ ia64_sn_udelay (unsigned long usecs)
void __init sn_timer_init(void)
{
- sn2_interpolator.frequency = sn_rtc_cycles_per_second;
- sn2_interpolator.addr = RTC_COUNTER_ADDR;
- register_time_interpolator(&sn2_interpolator);
+ sn2_mc = RTC_COUNTER_ADDR;
+ clocksource_sn2.fsys_mmio = RTC_COUNTER_ADDR;
+ clocksource_sn2.mult = clocksource_hz2mult(sn_rtc_cycles_per_second,
+ clocksource_sn2.shift);
+ clocksource_register(&clocksource_sn2);
ia64_udelay = &ia64_sn_udelay;
}
OpenPOWER on IntegriCloud