diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-01-13 01:06:28 -0500 |
commit | f43dc23d5ea91fca257be02138a255f02d98e806 (patch) | |
tree | b29722f6e965316e90ac97abf79923ced250dc21 /arch/sh/kernel/cpu/sh4a/setup-shx3.c | |
parent | f8e53553f452dcbf67cb89c8cba63a1cd6eb4cc0 (diff) | |
parent | 4162cf64973df51fc885825bc9ca4d055891c49f (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into common/serial-rework
Conflicts:
arch/sh/kernel/cpu/sh2/setup-sh7619.c
arch/sh/kernel/cpu/sh2a/setup-mxg.c
arch/sh/kernel/cpu/sh2a/setup-sh7201.c
arch/sh/kernel/cpu/sh2a/setup-sh7203.c
arch/sh/kernel/cpu/sh2a/setup-sh7206.c
arch/sh/kernel/cpu/sh3/setup-sh7705.c
arch/sh/kernel/cpu/sh3/setup-sh770x.c
arch/sh/kernel/cpu/sh3/setup-sh7710.c
arch/sh/kernel/cpu/sh3/setup-sh7720.c
arch/sh/kernel/cpu/sh4/setup-sh4-202.c
arch/sh/kernel/cpu/sh4/setup-sh7750.c
arch/sh/kernel/cpu/sh4/setup-sh7760.c
arch/sh/kernel/cpu/sh4a/setup-sh7343.c
arch/sh/kernel/cpu/sh4a/setup-sh7366.c
arch/sh/kernel/cpu/sh4a/setup-sh7722.c
arch/sh/kernel/cpu/sh4a/setup-sh7723.c
arch/sh/kernel/cpu/sh4a/setup-sh7724.c
arch/sh/kernel/cpu/sh4a/setup-sh7763.c
arch/sh/kernel/cpu/sh4a/setup-sh7770.c
arch/sh/kernel/cpu/sh4a/setup-sh7780.c
arch/sh/kernel/cpu/sh4a/setup-sh7785.c
arch/sh/kernel/cpu/sh4a/setup-sh7786.c
arch/sh/kernel/cpu/sh4a/setup-shx3.c
arch/sh/kernel/cpu/sh5/setup-sh5.c
drivers/serial/sh-sci.c
drivers/serial/sh-sci.h
include/linux/serial_sci.h
Diffstat (limited to 'arch/sh/kernel/cpu/sh4a/setup-shx3.c')
-rw-r--r-- | arch/sh/kernel/cpu/sh4a/setup-shx3.c | 196 |
1 files changed, 106 insertions, 90 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c index 4a26cc304139..bb208806dc1a 100644 --- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c +++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SH-X3 Prototype Setup | 2 | * SH-X3 Prototype Setup |
3 | * | 3 | * |
4 | * Copyright (C) 2007 - 2009 Paul Mundt | 4 | * Copyright (C) 2007 - 2010 Paul Mundt |
5 | * | 5 | * |
6 | * This file is subject to the terms and conditions of the GNU General Public | 6 | * This file is subject to the terms and conditions of the GNU General Public |
7 | * License. See the file "COPYING" in the main directory of this archive | 7 | * License. See the file "COPYING" in the main directory of this archive |
@@ -12,62 +12,79 @@ | |||
12 | #include <linux/serial.h> | 12 | #include <linux/serial.h> |
13 | #include <linux/serial_sci.h> | 13 | #include <linux/serial_sci.h> |
14 | #include <linux/io.h> | 14 | #include <linux/io.h> |
15 | #include <linux/gpio.h> | ||
15 | #include <linux/sh_timer.h> | 16 | #include <linux/sh_timer.h> |
17 | #include <cpu/shx3.h> | ||
16 | #include <asm/mmzone.h> | 18 | #include <asm/mmzone.h> |
17 | 19 | ||
18 | static struct plat_sci_port sci_platform_data[] = { | 20 | /* |
19 | { | 21 | * This intentionally only registers SCIF ports 0, 1, and 3. SCIF 2 |
20 | .mapbase = 0xffc30000, | 22 | * INTEVT values overlap with the FPU EXPEVT ones, requiring special |
21 | .flags = UPF_BOOT_AUTOCONF, | 23 | * demuxing in the exception dispatch path. |
22 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 24 | * |
23 | .scbrr_algo_id = SCBRR_ALGO_2, | 25 | * As this overlap is something that never should have made it in to |
24 | .type = PORT_SCIF, | 26 | * silicon in the first place, we just refuse to deal with the port at |
25 | .irqs = { 40, 41, 43, 42 }, | 27 | * all rather than adding infrastructure to hack around it. |
26 | }, { | 28 | */ |
27 | .mapbase = 0xffc40000, | 29 | static struct plat_sci_port scif0_platform_data = { |
28 | .flags = UPF_BOOT_AUTOCONF, | 30 | .mapbase = 0xffc30000, |
29 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 31 | .flags = UPF_BOOT_AUTOCONF, |
30 | .scbrr_algo_id = SCBRR_ALGO_2, | 32 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
31 | .type = PORT_SCIF, | 33 | .scbrr_algo_id = SCBRR_ALGO_2, |
32 | .irqs = { 44, 45, 47, 46 }, | 34 | .type = PORT_SCIF, |
33 | }, { | 35 | .irqs = { 40, 41, 43, 42 }, |
34 | .mapbase = 0xffc50000, | 36 | }; |
35 | .flags = UPF_BOOT_AUTOCONF, | 37 | |
36 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 38 | static struct platform_device scif0_device = { |
37 | .scbrr_algo_id = SCBRR_ALGO_2, | 39 | .name = "sh-sci", |
38 | .type = PORT_SCIF, | 40 | .id = 0, |
39 | .irqs = { 48, 49, 51, 50 }, | 41 | .dev = { |
40 | }, { | 42 | .platform_data = &scif0_platform_data, |
41 | .mapbase = 0xffc60000, | 43 | }, |
42 | .flags = UPF_BOOT_AUTOCONF, | 44 | }; |
43 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | 45 | |
44 | .scbrr_algo_id = SCBRR_ALGO_2, | 46 | static struct plat_sci_port scif1_platform_data = { |
45 | .type = PORT_SCIF, | 47 | .mapbase = 0xffc40000, |
46 | .irqs = { 52, 53, 55, 54 }, | 48 | .flags = UPF_BOOT_AUTOCONF, |
47 | }, { | 49 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, |
48 | .flags = 0, | 50 | .scbrr_algo_id = SCBRR_ALGO_2, |
49 | } | 51 | .type = PORT_SCIF, |
52 | .irqs = { 44, 45, 47, 46 }, | ||
53 | }; | ||
54 | |||
55 | static struct platform_device scif1_device = { | ||
56 | .name = "sh-sci", | ||
57 | .id = 1, | ||
58 | .dev = { | ||
59 | .platform_data = &scif1_platform_data, | ||
60 | }, | ||
61 | }; | ||
62 | |||
63 | static struct plat_sci_port scif2_platform_data = { | ||
64 | .mapbase = 0xffc60000, | ||
65 | .flags = UPF_BOOT_AUTOCONF, | ||
66 | .scscr = SCSCR_RE | SCSCR_TE | SCSCR_REIE, | ||
67 | .scbrr_algo_id = SCBRR_ALGO_2, | ||
68 | .type = PORT_SCIF, | ||
69 | .irqs = { 52, 53, 55, 54 }, | ||
50 | }; | 70 | }; |
51 | 71 | ||
52 | static struct platform_device sci_device = { | 72 | static struct platform_device scif2_device = { |
53 | .name = "sh-sci", | 73 | .name = "sh-sci", |
54 | .id = -1, | 74 | .id = 2, |
55 | .dev = { | 75 | .dev = { |
56 | .platform_data = sci_platform_data, | 76 | .platform_data = &scif2_platform_data, |
57 | }, | 77 | }, |
58 | }; | 78 | }; |
59 | 79 | ||
60 | static struct sh_timer_config tmu0_platform_data = { | 80 | static struct sh_timer_config tmu0_platform_data = { |
61 | .name = "TMU0", | ||
62 | .channel_offset = 0x04, | 81 | .channel_offset = 0x04, |
63 | .timer_bit = 0, | 82 | .timer_bit = 0, |
64 | .clk = "peripheral_clk", | ||
65 | .clockevent_rating = 200, | 83 | .clockevent_rating = 200, |
66 | }; | 84 | }; |
67 | 85 | ||
68 | static struct resource tmu0_resources[] = { | 86 | static struct resource tmu0_resources[] = { |
69 | [0] = { | 87 | [0] = { |
70 | .name = "TMU0", | ||
71 | .start = 0xffc10008, | 88 | .start = 0xffc10008, |
72 | .end = 0xffc10013, | 89 | .end = 0xffc10013, |
73 | .flags = IORESOURCE_MEM, | 90 | .flags = IORESOURCE_MEM, |
@@ -89,16 +106,13 @@ static struct platform_device tmu0_device = { | |||
89 | }; | 106 | }; |
90 | 107 | ||
91 | static struct sh_timer_config tmu1_platform_data = { | 108 | static struct sh_timer_config tmu1_platform_data = { |
92 | .name = "TMU1", | ||
93 | .channel_offset = 0x10, | 109 | .channel_offset = 0x10, |
94 | .timer_bit = 1, | 110 | .timer_bit = 1, |
95 | .clk = "peripheral_clk", | ||
96 | .clocksource_rating = 200, | 111 | .clocksource_rating = 200, |
97 | }; | 112 | }; |
98 | 113 | ||
99 | static struct resource tmu1_resources[] = { | 114 | static struct resource tmu1_resources[] = { |
100 | [0] = { | 115 | [0] = { |
101 | .name = "TMU1", | ||
102 | .start = 0xffc10014, | 116 | .start = 0xffc10014, |
103 | .end = 0xffc1001f, | 117 | .end = 0xffc1001f, |
104 | .flags = IORESOURCE_MEM, | 118 | .flags = IORESOURCE_MEM, |
@@ -120,15 +134,12 @@ static struct platform_device tmu1_device = { | |||
120 | }; | 134 | }; |
121 | 135 | ||
122 | static struct sh_timer_config tmu2_platform_data = { | 136 | static struct sh_timer_config tmu2_platform_data = { |
123 | .name = "TMU2", | ||
124 | .channel_offset = 0x1c, | 137 | .channel_offset = 0x1c, |
125 | .timer_bit = 2, | 138 | .timer_bit = 2, |
126 | .clk = "peripheral_clk", | ||
127 | }; | 139 | }; |
128 | 140 | ||
129 | static struct resource tmu2_resources[] = { | 141 | static struct resource tmu2_resources[] = { |
130 | [0] = { | 142 | [0] = { |
131 | .name = "TMU2", | ||
132 | .start = 0xffc10020, | 143 | .start = 0xffc10020, |
133 | .end = 0xffc1002f, | 144 | .end = 0xffc1002f, |
134 | .flags = IORESOURCE_MEM, | 145 | .flags = IORESOURCE_MEM, |
@@ -150,15 +161,12 @@ static struct platform_device tmu2_device = { | |||
150 | }; | 161 | }; |
151 | 162 | ||
152 | static struct sh_timer_config tmu3_platform_data = { | 163 | static struct sh_timer_config tmu3_platform_data = { |
153 | .name = "TMU3", | ||
154 | .channel_offset = 0x04, | 164 | .channel_offset = 0x04, |
155 | .timer_bit = 0, | 165 | .timer_bit = 0, |
156 | .clk = "peripheral_clk", | ||
157 | }; | 166 | }; |
158 | 167 | ||
159 | static struct resource tmu3_resources[] = { | 168 | static struct resource tmu3_resources[] = { |
160 | [0] = { | 169 | [0] = { |
161 | .name = "TMU3", | ||
162 | .start = 0xffc20008, | 170 | .start = 0xffc20008, |
163 | .end = 0xffc20013, | 171 | .end = 0xffc20013, |
164 | .flags = IORESOURCE_MEM, | 172 | .flags = IORESOURCE_MEM, |
@@ -180,15 +188,12 @@ static struct platform_device tmu3_device = { | |||
180 | }; | 188 | }; |
181 | 189 | ||
182 | static struct sh_timer_config tmu4_platform_data = { | 190 | static struct sh_timer_config tmu4_platform_data = { |
183 | .name = "TMU4", | ||
184 | .channel_offset = 0x10, | 191 | .channel_offset = 0x10, |
185 | .timer_bit = 1, | 192 | .timer_bit = 1, |
186 | .clk = "peripheral_clk", | ||
187 | }; | 193 | }; |
188 | 194 | ||
189 | static struct resource tmu4_resources[] = { | 195 | static struct resource tmu4_resources[] = { |
190 | [0] = { | 196 | [0] = { |
191 | .name = "TMU4", | ||
192 | .start = 0xffc20014, | 197 | .start = 0xffc20014, |
193 | .end = 0xffc2001f, | 198 | .end = 0xffc2001f, |
194 | .flags = IORESOURCE_MEM, | 199 | .flags = IORESOURCE_MEM, |
@@ -210,15 +215,12 @@ static struct platform_device tmu4_device = { | |||
210 | }; | 215 | }; |
211 | 216 | ||
212 | static struct sh_timer_config tmu5_platform_data = { | 217 | static struct sh_timer_config tmu5_platform_data = { |
213 | .name = "TMU5", | ||
214 | .channel_offset = 0x1c, | 218 | .channel_offset = 0x1c, |
215 | .timer_bit = 2, | 219 | .timer_bit = 2, |
216 | .clk = "peripheral_clk", | ||
217 | }; | 220 | }; |
218 | 221 | ||
219 | static struct resource tmu5_resources[] = { | 222 | static struct resource tmu5_resources[] = { |
220 | [0] = { | 223 | [0] = { |
221 | .name = "TMU5", | ||
222 | .start = 0xffc20020, | 224 | .start = 0xffc20020, |
223 | .end = 0xffc2002b, | 225 | .end = 0xffc2002b, |
224 | .flags = IORESOURCE_MEM, | 226 | .flags = IORESOURCE_MEM, |
@@ -240,6 +242,9 @@ static struct platform_device tmu5_device = { | |||
240 | }; | 242 | }; |
241 | 243 | ||
242 | static struct platform_device *shx3_early_devices[] __initdata = { | 244 | static struct platform_device *shx3_early_devices[] __initdata = { |
245 | &scif0_device, | ||
246 | &scif1_device, | ||
247 | &scif2_device, | ||
243 | &tmu0_device, | 248 | &tmu0_device, |
244 | &tmu1_device, | 249 | &tmu1_device, |
245 | &tmu2_device, | 250 | &tmu2_device, |
@@ -248,23 +253,12 @@ static struct platform_device *shx3_early_devices[] __initdata = { | |||
248 | &tmu5_device, | 253 | &tmu5_device, |
249 | }; | 254 | }; |
250 | 255 | ||
251 | static struct platform_device *shx3_devices[] __initdata = { | ||
252 | &sci_device, | ||
253 | }; | ||
254 | |||
255 | static int __init shx3_devices_setup(void) | 256 | static int __init shx3_devices_setup(void) |
256 | { | 257 | { |
257 | int ret; | 258 | return platform_add_devices(shx3_early_devices, |
258 | |||
259 | ret = platform_add_devices(shx3_early_devices, | ||
260 | ARRAY_SIZE(shx3_early_devices)); | 259 | ARRAY_SIZE(shx3_early_devices)); |
261 | if (unlikely(ret != 0)) | ||
262 | return ret; | ||
263 | |||
264 | return platform_add_devices(shx3_devices, | ||
265 | ARRAY_SIZE(shx3_devices)); | ||
266 | } | 260 | } |
267 | __initcall(shx3_devices_setup); | 261 | arch_initcall(shx3_devices_setup); |
268 | 262 | ||
269 | void __init plat_early_device_setup(void) | 263 | void __init plat_early_device_setup(void) |
270 | { | 264 | { |
@@ -295,10 +289,7 @@ enum { | |||
295 | DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, DMAC1_DMINT9, | 289 | DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, DMAC1_DMINT9, |
296 | DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE, | 290 | DMAC1_DMINT10, DMAC1_DMINT11, DMAC1_DMAE, |
297 | IIC, VIN0, VIN1, VCORE0, ATAPI, | 291 | IIC, VIN0, VIN1, VCORE0, ATAPI, |
298 | DTU0_TEND, DTU0_AE, DTU0_TMISS, | 292 | DTU0, DTU1, DTU2, DTU3, |
299 | DTU1_TEND, DTU1_AE, DTU1_TMISS, | ||
300 | DTU2_TEND, DTU2_AE, DTU2_TMISS, | ||
301 | DTU3_TEND, DTU3_AE, DTU3_TMISS, | ||
302 | FE0, FE1, | 293 | FE0, FE1, |
303 | GPIO0, GPIO1, GPIO2, GPIO3, | 294 | GPIO0, GPIO1, GPIO2, GPIO3, |
304 | PAM, IRM, | 295 | PAM, IRM, |
@@ -307,7 +298,7 @@ enum { | |||
307 | 298 | ||
308 | /* interrupt groups */ | 299 | /* interrupt groups */ |
309 | IRL, PCII56789, SCIF0, SCIF1, SCIF2, SCIF3, | 300 | IRL, PCII56789, SCIF0, SCIF1, SCIF2, SCIF3, |
310 | DMAC0, DMAC1, DTU0, DTU1, DTU2, DTU3, | 301 | DMAC0, DMAC1, |
311 | }; | 302 | }; |
312 | 303 | ||
313 | static struct intc_vect vectors[] __initdata = { | 304 | static struct intc_vect vectors[] __initdata = { |
@@ -324,8 +315,6 @@ static struct intc_vect vectors[] __initdata = { | |||
324 | INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), | 315 | INTC_VECT(SCIF0_BRI, 0x740), INTC_VECT(SCIF0_TXI, 0x760), |
325 | INTC_VECT(SCIF1_ERI, 0x780), INTC_VECT(SCIF1_RXI, 0x7a0), | 316 | INTC_VECT(SCIF1_ERI, 0x780), INTC_VECT(SCIF1_RXI, 0x7a0), |
326 | INTC_VECT(SCIF1_BRI, 0x7c0), INTC_VECT(SCIF1_TXI, 0x7e0), | 317 | INTC_VECT(SCIF1_BRI, 0x7c0), INTC_VECT(SCIF1_TXI, 0x7e0), |
327 | INTC_VECT(SCIF2_ERI, 0x800), INTC_VECT(SCIF2_RXI, 0x820), | ||
328 | INTC_VECT(SCIF2_BRI, 0x840), INTC_VECT(SCIF2_TXI, 0x860), | ||
329 | INTC_VECT(SCIF3_ERI, 0x880), INTC_VECT(SCIF3_RXI, 0x8a0), | 318 | INTC_VECT(SCIF3_ERI, 0x880), INTC_VECT(SCIF3_RXI, 0x8a0), |
330 | INTC_VECT(SCIF3_BRI, 0x8c0), INTC_VECT(SCIF3_TXI, 0x8e0), | 319 | INTC_VECT(SCIF3_BRI, 0x8c0), INTC_VECT(SCIF3_TXI, 0x8e0), |
331 | INTC_VECT(DMAC0_DMINT0, 0x900), INTC_VECT(DMAC0_DMINT1, 0x920), | 320 | INTC_VECT(DMAC0_DMINT0, 0x900), INTC_VECT(DMAC0_DMINT1, 0x920), |
@@ -340,14 +329,14 @@ static struct intc_vect vectors[] __initdata = { | |||
340 | INTC_VECT(IIC, 0xae0), | 329 | INTC_VECT(IIC, 0xae0), |
341 | INTC_VECT(VIN0, 0xb00), INTC_VECT(VIN1, 0xb20), | 330 | INTC_VECT(VIN0, 0xb00), INTC_VECT(VIN1, 0xb20), |
342 | INTC_VECT(VCORE0, 0xb00), INTC_VECT(ATAPI, 0xb60), | 331 | INTC_VECT(VCORE0, 0xb00), INTC_VECT(ATAPI, 0xb60), |
343 | INTC_VECT(DTU0_TEND, 0xc00), INTC_VECT(DTU0_AE, 0xc20), | 332 | INTC_VECT(DTU0, 0xc00), INTC_VECT(DTU0, 0xc20), |
344 | INTC_VECT(DTU0_TMISS, 0xc40), | 333 | INTC_VECT(DTU0, 0xc40), |
345 | INTC_VECT(DTU1_TEND, 0xc60), INTC_VECT(DTU1_AE, 0xc80), | 334 | INTC_VECT(DTU1, 0xc60), INTC_VECT(DTU1, 0xc80), |
346 | INTC_VECT(DTU1_TMISS, 0xca0), | 335 | INTC_VECT(DTU1, 0xca0), |
347 | INTC_VECT(DTU2_TEND, 0xcc0), INTC_VECT(DTU2_AE, 0xce0), | 336 | INTC_VECT(DTU2, 0xcc0), INTC_VECT(DTU2, 0xce0), |
348 | INTC_VECT(DTU2_TMISS, 0xd00), | 337 | INTC_VECT(DTU2, 0xd00), |
349 | INTC_VECT(DTU3_TEND, 0xd20), INTC_VECT(DTU3_AE, 0xd40), | 338 | INTC_VECT(DTU3, 0xd20), INTC_VECT(DTU3, 0xd40), |
350 | INTC_VECT(DTU3_TMISS, 0xd60), | 339 | INTC_VECT(DTU3, 0xd60), |
351 | INTC_VECT(FE0, 0xe00), INTC_VECT(FE1, 0xe20), | 340 | INTC_VECT(FE0, 0xe00), INTC_VECT(FE1, 0xe20), |
352 | INTC_VECT(GPIO0, 0xe40), INTC_VECT(GPIO1, 0xe60), | 341 | INTC_VECT(GPIO0, 0xe40), INTC_VECT(GPIO1, 0xe60), |
353 | INTC_VECT(GPIO2, 0xe80), INTC_VECT(GPIO3, 0xea0), | 342 | INTC_VECT(GPIO2, 0xe80), INTC_VECT(GPIO3, 0xea0), |
@@ -366,18 +355,17 @@ static struct intc_group groups[] __initdata = { | |||
366 | INTC_GROUP(PCII56789, PCII5, PCII6, PCII7, PCII8, PCII9), | 355 | INTC_GROUP(PCII56789, PCII5, PCII6, PCII7, PCII8, PCII9), |
367 | INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI), | 356 | INTC_GROUP(SCIF0, SCIF0_ERI, SCIF0_RXI, SCIF0_BRI, SCIF0_TXI), |
368 | INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI), | 357 | INTC_GROUP(SCIF1, SCIF1_ERI, SCIF1_RXI, SCIF1_BRI, SCIF1_TXI), |
369 | INTC_GROUP(SCIF2, SCIF2_ERI, SCIF2_RXI, SCIF2_BRI, SCIF2_TXI), | ||
370 | INTC_GROUP(SCIF3, SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI), | 358 | INTC_GROUP(SCIF3, SCIF3_ERI, SCIF3_RXI, SCIF3_BRI, SCIF3_TXI), |
371 | INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, | 359 | INTC_GROUP(DMAC0, DMAC0_DMINT0, DMAC0_DMINT1, DMAC0_DMINT2, |
372 | DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE), | 360 | DMAC0_DMINT3, DMAC0_DMINT4, DMAC0_DMINT5, DMAC0_DMAE), |
373 | INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, | 361 | INTC_GROUP(DMAC1, DMAC1_DMINT6, DMAC1_DMINT7, DMAC1_DMINT8, |
374 | DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11), | 362 | DMAC1_DMINT9, DMAC1_DMINT10, DMAC1_DMINT11), |
375 | INTC_GROUP(DTU0, DTU0_TEND, DTU0_AE, DTU0_TMISS), | ||
376 | INTC_GROUP(DTU1, DTU1_TEND, DTU1_AE, DTU1_TMISS), | ||
377 | INTC_GROUP(DTU2, DTU2_TEND, DTU2_AE, DTU2_TMISS), | ||
378 | INTC_GROUP(DTU3, DTU3_TEND, DTU3_AE, DTU3_TMISS), | ||
379 | }; | 363 | }; |
380 | 364 | ||
365 | #define INT2DISTCR0 0xfe4108a0 | ||
366 | #define INT2DISTCR1 0xfe4108a4 | ||
367 | #define INT2DISTCR2 0xfe4108a8 | ||
368 | |||
381 | static struct intc_mask_reg mask_registers[] __initdata = { | 369 | static struct intc_mask_reg mask_registers[] __initdata = { |
382 | { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ | 370 | { 0xfe410030, 0xfe410050, 32, /* CnINTMSK0 / CnINTMSKCLR0 */ |
383 | { IRQ0, IRQ1, IRQ2, IRQ3 } }, | 371 | { IRQ0, IRQ1, IRQ2, IRQ3 } }, |
@@ -387,20 +375,23 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
387 | { FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC, | 375 | { FE1, FE0, 0, ATAPI, VCORE0, VIN1, VIN0, IIC, |
388 | DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0, | 376 | DU, GPIO3, GPIO2, GPIO1, GPIO0, PAM, 0, 0, |
389 | 0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */ | 377 | 0, 0, 0, 0, 0, 0, 0, 0, /* HUDI bits ignored */ |
390 | 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, } }, | 378 | 0, TMU5, TMU4, TMU3, TMU2, TMU1, TMU0, 0, }, |
379 | INTC_SMP_BALANCING(INT2DISTCR0) }, | ||
391 | { 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */ | 380 | { 0xfe410830, 0xfe410860, 32, /* CnINT2MSK1 / CnINT2MSKCLR1 */ |
392 | { 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */ | 381 | { 0, 0, 0, 0, DTU3, DTU2, DTU1, DTU0, /* IRM bits ignored */ |
393 | PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2, | 382 | PCII9, PCII8, PCII7, PCII6, PCII5, PCII4, PCII3, PCII2, |
394 | PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11, | 383 | PCII1, PCII0, DMAC1_DMAE, DMAC1_DMINT11, |
395 | DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7, | 384 | DMAC1_DMINT10, DMAC1_DMINT9, DMAC1_DMINT8, DMAC1_DMINT7, |
396 | DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4, | 385 | DMAC1_DMINT6, DMAC0_DMAE, DMAC0_DMINT5, DMAC0_DMINT4, |
397 | DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 } }, | 386 | DMAC0_DMINT3, DMAC0_DMINT2, DMAC0_DMINT1, DMAC0_DMINT0 }, |
387 | INTC_SMP_BALANCING(INT2DISTCR1) }, | ||
398 | { 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */ | 388 | { 0xfe410840, 0xfe410870, 32, /* CnINT2MSK2 / CnINT2MSKCLR2 */ |
399 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | 389 | { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
400 | SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI, | 390 | SCIF3_TXI, SCIF3_BRI, SCIF3_RXI, SCIF3_ERI, |
401 | SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI, | 391 | SCIF2_TXI, SCIF2_BRI, SCIF2_RXI, SCIF2_ERI, |
402 | SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI, | 392 | SCIF1_TXI, SCIF1_BRI, SCIF1_RXI, SCIF1_ERI, |
403 | SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI } }, | 393 | SCIF0_TXI, SCIF0_BRI, SCIF0_RXI, SCIF0_ERI }, |
394 | INTC_SMP_BALANCING(INT2DISTCR2) }, | ||
404 | }; | 395 | }; |
405 | 396 | ||
406 | static struct intc_prio_reg prio_registers[] __initdata = { | 397 | static struct intc_prio_reg prio_registers[] __initdata = { |
@@ -457,11 +448,33 @@ static DECLARE_INTC_DESC(intc_desc_irl, "shx3-irl", vectors_irl, groups, | |||
457 | 448 | ||
458 | void __init plat_irq_setup_pins(int mode) | 449 | void __init plat_irq_setup_pins(int mode) |
459 | { | 450 | { |
451 | int ret = 0; | ||
452 | |||
460 | switch (mode) { | 453 | switch (mode) { |
461 | case IRQ_MODE_IRQ: | 454 | case IRQ_MODE_IRQ: |
455 | ret |= gpio_request(GPIO_FN_IRQ3, intc_desc_irq.name); | ||
456 | ret |= gpio_request(GPIO_FN_IRQ2, intc_desc_irq.name); | ||
457 | ret |= gpio_request(GPIO_FN_IRQ1, intc_desc_irq.name); | ||
458 | ret |= gpio_request(GPIO_FN_IRQ0, intc_desc_irq.name); | ||
459 | |||
460 | if (unlikely(ret)) { | ||
461 | pr_err("Failed to set IRQ mode\n"); | ||
462 | return; | ||
463 | } | ||
464 | |||
462 | register_intc_controller(&intc_desc_irq); | 465 | register_intc_controller(&intc_desc_irq); |
463 | break; | 466 | break; |
464 | case IRQ_MODE_IRL3210: | 467 | case IRQ_MODE_IRL3210: |
468 | ret |= gpio_request(GPIO_FN_IRL3, intc_desc_irl.name); | ||
469 | ret |= gpio_request(GPIO_FN_IRL2, intc_desc_irl.name); | ||
470 | ret |= gpio_request(GPIO_FN_IRL1, intc_desc_irl.name); | ||
471 | ret |= gpio_request(GPIO_FN_IRL0, intc_desc_irl.name); | ||
472 | |||
473 | if (unlikely(ret)) { | ||
474 | pr_err("Failed to set IRL mode\n"); | ||
475 | return; | ||
476 | } | ||
477 | |||
465 | register_intc_controller(&intc_desc_irl); | 478 | register_intc_controller(&intc_desc_irl); |
466 | break; | 479 | break; |
467 | default: | 480 | default: |
@@ -471,6 +484,9 @@ void __init plat_irq_setup_pins(int mode) | |||
471 | 484 | ||
472 | void __init plat_irq_setup(void) | 485 | void __init plat_irq_setup(void) |
473 | { | 486 | { |
487 | reserve_intc_vectors(vectors_irq, ARRAY_SIZE(vectors_irq)); | ||
488 | reserve_intc_vectors(vectors_irl, ARRAY_SIZE(vectors_irl)); | ||
489 | |||
474 | register_intc_controller(&intc_desc); | 490 | register_intc_controller(&intc_desc); |
475 | } | 491 | } |
476 | 492 | ||