2 * linux/arch/arm/mach-iop3xx/xs80200-irq.c
4 * Generic IRQ handling for the XS80200 XScale core.
6 * Author: Nicolas Pitre
7 * Copyright: (C) 2001 MontaVista Software Inc.
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.
13 #include <linux/init.h>
14 #include <linux/list.h>
16 #include <asm/mach/irq.h>
18 #include <asm/hardware.h>
20 #include <asm/mach-types.h>
22 static void xs80200_irq_mask (unsigned int irq)
25 asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (intctl));
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;
32 asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (intctl));
35 static void xs80200_irq_unmask (unsigned int irq)
38 asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (intctl));
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;
45 asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (intctl));
48 static struct irqchip xs80200_chip = {
49 .ack = xs80200_irq_mask,
50 .mask = xs80200_irq_mask,
51 .unmask = xs80200_irq_unmask,
54 void __init xs80200_init_irq(void)
58 asm("mcr p13, 0, %0, c0, c0, 0" : : "r" (0));
60 for (i = 0; i < NR_XS80200_IRQS; i++) {
61 set_irq_chip(i, &xs80200_chip);
62 set_irq_handler(i, do_level_IRQ);
63 set_irq_flags(i, IRQF_VALID);