28 #define EXCEPT_OFFSET 0x80
29 #define PACE_OFFSET 0xA0
30 #define CHNLS_OFFSET 0x200
32 #define REG_OFFSET(irq, reg) ((irq) / 32 * 0x4 + reg * 0x10)
33 #define SEC_REG_OFFSET(reg) (EXCEPT_OFFSET + reg * 0x8)
34 #define SEC_SR_OFFSET (SEC_REG_OFFSET(0))
35 #define CR_OFFSET(irq) (REG_OFFSET(irq, 1))
36 #define SEC_CR_OFFSET (SEC_REG_OFFSET(1))
37 #define ESR_OFFSET(irq) (REG_OFFSET(irq, 2))
38 #define SEC_ESR_OFFSET (SEC_REG_OFFSET(2))
39 #define ECR_OFFSET(irq) (REG_OFFSET(irq, 3))
40 #define SEC_ECR_OFFSET (SEC_REG_OFFSET(3))
41 #define PIR_OFFSET (0x40)
42 #define MSR_OFFSET (0x44)
43 #define PM_OFFSET(irq) (REG_OFFSET(irq, 5))
44 #define TM_OFFSET(irq) (REG_OFFSET(irq, 6))
46 #define REG(addr) ((u32 *)(KSEG1ADDR(AR7_REGS_IRQ) + addr))
48 #define CHNL_OFFSET(chnl) (CHNLS_OFFSET + (chnl * 4))
50 static int ar7_irq_base;
52 static void ar7_unmask_irq(
struct irq_data *
d)
54 writel(1 << ((d->
irq - ar7_irq_base) % 32),
58 static void ar7_mask_irq(
struct irq_data *
d)
60 writel(1 << ((d->
irq - ar7_irq_base) % 32),
64 static void ar7_ack_irq(
struct irq_data *d)
66 writel(1 << ((d->
irq - ar7_irq_base) % 32),
70 static void ar7_unmask_sec_irq(
struct irq_data *d)
75 static void ar7_mask_sec_irq(
struct irq_data *d)
80 static void ar7_ack_sec_irq(
struct irq_data *d)
85 static struct irq_chip ar7_irq_type = {
87 .irq_unmask = ar7_unmask_irq,
88 .irq_mask = ar7_mask_irq,
89 .irq_ack = ar7_ack_irq
92 static struct irq_chip ar7_sec_irq_type = {
94 .irq_unmask = ar7_unmask_sec_irq,
95 .irq_mask = ar7_mask_sec_irq,
96 .irq_ack = ar7_ack_sec_irq,
99 static struct irqaction ar7_cascade_action = {
101 .name =
"AR7 cascade interrupt",
105 static void __init ar7_irq_init(
int base)
120 for (i = 0; i < 40; i++) {
123 irq_set_chip_and_handler(base + i, &ar7_irq_type,
127 irq_set_chip_and_handler(base + i + 40,
133 setup_irq(ar7_irq_base, &ar7_cascade_action);
143 static void ar7_cascade(
void)
151 do_IRQ(ar7_irq_base + irq);
158 for (i = 0; i < 32; i++) {
160 do_IRQ(ar7_irq_base + i + 40);