2 * linux/arch/arm/mach-clps711x/irq.c
4 * Copyright (C) 2000 Deep Blue Solutions Ltd.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 #include <linux/init.h>
22 #include <asm/mach/irq.h>
23 #include <asm/hardware.h>
27 #include <asm/hardware/clps7111.h>
29 static void mask_irq_int1(unsigned int irq)
33 intmr1 = clps_readl(INTMR1);
34 intmr1 &= ~(1 << irq);
35 clps_writel(intmr1, INTMR1);
38 static void mask_ack_irq_int1(unsigned int irq)
42 intmr1 = clps_readl(INTMR1);
43 intmr1 &= ~(1 << irq);
44 clps_writel(intmr1, INTMR1);
47 case IRQ_CSINT: clps_writel(0, COEOI); break;
48 case IRQ_TC1OI: clps_writel(0, TC1EOI); break;
49 case IRQ_TC2OI: clps_writel(0, TC2EOI); break;
50 case IRQ_RTCMI: clps_writel(0, RTCEOI); break;
51 case IRQ_TINT: clps_writel(0, TEOI); break;
52 case IRQ_UMSINT: clps_writel(0, UMSEOI); break;
56 static void unmask_irq_int1(unsigned int irq)
60 intmr1 = clps_readl(INTMR1);
62 clps_writel(intmr1, INTMR1);
65 static void mask_irq_int2(unsigned int irq)
69 intmr2 = clps_readl(INTMR2);
70 intmr2 &= ~(1 << (irq - 16));
71 clps_writel(intmr2, INTMR2);
74 static void mask_ack_irq_int2(unsigned int irq)
78 intmr2 = clps_readl(INTMR2);
79 intmr2 &= ~(1 << (irq - 16));
80 clps_writel(intmr2, INTMR2);
83 case IRQ_KBDINT: clps_writel(0, KBDEOI); break;
87 static void unmask_irq_int2(unsigned int irq)
91 intmr2 = clps_readl(INTMR2);
92 intmr2 |= 1 << (irq - 16);
93 clps_writel(intmr2, INTMR2);
96 void __init clps711x_init_irq(void)
100 for (i = 0; i < NR_IRQS; i++) {
101 if (INT1_IRQS & (1 << i)) {
102 irq_desc[i].valid = 1;
103 irq_desc[i].probe_ok = 1;
104 irq_desc[i].mask_ack = (INT1_ACK_IRQS & (1 << i)) ?
107 irq_desc[i].mask = mask_irq_int1;
108 irq_desc[i].unmask = unmask_irq_int1;
110 if (INT2_IRQS & (1 << i)) {
111 irq_desc[i].valid = 1;
112 irq_desc[i].probe_ok = 1;
113 irq_desc[i].mask_ack = (INT2_ACK_IRQS & (1 << i)) ?
116 irq_desc[i].mask = mask_irq_int2;
117 irq_desc[i].unmask = unmask_irq_int2;
124 clps_writel(0, INTMR1);
125 clps_writel(0, INTMR2);
128 * Clear down any pending interrupts
130 clps_writel(0, COEOI);
131 clps_writel(0, TC1EOI);
132 clps_writel(0, TC2EOI);
133 clps_writel(0, RTCEOI);
134 clps_writel(0, TEOI);
135 clps_writel(0, UMSEOI);
136 clps_writel(0, SYNCIO);
137 clps_writel(0, KBDEOI);