diff options
author | Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> | 2014-04-23 07:15:21 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2014-05-11 06:35:28 -0400 |
commit | 5204601c0877b3ffc90e417bf30fccc9bdf47962 (patch) | |
tree | c1125e8cd65378b5e7ec1b3d8b827b0723080125 /arch/sh | |
parent | e4ae34e285b1c102686cb1c2a39ef93f930bf8f4 (diff) |
sh: Switch to new style MTU2 device
The MTU2 (Multi-Function Timer Pulse Unit 2) driver implements a new
style of platform data that handles the timer as a single device with
multiple channel. Switch from the old-style platform data to the
new-style platform data.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Tested-by: Wolfram Sang <wsa@sang-engineering.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/kernel/cpu/clock-cpg.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/clock-sh7264.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/clock-sh7269.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-mxg.c | 98 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7201.c | 98 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7203.c | 67 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7206.c | 98 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7264.c | 71 | ||||
-rw-r--r-- | arch/sh/kernel/cpu/sh2a/setup-sh7269.c | 67 |
9 files changed, 72 insertions, 433 deletions
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c index 121ef690763f..8525a671266f 100644 --- a/arch/sh/kernel/cpu/clock-cpg.c +++ b/arch/sh/kernel/cpu/clock-cpg.c | |||
@@ -60,7 +60,7 @@ int __init __deprecated cpg_clk_init(void) | |||
60 | clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL); | 60 | clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL); |
61 | clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL); | 61 | clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL); |
62 | clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL); | 62 | clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL); |
63 | clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); | 63 | clk_add_alias("fck", "sh-mtu2", "peripheral_clk", NULL); |
64 | clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL); | 64 | clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL); |
65 | clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL); | 65 | clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL); |
66 | clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); | 66 | clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c index c7f3c666a0ac..8638fba6cd7f 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c | |||
@@ -119,7 +119,7 @@ static struct clk_lookup lookups[] = { | |||
119 | CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), | 119 | CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), |
120 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), | 120 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), |
121 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), | 121 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), |
122 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), | 122 | CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP35]), |
123 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), | 123 | CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), |
124 | CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]), | 124 | CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]), |
125 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), | 125 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c index 4f47464f2fb6..f8a5c2abdfb3 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c | |||
@@ -160,7 +160,7 @@ static struct clk_lookup lookups[] = { | |||
160 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), | 160 | CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), |
161 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), | 161 | CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]), |
162 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), | 162 | CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), |
163 | CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), | 163 | CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP35]), |
164 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), | 164 | CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), |
165 | CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]), | 165 | CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]), |
166 | }; | 166 | }; |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c index 63e996f9a7ed..26fcdbd4127a 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c +++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c | |||
@@ -114,88 +114,18 @@ static struct intc_mask_reg mask_registers[] __initdata = { | |||
114 | static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups, | 114 | static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups, |
115 | mask_registers, prio_registers, NULL); | 115 | mask_registers, prio_registers, NULL); |
116 | 116 | ||
117 | static struct sh_timer_config mtu2_0_platform_data = { | 117 | static struct resource mtu2_resources[] = { |
118 | .channel_offset = -0x80, | 118 | DEFINE_RES_MEM(0xff801000, 0x400), |
119 | .timer_bit = 0, | 119 | DEFINE_RES_IRQ_NAMED(228, "tgi0a"), |
120 | .clockevent_rating = 200, | 120 | DEFINE_RES_IRQ_NAMED(234, "tgi1a"), |
121 | DEFINE_RES_IRQ_NAMED(240, "tgi2a"), | ||
121 | }; | 122 | }; |
122 | 123 | ||
123 | static struct resource mtu2_0_resources[] = { | 124 | static struct platform_device mtu2_device = { |
124 | [0] = { | 125 | .name = "sh-mtu2", |
125 | .start = 0xff801300, | 126 | .id = -1, |
126 | .end = 0xff801326, | 127 | .resource = mtu2_resources, |
127 | .flags = IORESOURCE_MEM, | 128 | .num_resources = ARRAY_SIZE(mtu2_resources), |
128 | }, | ||
129 | [1] = { | ||
130 | .start = 228, | ||
131 | .flags = IORESOURCE_IRQ, | ||
132 | }, | ||
133 | }; | ||
134 | |||
135 | static struct platform_device mtu2_0_device = { | ||
136 | .name = "sh_mtu2", | ||
137 | .id = 0, | ||
138 | .dev = { | ||
139 | .platform_data = &mtu2_0_platform_data, | ||
140 | }, | ||
141 | .resource = mtu2_0_resources, | ||
142 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
143 | }; | ||
144 | |||
145 | static struct sh_timer_config mtu2_1_platform_data = { | ||
146 | .channel_offset = -0x100, | ||
147 | .timer_bit = 1, | ||
148 | .clockevent_rating = 200, | ||
149 | }; | ||
150 | |||
151 | static struct resource mtu2_1_resources[] = { | ||
152 | [0] = { | ||
153 | .start = 0xff801380, | ||
154 | .end = 0xff801390, | ||
155 | .flags = IORESOURCE_MEM, | ||
156 | }, | ||
157 | [1] = { | ||
158 | .start = 234, | ||
159 | .flags = IORESOURCE_IRQ, | ||
160 | }, | ||
161 | }; | ||
162 | |||
163 | static struct platform_device mtu2_1_device = { | ||
164 | .name = "sh_mtu2", | ||
165 | .id = 1, | ||
166 | .dev = { | ||
167 | .platform_data = &mtu2_1_platform_data, | ||
168 | }, | ||
169 | .resource = mtu2_1_resources, | ||
170 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
171 | }; | ||
172 | |||
173 | static struct sh_timer_config mtu2_2_platform_data = { | ||
174 | .channel_offset = 0x80, | ||
175 | .timer_bit = 2, | ||
176 | .clockevent_rating = 200, | ||
177 | }; | ||
178 | |||
179 | static struct resource mtu2_2_resources[] = { | ||
180 | [0] = { | ||
181 | .start = 0xff801000, | ||
182 | .end = 0xff80100a, | ||
183 | .flags = IORESOURCE_MEM, | ||
184 | }, | ||
185 | [1] = { | ||
186 | .start = 240, | ||
187 | .flags = IORESOURCE_IRQ, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | static struct platform_device mtu2_2_device = { | ||
192 | .name = "sh_mtu2", | ||
193 | .id = 2, | ||
194 | .dev = { | ||
195 | .platform_data = &mtu2_2_platform_data, | ||
196 | }, | ||
197 | .resource = mtu2_2_resources, | ||
198 | .num_resources = ARRAY_SIZE(mtu2_2_resources), | ||
199 | }; | 129 | }; |
200 | 130 | ||
201 | static struct plat_sci_port scif0_platform_data = { | 131 | static struct plat_sci_port scif0_platform_data = { |
@@ -221,9 +151,7 @@ static struct platform_device scif0_device = { | |||
221 | 151 | ||
222 | static struct platform_device *mxg_devices[] __initdata = { | 152 | static struct platform_device *mxg_devices[] __initdata = { |
223 | &scif0_device, | 153 | &scif0_device, |
224 | &mtu2_0_device, | 154 | &mtu2_device, |
225 | &mtu2_1_device, | ||
226 | &mtu2_2_device, | ||
227 | }; | 155 | }; |
228 | 156 | ||
229 | static int __init mxg_devices_setup(void) | 157 | static int __init mxg_devices_setup(void) |
@@ -240,9 +168,7 @@ void __init plat_irq_setup(void) | |||
240 | 168 | ||
241 | static struct platform_device *mxg_early_devices[] __initdata = { | 169 | static struct platform_device *mxg_early_devices[] __initdata = { |
242 | &scif0_device, | 170 | &scif0_device, |
243 | &mtu2_0_device, | 171 | &mtu2_device, |
244 | &mtu2_1_device, | ||
245 | &mtu2_2_device, | ||
246 | }; | 172 | }; |
247 | 173 | ||
248 | void __init plat_early_device_setup(void) | 174 | void __init plat_early_device_setup(void) |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c index 2c6874461536..abc0ce9fb800 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c | |||
@@ -365,88 +365,18 @@ static struct platform_device rtc_device = { | |||
365 | .resource = rtc_resources, | 365 | .resource = rtc_resources, |
366 | }; | 366 | }; |
367 | 367 | ||
368 | static struct sh_timer_config mtu2_0_platform_data = { | 368 | static struct resource mtu2_resources[] = { |
369 | .channel_offset = -0x80, | 369 | DEFINE_RES_MEM(0xfffe4000, 0x400), |
370 | .timer_bit = 0, | 370 | DEFINE_RES_IRQ_NAMED(108, "tgi0a"), |
371 | .clockevent_rating = 200, | 371 | DEFINE_RES_IRQ_NAMED(116, "tgi1a"), |
372 | DEFINE_RES_IRQ_NAMED(124, "tgi1b"), | ||
372 | }; | 373 | }; |
373 | 374 | ||
374 | static struct resource mtu2_0_resources[] = { | 375 | static struct platform_device mtu2_device = { |
375 | [0] = { | 376 | .name = "sh-mtu2", |
376 | .start = 0xfffe4300, | 377 | .id = -1, |
377 | .end = 0xfffe4326, | 378 | .resource = mtu2_resources, |
378 | .flags = IORESOURCE_MEM, | 379 | .num_resources = ARRAY_SIZE(mtu2_resources), |
379 | }, | ||
380 | [1] = { | ||
381 | .start = 108, | ||
382 | .flags = IORESOURCE_IRQ, | ||
383 | }, | ||
384 | }; | ||
385 | |||
386 | static struct platform_device mtu2_0_device = { | ||
387 | .name = "sh_mtu2", | ||
388 | .id = 0, | ||
389 | .dev = { | ||
390 | .platform_data = &mtu2_0_platform_data, | ||
391 | }, | ||
392 | .resource = mtu2_0_resources, | ||
393 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
394 | }; | ||
395 | |||
396 | static struct sh_timer_config mtu2_1_platform_data = { | ||
397 | .channel_offset = -0x100, | ||
398 | .timer_bit = 1, | ||
399 | .clockevent_rating = 200, | ||
400 | }; | ||
401 | |||
402 | static struct resource mtu2_1_resources[] = { | ||
403 | [0] = { | ||
404 | .start = 0xfffe4380, | ||
405 | .end = 0xfffe4390, | ||
406 | .flags = IORESOURCE_MEM, | ||
407 | }, | ||
408 | [1] = { | ||
409 | .start = 116, | ||
410 | .flags = IORESOURCE_IRQ, | ||
411 | }, | ||
412 | }; | ||
413 | |||
414 | static struct platform_device mtu2_1_device = { | ||
415 | .name = "sh_mtu2", | ||
416 | .id = 1, | ||
417 | .dev = { | ||
418 | .platform_data = &mtu2_1_platform_data, | ||
419 | }, | ||
420 | .resource = mtu2_1_resources, | ||
421 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
422 | }; | ||
423 | |||
424 | static struct sh_timer_config mtu2_2_platform_data = { | ||
425 | .channel_offset = 0x80, | ||
426 | .timer_bit = 2, | ||
427 | .clockevent_rating = 200, | ||
428 | }; | ||
429 | |||
430 | static struct resource mtu2_2_resources[] = { | ||
431 | [0] = { | ||
432 | .start = 0xfffe4000, | ||
433 | .end = 0xfffe400a, | ||
434 | .flags = IORESOURCE_MEM, | ||
435 | }, | ||
436 | [1] = { | ||
437 | .start = 124, | ||
438 | .flags = IORESOURCE_IRQ, | ||
439 | }, | ||
440 | }; | ||
441 | |||
442 | static struct platform_device mtu2_2_device = { | ||
443 | .name = "sh_mtu2", | ||
444 | .id = 2, | ||
445 | .dev = { | ||
446 | .platform_data = &mtu2_2_platform_data, | ||
447 | }, | ||
448 | .resource = mtu2_2_resources, | ||
449 | .num_resources = ARRAY_SIZE(mtu2_2_resources), | ||
450 | }; | 380 | }; |
451 | 381 | ||
452 | static struct platform_device *sh7201_devices[] __initdata = { | 382 | static struct platform_device *sh7201_devices[] __initdata = { |
@@ -459,9 +389,7 @@ static struct platform_device *sh7201_devices[] __initdata = { | |||
459 | &scif6_device, | 389 | &scif6_device, |
460 | &scif7_device, | 390 | &scif7_device, |
461 | &rtc_device, | 391 | &rtc_device, |
462 | &mtu2_0_device, | 392 | &mtu2_device, |
463 | &mtu2_1_device, | ||
464 | &mtu2_2_device, | ||
465 | }; | 393 | }; |
466 | 394 | ||
467 | static int __init sh7201_devices_setup(void) | 395 | static int __init sh7201_devices_setup(void) |
@@ -485,9 +413,7 @@ static struct platform_device *sh7201_early_devices[] __initdata = { | |||
485 | &scif5_device, | 413 | &scif5_device, |
486 | &scif6_device, | 414 | &scif6_device, |
487 | &scif7_device, | 415 | &scif7_device, |
488 | &mtu2_0_device, | 416 | &mtu2_device, |
489 | &mtu2_1_device, | ||
490 | &mtu2_2_device, | ||
491 | }; | 417 | }; |
492 | 418 | ||
493 | #define STBCR3 0xfffe0408 | 419 | #define STBCR3 0xfffe0408 |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c index 374f8c09d924..3b4894cba92f 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c | |||
@@ -285,60 +285,17 @@ static struct platform_device cmt_device = { | |||
285 | .num_resources = ARRAY_SIZE(cmt_resources), | 285 | .num_resources = ARRAY_SIZE(cmt_resources), |
286 | }; | 286 | }; |
287 | 287 | ||
288 | static struct sh_timer_config mtu2_0_platform_data = { | 288 | static struct resource mtu2_resources[] = { |
289 | .channel_offset = -0x80, | 289 | DEFINE_RES_MEM(0xfffe4000, 0x400), |
290 | .timer_bit = 0, | 290 | DEFINE_RES_IRQ_NAMED(146, "tgi0a"), |
291 | .clockevent_rating = 200, | 291 | DEFINE_RES_IRQ_NAMED(153, "tgi1a"), |
292 | }; | 292 | }; |
293 | 293 | ||
294 | static struct resource mtu2_0_resources[] = { | 294 | static struct platform_device mtu2_device = { |
295 | [0] = { | 295 | .name = "sh-mtu2", |
296 | .start = 0xfffe4300, | 296 | .id = -1, |
297 | .end = 0xfffe4326, | 297 | .resource = mtu2_resources, |
298 | .flags = IORESOURCE_MEM, | 298 | .num_resources = ARRAY_SIZE(mtu2_resources), |
299 | }, | ||
300 | [1] = { | ||
301 | .start = 146, | ||
302 | .flags = IORESOURCE_IRQ, | ||
303 | }, | ||
304 | }; | ||
305 | |||
306 | static struct platform_device mtu2_0_device = { | ||
307 | .name = "sh_mtu2", | ||
308 | .id = 0, | ||
309 | .dev = { | ||
310 | .platform_data = &mtu2_0_platform_data, | ||
311 | }, | ||
312 | .resource = mtu2_0_resources, | ||
313 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
314 | }; | ||
315 | |||
316 | static struct sh_timer_config mtu2_1_platform_data = { | ||
317 | .channel_offset = -0x100, | ||
318 | .timer_bit = 1, | ||
319 | .clockevent_rating = 200, | ||
320 | }; | ||
321 | |||
322 | static struct resource mtu2_1_resources[] = { | ||
323 | [0] = { | ||
324 | .start = 0xfffe4380, | ||
325 | .end = 0xfffe4390, | ||
326 | .flags = IORESOURCE_MEM, | ||
327 | }, | ||
328 | [1] = { | ||
329 | .start = 153, | ||
330 | .flags = IORESOURCE_IRQ, | ||
331 | }, | ||
332 | }; | ||
333 | |||
334 | static struct platform_device mtu2_1_device = { | ||
335 | .name = "sh_mtu2", | ||
336 | .id = 1, | ||
337 | .dev = { | ||
338 | .platform_data = &mtu2_1_platform_data, | ||
339 | }, | ||
340 | .resource = mtu2_1_resources, | ||
341 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
342 | }; | 299 | }; |
343 | 300 | ||
344 | static struct resource rtc_resources[] = { | 301 | static struct resource rtc_resources[] = { |
@@ -367,8 +324,7 @@ static struct platform_device *sh7203_devices[] __initdata = { | |||
367 | &scif2_device, | 324 | &scif2_device, |
368 | &scif3_device, | 325 | &scif3_device, |
369 | &cmt_device, | 326 | &cmt_device, |
370 | &mtu2_0_device, | 327 | &mtu2_device, |
371 | &mtu2_1_device, | ||
372 | &rtc_device, | 328 | &rtc_device, |
373 | }; | 329 | }; |
374 | 330 | ||
@@ -390,8 +346,7 @@ static struct platform_device *sh7203_early_devices[] __initdata = { | |||
390 | &scif2_device, | 346 | &scif2_device, |
391 | &scif3_device, | 347 | &scif3_device, |
392 | &cmt_device, | 348 | &cmt_device, |
393 | &mtu2_0_device, | 349 | &mtu2_device, |
394 | &mtu2_1_device, | ||
395 | }; | 350 | }; |
396 | 351 | ||
397 | #define STBCR3 0xfffe0408 | 352 | #define STBCR3 0xfffe0408 |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c index d00e6fd998ec..49bc5a34bec1 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c | |||
@@ -237,88 +237,18 @@ static struct platform_device cmt_device = { | |||
237 | .num_resources = ARRAY_SIZE(cmt_resources), | 237 | .num_resources = ARRAY_SIZE(cmt_resources), |
238 | }; | 238 | }; |
239 | 239 | ||
240 | static struct sh_timer_config mtu2_0_platform_data = { | 240 | static struct resource mtu2_resources[] = { |
241 | .channel_offset = -0x80, | 241 | DEFINE_RES_MEM(0xfffe4000, 0x400), |
242 | .timer_bit = 0, | 242 | DEFINE_RES_IRQ_NAMED(156, "tgi0a"), |
243 | .clockevent_rating = 200, | 243 | DEFINE_RES_IRQ_NAMED(164, "tgi1a"), |
244 | DEFINE_RES_IRQ_NAMED(180, "tgi2a"), | ||
244 | }; | 245 | }; |
245 | 246 | ||
246 | static struct resource mtu2_0_resources[] = { | 247 | static struct platform_device mtu2_device = { |
247 | [0] = { | 248 | .name = "sh-mtu2s", |
248 | .start = 0xfffe4300, | 249 | .id = -1, |
249 | .end = 0xfffe4326, | 250 | .resource = mtu2_resources, |
250 | .flags = IORESOURCE_MEM, | 251 | .num_resources = ARRAY_SIZE(mtu2_resources), |
251 | }, | ||
252 | [1] = { | ||
253 | .start = 156, | ||
254 | .flags = IORESOURCE_IRQ, | ||
255 | }, | ||
256 | }; | ||
257 | |||
258 | static struct platform_device mtu2_0_device = { | ||
259 | .name = "sh_mtu2", | ||
260 | .id = 0, | ||
261 | .dev = { | ||
262 | .platform_data = &mtu2_0_platform_data, | ||
263 | }, | ||
264 | .resource = mtu2_0_resources, | ||
265 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
266 | }; | ||
267 | |||
268 | static struct sh_timer_config mtu2_1_platform_data = { | ||
269 | .channel_offset = -0x100, | ||
270 | .timer_bit = 1, | ||
271 | .clockevent_rating = 200, | ||
272 | }; | ||
273 | |||
274 | static struct resource mtu2_1_resources[] = { | ||
275 | [0] = { | ||
276 | .start = 0xfffe4380, | ||
277 | .end = 0xfffe4390, | ||
278 | .flags = IORESOURCE_MEM, | ||
279 | }, | ||
280 | [1] = { | ||
281 | .start = 164, | ||
282 | .flags = IORESOURCE_IRQ, | ||
283 | }, | ||
284 | }; | ||
285 | |||
286 | static struct platform_device mtu2_1_device = { | ||
287 | .name = "sh_mtu2", | ||
288 | .id = 1, | ||
289 | .dev = { | ||
290 | .platform_data = &mtu2_1_platform_data, | ||
291 | }, | ||
292 | .resource = mtu2_1_resources, | ||
293 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
294 | }; | ||
295 | |||
296 | static struct sh_timer_config mtu2_2_platform_data = { | ||
297 | .channel_offset = 0x80, | ||
298 | .timer_bit = 2, | ||
299 | .clockevent_rating = 200, | ||
300 | }; | ||
301 | |||
302 | static struct resource mtu2_2_resources[] = { | ||
303 | [0] = { | ||
304 | .start = 0xfffe4000, | ||
305 | .end = 0xfffe400a, | ||
306 | .flags = IORESOURCE_MEM, | ||
307 | }, | ||
308 | [1] = { | ||
309 | .start = 180, | ||
310 | .flags = IORESOURCE_IRQ, | ||
311 | }, | ||
312 | }; | ||
313 | |||
314 | static struct platform_device mtu2_2_device = { | ||
315 | .name = "sh_mtu2", | ||
316 | .id = 2, | ||
317 | .dev = { | ||
318 | .platform_data = &mtu2_2_platform_data, | ||
319 | }, | ||
320 | .resource = mtu2_2_resources, | ||
321 | .num_resources = ARRAY_SIZE(mtu2_2_resources), | ||
322 | }; | 252 | }; |
323 | 253 | ||
324 | static struct platform_device *sh7206_devices[] __initdata = { | 254 | static struct platform_device *sh7206_devices[] __initdata = { |
@@ -327,9 +257,7 @@ static struct platform_device *sh7206_devices[] __initdata = { | |||
327 | &scif2_device, | 257 | &scif2_device, |
328 | &scif3_device, | 258 | &scif3_device, |
329 | &cmt_device, | 259 | &cmt_device, |
330 | &mtu2_0_device, | 260 | &mtu2_device, |
331 | &mtu2_1_device, | ||
332 | &mtu2_2_device, | ||
333 | }; | 261 | }; |
334 | 262 | ||
335 | static int __init sh7206_devices_setup(void) | 263 | static int __init sh7206_devices_setup(void) |
@@ -350,9 +278,7 @@ static struct platform_device *sh7206_early_devices[] __initdata = { | |||
350 | &scif2_device, | 278 | &scif2_device, |
351 | &scif3_device, | 279 | &scif3_device, |
352 | &cmt_device, | 280 | &cmt_device, |
353 | &mtu2_0_device, | 281 | &mtu2_device, |
354 | &mtu2_1_device, | ||
355 | &mtu2_2_device, | ||
356 | }; | 282 | }; |
357 | 283 | ||
358 | #define STBCR3 0xfffe0408 | 284 | #define STBCR3 0xfffe0408 |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c index e95250e82752..608146455562 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c | |||
@@ -453,64 +453,17 @@ static struct platform_device cmt_device = { | |||
453 | .num_resources = ARRAY_SIZE(cmt_resources), | 453 | .num_resources = ARRAY_SIZE(cmt_resources), |
454 | }; | 454 | }; |
455 | 455 | ||
456 | static struct sh_timer_config mtu2_0_platform_data = { | 456 | static struct resource mtu2_resources[] = { |
457 | .name = "MTU2_0", | 457 | DEFINE_RES_MEM(0xfffe4000, 0x400), |
458 | .channel_offset = -0x80, | 458 | DEFINE_RES_IRQ_NAMED(179, "tgi0a"), |
459 | .timer_bit = 0, | 459 | DEFINE_RES_IRQ_NAMED(186, "tgi1a"), |
460 | .clockevent_rating = 200, | ||
461 | }; | 460 | }; |
462 | 461 | ||
463 | static struct resource mtu2_0_resources[] = { | 462 | static struct platform_device mtu2_device = { |
464 | [0] = { | 463 | .name = "sh-mtu2", |
465 | .name = "MTU2_0", | 464 | .id = -1, |
466 | .start = 0xfffe4300, | 465 | .resource = mtu2_resources, |
467 | .end = 0xfffe4326, | 466 | .num_resources = ARRAY_SIZE(mtu2_resources), |
468 | .flags = IORESOURCE_MEM, | ||
469 | }, | ||
470 | [1] = { | ||
471 | .start = 179, | ||
472 | .flags = IORESOURCE_IRQ, | ||
473 | }, | ||
474 | }; | ||
475 | |||
476 | static struct platform_device mtu2_0_device = { | ||
477 | .name = "sh_mtu2", | ||
478 | .id = 0, | ||
479 | .dev = { | ||
480 | .platform_data = &mtu2_0_platform_data, | ||
481 | }, | ||
482 | .resource = mtu2_0_resources, | ||
483 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
484 | }; | ||
485 | |||
486 | static struct sh_timer_config mtu2_1_platform_data = { | ||
487 | .name = "MTU2_1", | ||
488 | .channel_offset = -0x100, | ||
489 | .timer_bit = 1, | ||
490 | .clockevent_rating = 200, | ||
491 | }; | ||
492 | |||
493 | static struct resource mtu2_1_resources[] = { | ||
494 | [0] = { | ||
495 | .name = "MTU2_1", | ||
496 | .start = 0xfffe4380, | ||
497 | .end = 0xfffe4390, | ||
498 | .flags = IORESOURCE_MEM, | ||
499 | }, | ||
500 | [1] = { | ||
501 | .start = 186, | ||
502 | .flags = IORESOURCE_IRQ, | ||
503 | }, | ||
504 | }; | ||
505 | |||
506 | static struct platform_device mtu2_1_device = { | ||
507 | .name = "sh_mtu2", | ||
508 | .id = 1, | ||
509 | .dev = { | ||
510 | .platform_data = &mtu2_1_platform_data, | ||
511 | }, | ||
512 | .resource = mtu2_1_resources, | ||
513 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
514 | }; | 467 | }; |
515 | 468 | ||
516 | static struct resource rtc_resources[] = { | 469 | static struct resource rtc_resources[] = { |
@@ -580,8 +533,7 @@ static struct platform_device *sh7264_devices[] __initdata = { | |||
580 | &scif6_device, | 533 | &scif6_device, |
581 | &scif7_device, | 534 | &scif7_device, |
582 | &cmt_device, | 535 | &cmt_device, |
583 | &mtu2_0_device, | 536 | &mtu2_device, |
584 | &mtu2_1_device, | ||
585 | &rtc_device, | 537 | &rtc_device, |
586 | &r8a66597_usb_host_device, | 538 | &r8a66597_usb_host_device, |
587 | }; | 539 | }; |
@@ -608,8 +560,7 @@ static struct platform_device *sh7264_early_devices[] __initdata = { | |||
608 | &scif6_device, | 560 | &scif6_device, |
609 | &scif7_device, | 561 | &scif7_device, |
610 | &cmt_device, | 562 | &cmt_device, |
611 | &mtu2_0_device, | 563 | &mtu2_device, |
612 | &mtu2_1_device, | ||
613 | }; | 564 | }; |
614 | 565 | ||
615 | void __init plat_early_device_setup(void) | 566 | void __init plat_early_device_setup(void) |
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c index 0191e1ae8411..16ce5aa77bdd 100644 --- a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c +++ b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c | |||
@@ -475,60 +475,17 @@ static struct platform_device cmt_device = { | |||
475 | .num_resources = ARRAY_SIZE(cmt_resources), | 475 | .num_resources = ARRAY_SIZE(cmt_resources), |
476 | }; | 476 | }; |
477 | 477 | ||
478 | static struct sh_timer_config mtu2_0_platform_data = { | 478 | static struct resource mtu2_resources[] = { |
479 | .channel_offset = -0x80, | 479 | DEFINE_RES_MEM(0xfffe4000, 0x400), |
480 | .timer_bit = 0, | 480 | DEFINE_RES_IRQ_NAMED(192, "tgi0a"), |
481 | .clockevent_rating = 200, | 481 | DEFINE_RES_IRQ_NAMED(203, "tgi1a"), |
482 | }; | 482 | }; |
483 | 483 | ||
484 | static struct resource mtu2_0_resources[] = { | 484 | static struct platform_device mtu2_device = { |
485 | [0] = { | 485 | .name = "sh-mtu2", |
486 | .start = 0xfffe4300, | 486 | .id = -1, |
487 | .end = 0xfffe4326, | 487 | .resource = mtu2_resources, |
488 | .flags = IORESOURCE_MEM, | 488 | .num_resources = ARRAY_SIZE(mtu2_resources), |
489 | }, | ||
490 | [1] = { | ||
491 | .start = 192, | ||
492 | .flags = IORESOURCE_IRQ, | ||
493 | }, | ||
494 | }; | ||
495 | |||
496 | static struct platform_device mtu2_0_device = { | ||
497 | .name = "sh_mtu2", | ||
498 | .id = 0, | ||
499 | .dev = { | ||
500 | .platform_data = &mtu2_0_platform_data, | ||
501 | }, | ||
502 | .resource = mtu2_0_resources, | ||
503 | .num_resources = ARRAY_SIZE(mtu2_0_resources), | ||
504 | }; | ||
505 | |||
506 | static struct sh_timer_config mtu2_1_platform_data = { | ||
507 | .channel_offset = -0x100, | ||
508 | .timer_bit = 1, | ||
509 | .clockevent_rating = 200, | ||
510 | }; | ||
511 | |||
512 | static struct resource mtu2_1_resources[] = { | ||
513 | [0] = { | ||
514 | .start = 0xfffe4380, | ||
515 | .end = 0xfffe4390, | ||
516 | .flags = IORESOURCE_MEM, | ||
517 | }, | ||
518 | [1] = { | ||
519 | .start = 203, | ||
520 | .flags = IORESOURCE_IRQ, | ||
521 | }, | ||
522 | }; | ||
523 | |||
524 | static struct platform_device mtu2_1_device = { | ||
525 | .name = "sh_mtu2", | ||
526 | .id = 1, | ||
527 | .dev = { | ||
528 | .platform_data = &mtu2_1_platform_data, | ||
529 | }, | ||
530 | .resource = mtu2_1_resources, | ||
531 | .num_resources = ARRAY_SIZE(mtu2_1_resources), | ||
532 | }; | 489 | }; |
533 | 490 | ||
534 | static struct resource rtc_resources[] = { | 491 | static struct resource rtc_resources[] = { |
@@ -592,8 +549,7 @@ static struct platform_device *sh7269_devices[] __initdata = { | |||
592 | &scif6_device, | 549 | &scif6_device, |
593 | &scif7_device, | 550 | &scif7_device, |
594 | &cmt_device, | 551 | &cmt_device, |
595 | &mtu2_0_device, | 552 | &mtu2_device, |
596 | &mtu2_1_device, | ||
597 | &rtc_device, | 553 | &rtc_device, |
598 | &r8a66597_usb_host_device, | 554 | &r8a66597_usb_host_device, |
599 | }; | 555 | }; |
@@ -620,8 +576,7 @@ static struct platform_device *sh7269_early_devices[] __initdata = { | |||
620 | &scif6_device, | 576 | &scif6_device, |
621 | &scif7_device, | 577 | &scif7_device, |
622 | &cmt_device, | 578 | &cmt_device, |
623 | &mtu2_0_device, | 579 | &mtu2_device, |
624 | &mtu2_1_device, | ||
625 | }; | 580 | }; |
626 | 581 | ||
627 | void __init plat_early_device_setup(void) | 582 | void __init plat_early_device_setup(void) |