aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/sgi-ip27/ip27-timer.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/sgi-ip27/ip27-timer.c')
-rw-r--r--arch/mips/sgi-ip27/ip27-timer.c51
1 files changed, 13 insertions, 38 deletions
diff --git a/arch/mips/sgi-ip27/ip27-timer.c b/arch/mips/sgi-ip27/ip27-timer.c
index 4e870fc4469b..c20e9899b34b 100644
--- a/arch/mips/sgi-ip27/ip27-timer.c
+++ b/arch/mips/sgi-ip27/ip27-timer.c
@@ -134,13 +134,6 @@ again:
134 irq_exit(); 134 irq_exit();
135} 135}
136 136
137unsigned long ip27_do_gettimeoffset(void)
138{
139 unsigned long ct_cur1;
140 ct_cur1 = REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT) + CYCLES_PER_JIFFY;
141 return (ct_cur1 - ct_cur[0]) * NSEC_PER_CYCLE / 1000;
142}
143
144/* Includes for ioc3_init(). */ 137/* Includes for ioc3_init(). */
145#include <asm/sn/types.h> 138#include <asm/sn/types.h>
146#include <asm/sn/sn0/addrs.h> 139#include <asm/sn/sn0/addrs.h>
@@ -179,15 +172,6 @@ static __init unsigned long get_m48t35_time(void)
179 return mktime(year, month, date, hour, min, sec); 172 return mktime(year, month, date, hour, min, sec);
180} 173}
181 174
182static unsigned int startup_rt_irq(unsigned int irq)
183{
184 return 0;
185}
186
187static void shutdown_rt_irq(unsigned int irq)
188{
189}
190
191static void enable_rt_irq(unsigned int irq) 175static void enable_rt_irq(unsigned int irq)
192{ 176{
193} 177}
@@ -196,22 +180,13 @@ static void disable_rt_irq(unsigned int irq)
196{ 180{
197} 181}
198 182
199static void mask_and_ack_rt(unsigned int irq)
200{
201}
202
203static void end_rt_irq(unsigned int irq)
204{
205}
206
207static struct irq_chip rt_irq_type = { 183static struct irq_chip rt_irq_type = {
208 .typename = "SN HUB RT timer", 184 .typename = "SN HUB RT timer",
209 .startup = startup_rt_irq, 185 .ack = disable_rt_irq,
210 .shutdown = shutdown_rt_irq, 186 .mask = disable_rt_irq,
211 .enable = enable_rt_irq, 187 .mask_ack = disable_rt_irq,
212 .disable = disable_rt_irq, 188 .unmask = enable_rt_irq,
213 .ack = mask_and_ack_rt, 189 .eoi = enable_rt_irq,
214 .end = end_rt_irq,
215}; 190};
216 191
217static struct irqaction rt_irqaction = { 192static struct irqaction rt_irqaction = {
@@ -221,8 +196,6 @@ static struct irqaction rt_irqaction = {
221 .name = "timer" 196 .name = "timer"
222}; 197};
223 198
224extern int allocate_irqno(void);
225
226void __init plat_timer_setup(struct irqaction *irq) 199void __init plat_timer_setup(struct irqaction *irq)
227{ 200{
228 int irqno = allocate_irqno(); 201 int irqno = allocate_irqno();
@@ -230,10 +203,7 @@ void __init plat_timer_setup(struct irqaction *irq)
230 if (irqno < 0) 203 if (irqno < 0)
231 panic("Can't allocate interrupt number for timer interrupt"); 204 panic("Can't allocate interrupt number for timer interrupt");
232 205
233 irq_desc[irqno].status = IRQ_DISABLED; 206 set_irq_chip_and_handler(irqno, &rt_irq_type, handle_percpu_irq);
234 irq_desc[irqno].action = NULL;
235 irq_desc[irqno].depth = 1;
236 irq_desc[irqno].chip = &rt_irq_type;
237 207
238 /* over-write the handler, we use our own way */ 208 /* over-write the handler, we use our own way */
239 irq->handler = no_action; 209 irq->handler = no_action;
@@ -248,12 +218,17 @@ void __init plat_timer_setup(struct irqaction *irq)
248 setup_irq(irqno, &rt_irqaction); 218 setup_irq(irqno, &rt_irqaction);
249} 219}
250 220
221static cycle_t ip27_hpt_read(void)
222{
223 return REMOTE_HUB_L(cputonasid(0), PI_RT_COUNT);
224}
225
251void __init ip27_time_init(void) 226void __init ip27_time_init(void)
252{ 227{
228 clocksource_mips.read = ip27_hpt_read;
229 mips_hpt_frequency = CYCLES_PER_SEC;
253 xtime.tv_sec = get_m48t35_time(); 230 xtime.tv_sec = get_m48t35_time();
254 xtime.tv_nsec = 0; 231 xtime.tv_nsec = 0;
255
256 do_gettimeoffset = ip27_do_gettimeoffset;
257} 232}
258 233
259void __init cpu_time_init(void) 234void __init cpu_time_init(void)