aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/intc-sh7367.c
diff options
context:
space:
mode:
authorMagnus Damm <damm@opensource.se>2010-02-08 22:35:42 -0500
committerPaul Mundt <lethal@linux-sh.org>2010-02-09 04:01:42 -0500
commitf8eef1305b33438dd7a3a01e43b94e57ca87fc9b (patch)
tree4ffd800fc3a872502aa8780444f24142135537e6 /arch/arm/mach-shmobile/intc-sh7367.c
parent4ae04acb81256719a71125c0f0280e2a3ad68e25 (diff)
ARM: mach-shmobile: sh7367 INTCA support
Add support for the sh7367 INTCA hardware block. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/arm/mach-shmobile/intc-sh7367.c')
-rw-r--r--arch/arm/mach-shmobile/intc-sh7367.c270
1 files changed, 270 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/intc-sh7367.c b/arch/arm/mach-shmobile/intc-sh7367.c
new file mode 100644
index 000000000000..6a547b47aabb
--- /dev/null
+++ b/arch/arm/mach-shmobile/intc-sh7367.c
@@ -0,0 +1,270 @@
1/*
2 * sh7367 processor support - INTC hardware block
3 *
4 * Copyright (C) 2010 Magnus Damm
5 *
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; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#include <linux/kernel.h>
20#include <linux/init.h>
21#include <linux/interrupt.h>
22#include <linux/irq.h>
23#include <linux/io.h>
24#include <linux/sh_intc.h>
25#include <asm/mach-types.h>
26#include <asm/mach/arch.h>
27
28enum {
29 UNUSED_INTCA = 0,
30
31 /* interrupt sources INTCA */
32 IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A,
33 IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A,
34 DIRC,
35 CRYPT1_ERR, CRYPT2_STD,
36 IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1,
37 ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMRX,
38 ETM11_ACQCMP, ETM11_FULL,
39 MFI_MFIM, MFI_MFIS,
40 BBIF1, BBIF2,
41 USBDMAC_USHDMI,
42 USBHS_USHI0, USBHS_USHI1,
43 CMT1_CMT10, CMT1_CMT11, CMT1_CMT12, CMT1_CMT13, CMT2, CMT3,
44 KEYSC_KEY,
45 SCIFA0, SCIFA1, SCIFA2, SCIFA3,
46 MSIOF2, MSIOF1,
47 SCIFA4, SCIFA5, SCIFB,
48 FLCTL_FLSTEI, FLCTL_FLTENDI, FLCTL_FLTREQ0I, FLCTL_FLTREQ1I,
49 SDHI0_SDHI0I0, SDHI0_SDHI0I1, SDHI0_SDHI0I2, SDHI0_SDHI0I3,
50 SDHI1_SDHI1I0, SDHI1_SDHI1I1, SDHI1_SDHI1I2, SDHI1_SDHI1I3,
51 MSU_MSU, MSU_MSU2,
52 IREM,
53 SIU,
54 SPU,
55 IRDA,
56 TPU0, TPU1, TPU2, TPU3, TPU4,
57 LCRC,
58 PINT1, PINT2,
59 TTI20,
60 MISTY,
61 DDM,
62 SDHI2_SDHI2I0, SDHI2_SDHI2I1, SDHI2_SDHI2I2, SDHI2_SDHI2I3,
63 RWDT0, RWDT1,
64 DMAC_1_DEI0, DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3,
65 DMAC_2_DEI4, DMAC_2_DEI5, DMAC_2_DADERR,
66 DMAC2_1_DEI0, DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3,
67 DMAC2_2_DEI4, DMAC2_2_DEI5, DMAC2_2_DADERR,
68 DMAC3_1_DEI0, DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3,
69 DMAC3_2_DEI4, DMAC3_2_DEI5, DMAC3_2_DADERR,
70
71 /* interrupt groups INTCA */
72 DMAC_1, DMAC_2, DMAC2_1, DMAC2_2, DMAC3_1, DMAC3_2,
73 ETM11, ARM11, USBHS, FLCTL, IIC1, SDHI0, SDHI1, SDHI2,
74};
75
76static struct intc_vect intca_vectors[] = {
77 INTC_VECT(IRQ0A, 0x0200), INTC_VECT(IRQ1A, 0x0220),
78 INTC_VECT(IRQ2A, 0x0240), INTC_VECT(IRQ3A, 0x0260),
79 INTC_VECT(IRQ4A, 0x0280), INTC_VECT(IRQ5A, 0x02a0),
80 INTC_VECT(IRQ6A, 0x02c0), INTC_VECT(IRQ7A, 0x02e0),
81 INTC_VECT(IRQ8A, 0x0300), INTC_VECT(IRQ9A, 0x0320),
82 INTC_VECT(IRQ10A, 0x0340), INTC_VECT(IRQ11A, 0x0360),
83 INTC_VECT(IRQ12A, 0x0380), INTC_VECT(IRQ13A, 0x03a0),
84 INTC_VECT(IRQ14A, 0x03c0), INTC_VECT(IRQ15A, 0x03e0),
85 INTC_VECT(DIRC, 0x0560),
86 INTC_VECT(CRYPT1_ERR, 0x05e0),
87 INTC_VECT(CRYPT2_STD, 0x0700),
88 INTC_VECT(IIC1_ALI1, 0x0780), INTC_VECT(IIC1_TACKI1, 0x07a0),
89 INTC_VECT(IIC1_WAITI1, 0x07c0), INTC_VECT(IIC1_DTEI1, 0x07e0),
90 INTC_VECT(ARM11_IRQPMU, 0x0800), INTC_VECT(ARM11_COMMTX, 0x0840),
91 INTC_VECT(ARM11_COMMRX, 0x0860),
92 INTC_VECT(ETM11_ACQCMP, 0x0880), INTC_VECT(ETM11_FULL, 0x08a0),
93 INTC_VECT(MFI_MFIM, 0x0900), INTC_VECT(MFI_MFIS, 0x0920),
94 INTC_VECT(BBIF1, 0x0940), INTC_VECT(BBIF2, 0x0960),
95 INTC_VECT(USBDMAC_USHDMI, 0x0a00),
96 INTC_VECT(USBHS_USHI0, 0x0a20), INTC_VECT(USBHS_USHI1, 0x0a40),
97 INTC_VECT(CMT1_CMT10, 0x0b00), INTC_VECT(CMT1_CMT11, 0x0b20),
98 INTC_VECT(CMT1_CMT12, 0x0b40), INTC_VECT(CMT1_CMT13, 0x0b60),
99 INTC_VECT(CMT2, 0x0b80), INTC_VECT(CMT3, 0x0ba0),
100 INTC_VECT(KEYSC_KEY, 0x0be0),
101 INTC_VECT(SCIFA0, 0x0c00), INTC_VECT(SCIFA1, 0x0c20),
102 INTC_VECT(SCIFA2, 0x0c40), INTC_VECT(SCIFA3, 0x0c60),
103 INTC_VECT(MSIOF2, 0x0c80), INTC_VECT(MSIOF1, 0x0d00),
104 INTC_VECT(SCIFA4, 0x0d20), INTC_VECT(SCIFA5, 0x0d40),
105 INTC_VECT(SCIFB, 0x0d60),
106 INTC_VECT(FLCTL_FLSTEI, 0x0d80), INTC_VECT(FLCTL_FLTENDI, 0x0da0),
107 INTC_VECT(FLCTL_FLTREQ0I, 0x0dc0), INTC_VECT(FLCTL_FLTREQ1I, 0x0de0),
108 INTC_VECT(SDHI0_SDHI0I0, 0x0e00), INTC_VECT(SDHI0_SDHI0I1, 0x0e20),
109 INTC_VECT(SDHI0_SDHI0I2, 0x0e40), INTC_VECT(SDHI0_SDHI0I3, 0x0e60),
110 INTC_VECT(SDHI1_SDHI1I0, 0x0e80), INTC_VECT(SDHI1_SDHI1I1, 0x0ea0),
111 INTC_VECT(SDHI1_SDHI1I2, 0x0ec0), INTC_VECT(SDHI1_SDHI1I3, 0x0ee0),
112 INTC_VECT(MSU_MSU, 0x0f20), INTC_VECT(MSU_MSU2, 0x0f40),
113 INTC_VECT(IREM, 0x0f60),
114 INTC_VECT(SIU, 0x0fa0),
115 INTC_VECT(SPU, 0x0fc0),
116 INTC_VECT(IRDA, 0x0480),
117 INTC_VECT(TPU0, 0x04a0), INTC_VECT(TPU1, 0x04c0),
118 INTC_VECT(TPU2, 0x04e0), INTC_VECT(TPU3, 0x0500),
119 INTC_VECT(TPU4, 0x0520),
120 INTC_VECT(LCRC, 0x0540),
121 INTC_VECT(PINT1, 0x1000), INTC_VECT(PINT2, 0x1020),
122 INTC_VECT(TTI20, 0x1100),
123 INTC_VECT(MISTY, 0x1120),
124 INTC_VECT(DDM, 0x1140),
125 INTC_VECT(SDHI2_SDHI2I0, 0x1200), INTC_VECT(SDHI2_SDHI2I1, 0x1220),
126 INTC_VECT(SDHI2_SDHI2I2, 0x1240), INTC_VECT(SDHI2_SDHI2I3, 0x1260),
127 INTC_VECT(RWDT0, 0x1280), INTC_VECT(RWDT1, 0x12a0),
128 INTC_VECT(DMAC_1_DEI0, 0x2000), INTC_VECT(DMAC_1_DEI1, 0x2020),
129 INTC_VECT(DMAC_1_DEI2, 0x2040), INTC_VECT(DMAC_1_DEI3, 0x2060),
130 INTC_VECT(DMAC_2_DEI4, 0x2080), INTC_VECT(DMAC_2_DEI5, 0x20a0),
131 INTC_VECT(DMAC_2_DADERR, 0x20c0),
132 INTC_VECT(DMAC2_1_DEI0, 0x2100), INTC_VECT(DMAC2_1_DEI1, 0x2120),
133 INTC_VECT(DMAC2_1_DEI2, 0x2140), INTC_VECT(DMAC2_1_DEI3, 0x2160),
134 INTC_VECT(DMAC2_2_DEI4, 0x2180), INTC_VECT(DMAC2_2_DEI5, 0x21a0),
135 INTC_VECT(DMAC2_2_DADERR, 0x21c0),
136 INTC_VECT(DMAC3_1_DEI0, 0x2200), INTC_VECT(DMAC3_1_DEI1, 0x2220),
137 INTC_VECT(DMAC3_1_DEI2, 0x2240), INTC_VECT(DMAC3_1_DEI3, 0x2260),
138 INTC_VECT(DMAC3_2_DEI4, 0x2280), INTC_VECT(DMAC3_2_DEI5, 0x22a0),
139 INTC_VECT(DMAC3_2_DADERR, 0x22c0),
140};
141
142static struct intc_group intca_groups[] __initdata = {
143 INTC_GROUP(DMAC_1, DMAC_1_DEI0,
144 DMAC_1_DEI1, DMAC_1_DEI2, DMAC_1_DEI3),
145 INTC_GROUP(DMAC_2, DMAC_2_DEI4,
146 DMAC_2_DEI5, DMAC_2_DADERR),
147 INTC_GROUP(DMAC2_1, DMAC2_1_DEI0,
148 DMAC2_1_DEI1, DMAC2_1_DEI2, DMAC2_1_DEI3),
149 INTC_GROUP(DMAC2_2, DMAC2_2_DEI4,
150 DMAC2_2_DEI5, DMAC2_2_DADERR),
151 INTC_GROUP(DMAC3_1, DMAC3_1_DEI0,
152 DMAC3_1_DEI1, DMAC3_1_DEI2, DMAC3_1_DEI3),
153 INTC_GROUP(DMAC3_2, DMAC3_2_DEI4,
154 DMAC3_2_DEI5, DMAC3_2_DADERR),
155 INTC_GROUP(ETM11, ETM11_ACQCMP, ETM11_FULL),
156 INTC_GROUP(ARM11, ARM11_IRQPMU, ARM11_COMMTX, ARM11_COMMTX),
157 INTC_GROUP(USBHS, USBHS_USHI0, USBHS_USHI1),
158 INTC_GROUP(FLCTL, FLCTL_FLSTEI, FLCTL_FLTENDI,
159 FLCTL_FLTREQ0I, FLCTL_FLTREQ1I),
160 INTC_GROUP(IIC1, IIC1_ALI1, IIC1_TACKI1, IIC1_WAITI1, IIC1_DTEI1),
161 INTC_GROUP(SDHI0, SDHI0_SDHI0I0, SDHI0_SDHI0I1,
162 SDHI0_SDHI0I2, SDHI0_SDHI0I3),
163 INTC_GROUP(SDHI1, SDHI1_SDHI1I0, SDHI1_SDHI1I1,
164 SDHI1_SDHI1I2, SDHI1_SDHI1I3),
165 INTC_GROUP(SDHI2, SDHI2_SDHI2I0, SDHI2_SDHI2I1,
166 SDHI2_SDHI2I2, SDHI2_SDHI2I3),
167};
168
169static struct intc_mask_reg intca_mask_registers[] = {
170 { 0xe6900040, 0xe6900060, 8, /* INTMSK00A / INTMSKCLR00A */
171 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
172 { 0xe6900044, 0xe6900064, 8, /* INTMSK10A / INTMSKCLR10A */
173 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
174 { 0xe6940080, 0xe69400c0, 8, /* IMR0A / IMCR0A */
175 { DMAC2_1_DEI3, DMAC2_1_DEI2, DMAC2_1_DEI1, DMAC2_1_DEI0,
176 ARM11_IRQPMU, 0, ARM11_COMMTX, ARM11_COMMRX } },
177 { 0xe6940084, 0xe69400c4, 8, /* IMR1A / IMCR1A */
178 { CRYPT1_ERR, CRYPT2_STD, DIRC, 0,
179 DMAC_1_DEI3, DMAC_1_DEI2, DMAC_1_DEI1, DMAC_1_DEI0 } },
180 { 0xe6940088, 0xe69400c8, 8, /* IMR2A / IMCR2A */
181 { PINT1, PINT2, 0, 0,
182 BBIF1, BBIF2, MFI_MFIS, MFI_MFIM } },
183 { 0xe694008c, 0xe69400cc, 8, /* IMR3A / IMCR3A */
184 { DMAC3_1_DEI3, DMAC3_1_DEI2, DMAC3_1_DEI1, DMAC3_1_DEI0,
185 DMAC3_2_DADERR, DMAC3_2_DEI5, DMAC3_2_DEI4, IRDA } },
186 { 0xe6940090, 0xe69400d0, 8, /* IMR4A / IMCR4A */
187 { DDM, 0, 0, 0,
188 0, 0, ETM11_FULL, ETM11_ACQCMP } },
189 { 0xe6940094, 0xe69400d4, 8, /* IMR5A / IMCR5A */
190 { KEYSC_KEY, DMAC_2_DADERR, DMAC_2_DEI5, DMAC_2_DEI4,
191 SCIFA3, SCIFA2, SCIFA1, SCIFA0 } },
192 { 0xe6940098, 0xe69400d8, 8, /* IMR6A / IMCR6A */
193 { SCIFB, SCIFA5, SCIFA4, MSIOF1,
194 0, 0, MSIOF2, 0 } },
195 { 0xe694009c, 0xe69400dc, 8, /* IMR7A / IMCR7A */
196 { SDHI0_SDHI0I3, SDHI0_SDHI0I2, SDHI0_SDHI0I1, SDHI0_SDHI0I0,
197 FLCTL_FLTREQ1I, FLCTL_FLTREQ0I, FLCTL_FLTENDI, FLCTL_FLSTEI } },
198 { 0xe69400a0, 0xe69400e0, 8, /* IMR8A / IMCR8A */
199 { SDHI1_SDHI1I3, SDHI1_SDHI1I2, SDHI1_SDHI1I1, SDHI1_SDHI1I0,
200 TTI20, USBDMAC_USHDMI, SPU, SIU } },
201 { 0xe69400a4, 0xe69400e4, 8, /* IMR9A / IMCR9A */
202 { CMT1_CMT13, CMT1_CMT12, CMT1_CMT11, CMT1_CMT10,
203 CMT2, USBHS_USHI1, USBHS_USHI0, 0 } },
204 { 0xe69400a8, 0xe69400e8, 8, /* IMR10A / IMCR10A */
205 { 0, DMAC2_2_DADERR, DMAC2_2_DEI5, DMAC2_2_DEI4,
206 0, 0, 0, 0 } },
207 { 0xe69400ac, 0xe69400ec, 8, /* IMR11A / IMCR11A */
208 { IIC1_DTEI1, IIC1_WAITI1, IIC1_TACKI1, IIC1_ALI1,
209 LCRC, MSU_MSU2, IREM, MSU_MSU } },
210 { 0xe69400b0, 0xe69400f0, 8, /* IMR12A / IMCR12A */
211 { 0, 0, TPU0, TPU1,
212 TPU2, TPU3, TPU4, 0 } },
213 { 0xe69400b4, 0xe69400f4, 8, /* IMR13A / IMCR13A */
214 { SDHI2_SDHI2I3, SDHI2_SDHI2I2, SDHI2_SDHI2I1, SDHI2_SDHI2I0,
215 MISTY, CMT3, RWDT1, RWDT0 } },
216};
217
218static struct intc_prio_reg intca_prio_registers[] = {
219 { 0xe6900010, 0, 32, 4, /* INTPRI00A */
220 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
221 { 0xe6900014, 0, 32, 4, /* INTPRI10A */
222 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
223
224 { 0xe6940000, 0, 16, 4, /* IPRAA */ { DMAC3_1, DMAC3_2, CMT2, LCRC } },
225 { 0xe6940004, 0, 16, 4, /* IPRBA */ { IRDA, ETM11, BBIF1, BBIF2 } },
226 { 0xe6940008, 0, 16, 4, /* IPRCA */ { CRYPT1_ERR, CRYPT2_STD,
227 CMT1_CMT11, ARM11 } },
228 { 0xe694000c, 0, 16, 4, /* IPRDA */ { PINT1, PINT2,
229 CMT1_CMT12, TPU4 } },
230 { 0xe6940010, 0, 16, 4, /* IPREA */ { DMAC_1, MFI_MFIS,
231 MFI_MFIM, USBHS } },
232 { 0xe6940014, 0, 16, 4, /* IPRFA */ { KEYSC_KEY, DMAC_2,
233 0, CMT1_CMT10 } },
234 { 0xe6940018, 0, 16, 4, /* IPRGA */ { SCIFA0, SCIFA1,
235 SCIFA2, SCIFA3 } },
236 { 0xe694001c, 0, 16, 4, /* IPRGH */ { MSIOF2, USBDMAC_USHDMI,
237 FLCTL, SDHI0 } },
238 { 0xe6940020, 0, 16, 4, /* IPRIA */ { MSIOF1, SCIFA4, MSU_MSU, IIC1 } },
239 { 0xe6940024, 0, 16, 4, /* IPRJA */ { DMAC2_1, DMAC2_2, SIU, TTI20 } },
240 { 0xe6940028, 0, 16, 4, /* IPRKA */ { 0, CMT1_CMT13, IREM, SDHI1 } },
241 { 0xe694002c, 0, 16, 4, /* IPRLA */ { TPU0, TPU1, TPU2, TPU3 } },
242 { 0xe6940030, 0, 16, 4, /* IPRMA */ { MISTY, CMT3, RWDT1, RWDT0 } },
243 { 0xe6940034, 0, 16, 4, /* IPRNA */ { SCIFB, SCIFA5, SPU, DDM } },
244 { 0xe6940038, 0, 16, 4, /* IPROA */ { 0, 0, DIRC, SDHI2 } },
245};
246
247static struct intc_sense_reg intca_sense_registers[] __initdata = {
248 { 0xe6900000, 16, 2, /* ICR1A */
249 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
250 { 0xe6900004, 16, 2, /* ICR2A */
251 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
252};
253
254static struct intc_mask_reg intca_ack_registers[] __initdata = {
255 { 0xe6900020, 0, 8, /* INTREQ00A */
256 { IRQ0A, IRQ1A, IRQ2A, IRQ3A, IRQ4A, IRQ5A, IRQ6A, IRQ7A } },
257 { 0xe6900024, 0, 8, /* INTREQ10A */
258 { IRQ8A, IRQ9A, IRQ10A, IRQ11A, IRQ12A, IRQ13A, IRQ14A, IRQ15A } },
259};
260
261static DECLARE_INTC_DESC_ACK(intca_desc, "sh7367-intca",
262 intca_vectors, intca_groups,
263 intca_mask_registers, intca_prio_registers,
264 intca_sense_registers, intca_ack_registers);
265
266void __init sh7367_init_irq(void)
267{
268 /* INTCA */
269 register_intc_controller(&intca_desc);
270}