patch-2_6_7-vs1_9_1_12
[linux-2.6.git] / arch / arm / mach-adifcc / irq.c
1 /*
2  * linux/arch/arm/mach-xscale/irq.c
3  *
4  * Author:  Deepak Saxena
5  * Copyright:   (C) 2001 MontaVista Software Inc.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * Based on IOP80310 code.  Currently there's nothing more than the
12  * 80200 on chip interrupts. That'll change once the hardware adds
13  * support for PCI though.
14  */
15 #include <linux/init.h>
16 #include <linux/interrupt.h>
17
18 #include <asm/mach/irq.h>
19 #include <asm/irq.h>
20 #include <asm/hardware.h>
21
22 static void xs80200_irq_mask (unsigned int irq)
23 {
24         long INTCTL;
25         asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (INTCTL));
26         switch (irq) {
27             case IRQ_XS80200_BCU:     INTCTL &= ~(1<<3); break;
28             case IRQ_XS80200_PMU:     INTCTL &= ~(1<<2); break;
29             case IRQ_XS80200_EXTIRQ:  INTCTL &= ~(1<<1); break;
30             case IRQ_XS80200_EXTFIQ:  INTCTL &= ~(1<<0); break;
31         }
32         asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (INTCTL));
33 }
34
35 static void xs80200_irq_unmask (unsigned int irq)
36 {
37         long INTCTL;
38         asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (INTCTL));
39         switch (irq) {
40             case IRQ_XS80200_BCU:       INTCTL |= (1<<3); break;
41             case IRQ_XS80200_PMU:       INTCTL |= (1<<2); break;
42             case IRQ_XS80200_EXTIRQ:    INTCTL |= (1<<1); break;
43             case IRQ_XS80200_EXTFIQ:    INTCTL |= (1<<0); break;
44         }
45         asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (INTCTL));
46 }
47
48 void __init adifcc_init_irq(void)
49 {
50         int i;
51
52         for (i = 0; i < NR_XS80200_IRQS; i++) {
53                 irq_desc[i].valid       = 1;
54                 irq_desc[i].probe_ok    = 0;
55                 irq_desc[i].mask_ack    = xs80200_irq_mask;
56                 irq_desc[i].mask        = xs80200_irq_mask;
57                 irq_desc[i].unmask      = xs80200_irq_unmask;
58         }
59 }
60
61