2 * arch/arm/mach-iop33x/irq.c
4 * Generic IOP331 IRQ handling functionality
6 * Author: Dave Jiang <dave.jiang@intel.com>
7 * Copyright (C) 2003 Intel Corp.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 #include <linux/init.h>
15 #include <linux/interrupt.h>
16 #include <linux/list.h>
17 #include <asm/mach/irq.h>
19 #include <asm/hardware.h>
20 #include <asm/mach-types.h>
22 static u32 iop33x_mask0;
23 static u32 iop33x_mask1;
25 static inline void intctl0_write(u32 val)
28 asm volatile("mcr p6, 0, %0, c0, c0, 0" : : "r" (val));
32 static inline void intctl1_write(u32 val)
35 asm volatile("mcr p6, 0, %0, c1, c0, 0" : : "r" (val));
39 static inline void intstr0_write(u32 val)
42 asm volatile("mcr p6, 0, %0, c2, c0, 0" : : "r" (val));
46 static inline void intstr1_write(u32 val)
49 asm volatile("mcr p6, 0, %0, c3, c0, 0" : : "r" (val));
53 static inline void intbase_write(u32 val)
56 asm volatile("mcr p6, 0, %0, c12, c0, 0" : : "r" (val));
60 static inline void intsize_write(u32 val)
63 asm volatile("mcr p6, 0, %0, c13, c0, 0" : : "r" (val));
68 iop33x_irq_mask1 (unsigned int irq)
70 iop33x_mask0 &= ~(1 << irq);
71 intctl0_write(iop33x_mask0);
75 iop33x_irq_mask2 (unsigned int irq)
77 iop33x_mask1 &= ~(1 << (irq - 32));
78 intctl1_write(iop33x_mask1);
82 iop33x_irq_unmask1(unsigned int irq)
84 iop33x_mask0 |= 1 << irq;
85 intctl0_write(iop33x_mask0);
89 iop33x_irq_unmask2(unsigned int irq)
91 iop33x_mask1 |= (1 << (irq - 32));
92 intctl1_write(iop33x_mask1);
95 struct irq_chip iop33x_irqchip1 = {
97 .ack = iop33x_irq_mask1,
98 .mask = iop33x_irq_mask1,
99 .unmask = iop33x_irq_unmask1,
102 struct irq_chip iop33x_irqchip2 = {
104 .ack = iop33x_irq_mask2,
105 .mask = iop33x_irq_mask2,
106 .unmask = iop33x_irq_unmask2,
109 void __init iop33x_init_irq(void)
119 if (machine_is_iq80331())
120 *IOP3XX_PCIIRSR = 0x0f;
122 for (i = 0; i < NR_IRQS; i++) {
123 set_irq_chip(i, (i < 32) ? &iop33x_irqchip1 : &iop33x_irqchip2);
124 set_irq_handler(i, do_level_IRQ);
125 set_irq_flags(i, IRQF_VALID | IRQF_PROBE);