8 #include <linux/kernel.h>
9 #include <linux/sched.h>
14 #include <linux/time.h>
15 #include <linux/timex.h>
20 #include <asm/pgtable.h>
22 #include <asm/sn/ioc3.h>
23 #include <asm/sn/klconfig.h>
24 #include <asm/sn/arch.h>
25 #include <asm/sn/addrs.h>
30 #define TICK_SIZE (tick_nsec / 1000)
33 #include <asm/sn/types.h>
39 static void enable_rt_irq(
struct irq_data *
d)
43 static void disable_rt_irq(
struct irq_data *
d)
47 static struct irq_chip rt_irq_type = {
48 .name =
"SN HUB RT timer",
49 .irq_mask = disable_rt_irq,
50 .irq_unmask = enable_rt_irq,
53 static int rt_next_event(
unsigned long delta,
struct clock_event_device *
evt)
66 static void rt_set_mode(
enum clock_event_mode
mode,
67 struct clock_event_device *
evt)
74 static DEFINE_PER_CPU(
struct clock_event_device, hub_rt_clockevent);
80 struct clock_event_device *
cd = &
per_cpu(hub_rt_clockevent, cpu);
87 cd->event_handler(cd);
93 .handler = hub_rt_counter_handler,
106 #define NSEC_PER_CYCLE 800
107 #define CYCLES_PER_SEC (NSEC_PER_SEC / NSEC_PER_CYCLE)
112 struct clock_event_device *cd = &
per_cpu(hub_rt_clockevent, cpu);
116 sprintf(name,
"hub-rt %d", cpu);
118 cd->features = CLOCK_EVT_FEAT_ONESHOT;
125 cd->set_next_event = rt_next_event;
126 cd->set_mode = rt_set_mode;
130 static void __init hub_rt_clock_event_global_init(
void)
142 panic(
"Allocation of irq number for timer failed");
162 static void __init hub_rt_clocksource_init(
void)
171 hub_rt_clocksource_init();
172 hub_rt_clock_event_global_init();
185 panic(
"Can't find board info for myself.");
190 panic(
"No information about myself?");
216 static int __init sgi_ip27_rtc_devinit(
void)
223 res.end =
res.start + 32767;
226 return IS_ERR(platform_device_register_simple(
"rtc-m48t35", -1,