diff options
Diffstat (limited to 'arch/arm/mach-ns9xxx')
-rw-r--r-- | arch/arm/mach-ns9xxx/irq.c | 33 | ||||
-rw-r--r-- | arch/arm/mach-ns9xxx/time.c | 14 |
2 files changed, 14 insertions, 33 deletions
diff --git a/arch/arm/mach-ns9xxx/irq.c b/arch/arm/mach-ns9xxx/irq.c index b8c7b00522e6..24d424e10e4c 100644 --- a/arch/arm/mach-ns9xxx/irq.c +++ b/arch/arm/mach-ns9xxx/irq.c | |||
@@ -17,33 +17,6 @@ | |||
17 | 17 | ||
18 | #include "generic.h" | 18 | #include "generic.h" |
19 | 19 | ||
20 | static void ns9xxx_ack_irq_timer(unsigned int irq) | ||
21 | { | ||
22 | u32 tc = SYS_TC(irq - IRQ_TIMER0); | ||
23 | |||
24 | /* | ||
25 | * If the timer is programmed to halt on terminal count, the | ||
26 | * timer must be disabled before clearing the interrupt. | ||
27 | */ | ||
28 | if (REGGET(tc, SYS_TCx, REN) == 0) { | ||
29 | REGSET(tc, SYS_TCx, TEN, DIS); | ||
30 | SYS_TC(irq - IRQ_TIMER0) = tc; | ||
31 | } | ||
32 | |||
33 | REGSET(tc, SYS_TCx, INTC, SET); | ||
34 | SYS_TC(irq - IRQ_TIMER0) = tc; | ||
35 | |||
36 | REGSET(tc, SYS_TCx, INTC, UNSET); | ||
37 | SYS_TC(irq - IRQ_TIMER0) = tc; | ||
38 | } | ||
39 | |||
40 | static void (*ns9xxx_ack_irq_functions[NR_IRQS])(unsigned int) = { | ||
41 | [IRQ_TIMER0] = ns9xxx_ack_irq_timer, | ||
42 | [IRQ_TIMER1] = ns9xxx_ack_irq_timer, | ||
43 | [IRQ_TIMER2] = ns9xxx_ack_irq_timer, | ||
44 | [IRQ_TIMER3] = ns9xxx_ack_irq_timer, | ||
45 | }; | ||
46 | |||
47 | static void ns9xxx_mask_irq(unsigned int irq) | 20 | static void ns9xxx_mask_irq(unsigned int irq) |
48 | { | 21 | { |
49 | /* XXX: better use cpp symbols */ | 22 | /* XXX: better use cpp symbols */ |
@@ -52,12 +25,6 @@ static void ns9xxx_mask_irq(unsigned int irq) | |||
52 | 25 | ||
53 | static void ns9xxx_ack_irq(unsigned int irq) | 26 | static void ns9xxx_ack_irq(unsigned int irq) |
54 | { | 27 | { |
55 | if (!ns9xxx_ack_irq_functions[irq]) { | ||
56 | printk(KERN_ERR "no ack function for irq %u\n", irq); | ||
57 | BUG(); | ||
58 | } | ||
59 | |||
60 | ns9xxx_ack_irq_functions[irq](irq); | ||
61 | SYS_ISRADDR = 0; | 28 | SYS_ISRADDR = 0; |
62 | } | 29 | } |
63 | 30 | ||
diff --git a/arch/arm/mach-ns9xxx/time.c b/arch/arm/mach-ns9xxx/time.c index b97d0c54a388..3327d302618d 100644 --- a/arch/arm/mach-ns9xxx/time.c +++ b/arch/arm/mach-ns9xxx/time.c | |||
@@ -24,10 +24,24 @@ static u32 usecs_per_tick; | |||
24 | static irqreturn_t | 24 | static irqreturn_t |
25 | ns9xxx_timer_interrupt(int irq, void *dev_id) | 25 | ns9xxx_timer_interrupt(int irq, void *dev_id) |
26 | { | 26 | { |
27 | int timerno = irq - IRQ_TIMER0; | ||
28 | u32 tc; | ||
29 | |||
27 | write_seqlock(&xtime_lock); | 30 | write_seqlock(&xtime_lock); |
28 | timer_tick(); | 31 | timer_tick(); |
29 | write_sequnlock(&xtime_lock); | 32 | write_sequnlock(&xtime_lock); |
30 | 33 | ||
34 | /* clear irq */ | ||
35 | tc = SYS_TC(timerno); | ||
36 | if (REGGET(tc, SYS_TCx, REN) == SYS_TCx_REN_DIS) { | ||
37 | REGSET(tc, SYS_TCx, TEN, DIS); | ||
38 | SYS_TC(timerno) = tc; | ||
39 | } | ||
40 | REGSET(tc, SYS_TCx, INTC, SET); | ||
41 | SYS_TC(timerno) = tc; | ||
42 | REGSET(tc, SYS_TCx, INTC, UNSET); | ||
43 | SYS_TC(timerno) = tc; | ||
44 | |||
31 | return IRQ_HANDLED; | 45 | return IRQ_HANDLED; |
32 | } | 46 | } |
33 | 47 | ||