20 #include <linux/module.h>
25 #include <mach/common.h>
27 #include <asm/exception.h>
28 #include <mach/hardware.h>
29 #include <mach/irqs.h>
33 #define AVIC_INTCNTL 0x00
34 #define AVIC_NIMASK 0x04
35 #define AVIC_INTENNUM 0x08
36 #define AVIC_INTDISNUM 0x0C
37 #define AVIC_INTENABLEH 0x10
38 #define AVIC_INTENABLEL 0x14
39 #define AVIC_INTTYPEH 0x18
40 #define AVIC_INTTYPEL 0x1C
41 #define AVIC_NIPRIORITY(x) (0x20 + 4 * (7 - (x)))
42 #define AVIC_NIVECSR 0x40
43 #define AVIC_FIVECSR 0x44
44 #define AVIC_INTSRCH 0x48
45 #define AVIC_INTSRCL 0x4C
46 #define AVIC_INTFRCH 0x50
47 #define AVIC_INTFRCL 0x54
48 #define AVIC_NIPNDH 0x58
49 #define AVIC_NIPNDL 0x5C
50 #define AVIC_FIPNDH 0x60
51 #define AVIC_FIPNDL 0x64
53 #define AVIC_NUM_IRQS 64
58 static u32 avic_saved_mask_reg[2];
60 #ifdef CONFIG_MXC_IRQ_PRIOR
61 static int avic_irq_set_priority(
unsigned char irq,
unsigned char prio)
65 unsigned int mask = 0x0F << irq % 8 * 4;
83 static int avic_set_irq_fiq(
unsigned int irq,
unsigned int type)
108 #ifdef CONFIG_MXC_IRQ_PRIOR
109 .set_priority = avic_irq_set_priority,
112 .set_irq_fiq = avic_set_irq_fiq,
119 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
120 struct irq_chip_type *
ct = gc->chip_types;
129 struct irq_chip_generic *
gc = irq_data_get_irq_chip_data(d);
130 struct irq_chip_type *
ct = gc->chip_types;
137 #define avic_irq_suspend NULL
138 #define avic_irq_resume NULL
141 static __init void avic_init_gc(
int idx,
unsigned int irq_start)
143 struct irq_chip_generic *
gc;
144 struct irq_chip_type *
ct;
148 gc->private = &avic_extra_irq;
149 gc->wake_enabled = IRQ_MSK(32);
159 ct->regs.ack = ct->regs.mask;
170 if (nivector == 0xffff)
213 avic_init_gc(i, irq_base);
216 for (i = 0; i < 8; i++)