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 static void xs80200_irq_mask (unsigned int irq)
23 asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (intctl));
25 case IRQ_XS80200_BCU: intctl &= ~(1<<3); break;
26 case IRQ_XS80200_PMU: intctl &= ~(1<<2); break;
27 case IRQ_XS80200_EXTIRQ: intctl &= ~(1<<1); break;
28 case IRQ_XS80200_EXTFIQ: intctl &= ~(1<<0); break;
30 asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (intctl));
33 static void xs80200_irq_unmask (unsigned int irq)
36 asm ("mrc p13, 0, %0, c0, c0, 0" : "=r" (intctl));
38 case IRQ_XS80200_BCU: intctl |= (1<<3); break;
39 case IRQ_XS80200_PMU: intctl |= (1<<2); break;
40 case IRQ_XS80200_EXTIRQ: intctl |= (1<<1); break;
41 case IRQ_XS80200_EXTFIQ: intctl |= (1<<0); break;
43 asm ("mcr p13, 0, %0, c0, c0, 0" : : "r" (intctl));
46 static struct irqchip xs80200_chip = {
47 .ack = xs80200_irq_mask,
48 .mask = xs80200_irq_mask,
49 .unmask = xs80200_irq_unmask,
52 void __init xs80200_init_irq(void)
56 asm("mcr p13, 0, %0, c0, c0, 0" : : "r" (0));
58 for (i = 0; i < NR_XS80200_IRQS; i++) {
59 set_irq_chip(i, &xs80200_chip);
60 set_irq_handler(i, do_level_IRQ);
61 set_irq_flags(i, IRQF_VALID);