aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/sgi-ip27/ip27-irq.c2
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c61
2 files changed, 60 insertions, 3 deletions
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 2e643d2f51cb..0b61a39ce2bb 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -360,7 +360,7 @@ static struct hw_interrupt_type bridge_irq_type = {
360 360
361static unsigned long irq_map[NR_IRQS / BITS_PER_LONG]; 361static unsigned long irq_map[NR_IRQS / BITS_PER_LONG];
362 362
363static int allocate_irqno(void) 363int allocate_irqno(void)
364{ 364{
365 int irq; 365 int irq;
366 366
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 36b662e27b6e..1fb860c7ac6d 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -89,11 +89,13 @@ static int set_rtc_mmss(unsigned long nowtime)
89} 89}
90#endif 90#endif
91 91
92static unsigned int rt_timer_irq;
93
92void ip27_rt_timer_interrupt(struct pt_regs *regs) 94void ip27_rt_timer_interrupt(struct pt_regs *regs)
93{ 95{
94 int cpu = smp_processor_id(); 96 int cpu = smp_processor_id();
95 int cpuA = cputoslice(cpu) == 0; 97 int cpuA = cputoslice(cpu) == 0;
96 int irq = 9; /* XXX Assign number */ 98 unsigned int irq = rt_timer_irq;
97 99
98 irq_enter(); 100 irq_enter();
99 write_seqlock(&xtime_lock); 101 write_seqlock(&xtime_lock);
@@ -179,13 +181,68 @@ static __init unsigned long get_m48t35_time(void)
179 return mktime(year, month, date, hour, min, sec); 181 return mktime(year, month, date, hour, min, sec);
180} 182}
181 183
184static void startup_rt_irq(unsigned int irq)
185{
186}
187
188static void shutdown_rt_irq(unsigned int irq)
189{
190}
191
192static void enable_rt_irq(unsigned int irq)
193{
194}
195
196static void disable_rt_irq(unsigned int irq)
197{
198}
199
200static void mask_and_ack_rt(unsigned int irq)
201{
202}
203
204static void end_rt_irq(unsigned int irq)
205{
206}
207
208static struct hw_interrupt_type rt_irq_type = {
209 .typename = "SN HUB RT timer",
210 .startup = startup_rt_irq,
211 .shutdown = shutdown_rt_irq,
212 .enable = enable_rt_irq,
213 .disable = disable_rt_irq,
214 .ack = mask_and_ack_rt,
215 .end = end_rt_irq,
216};
217
218static struct irqaction rt_irqaction = {
219 .handler = ip27_rt_timer_interrupt,
220 .flags = SA_INTERRUPT,
221 .mask = CPU_MASK_NONE,
222 .name = "timer"
223};
224
225extern int allocate_irqno(void);
226
182static void ip27_timer_setup(struct irqaction *irq) 227static void ip27_timer_setup(struct irqaction *irq)
183{ 228{
229 int irqno = allocate_irqno();
230
231 if (irqno < 0)
232 panic("Can't allocate interrupt number for timer interrupt");
233
234 irq_desc[irqno].status = IRQ_DISABLED;
235 irq_desc[irqno].action = NULL;
236 irq_desc[irqno].depth = 1;
237 irq_desc[irqno].handler = &rt_irq_type;
238
184 /* over-write the handler, we use our own way */ 239 /* over-write the handler, we use our own way */
185 irq->handler = no_action; 240 irq->handler = no_action;
186 241
187 /* setup irqaction */ 242 /* setup irqaction */
188// setup_irq(IP27_TIMER_IRQ, irq); /* XXX Can't do this yet. */ 243 irq_desc[irqno].status |= IRQ_PER_CPU;
244
245 rt_timer_irq = irqno;
189} 246}
190 247
191void __init ip27_time_init(void) 248void __init ip27_time_init(void)