diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2012-12-12 05:08:09 -0500 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-01-24 22:43:43 -0500 |
commit | e67d7afc567437246ec425f1989ea38b372571df (patch) | |
tree | 7f256d33eb2d13aaa4ac78f0095f836510791ab0 | |
parent | f977ec94f7f2d1211305ac0c79b8e79155c236ef (diff) |
ARM: shmobile: r8a7740: add TMU timer support
This patch enabled TMU0 timer on r8a7740.
But TMU1 timer is not supported yet
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7740.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-r8a7740.c | 94 |
2 files changed, 99 insertions, 1 deletions
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c index eac49d59782f..19ce885a3b43 100644 --- a/arch/arm/mach-shmobile/clock-r8a7740.c +++ b/arch/arm/mach-shmobile/clock-r8a7740.c | |||
@@ -581,10 +581,14 @@ static struct clk_lookup lookups[] = { | |||
581 | 581 | ||
582 | /* MSTP32 clocks */ | 582 | /* MSTP32 clocks */ |
583 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), | 583 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), |
584 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP111]), | 584 | CLKDEV_DEV_ID("sh_tmu.3", &mstp_clks[MSTP111]), |
585 | CLKDEV_DEV_ID("sh_tmu.4", &mstp_clks[MSTP111]), | ||
586 | CLKDEV_DEV_ID("sh_tmu.5", &mstp_clks[MSTP111]), | ||
585 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), | 587 | CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), |
586 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), | 588 | CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), |
587 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), | 589 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), |
590 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), | ||
591 | CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP125]), | ||
588 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), | 592 | CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), |
589 | CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), | 593 | CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), |
590 | 594 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c index 9ef397d41158..847567d55487 100644 --- a/arch/arm/mach-shmobile/setup-r8a7740.c +++ b/arch/arm/mach-shmobile/setup-r8a7740.c | |||
@@ -261,6 +261,97 @@ static struct platform_device cmt10_device = { | |||
261 | .num_resources = ARRAY_SIZE(cmt10_resources), | 261 | .num_resources = ARRAY_SIZE(cmt10_resources), |
262 | }; | 262 | }; |
263 | 263 | ||
264 | /* TMU */ | ||
265 | static struct sh_timer_config tmu00_platform_data = { | ||
266 | .name = "TMU00", | ||
267 | .channel_offset = 0x4, | ||
268 | .timer_bit = 0, | ||
269 | .clockevent_rating = 200, | ||
270 | }; | ||
271 | |||
272 | static struct resource tmu00_resources[] = { | ||
273 | [0] = { | ||
274 | .name = "TMU00", | ||
275 | .start = 0xfff80008, | ||
276 | .end = 0xfff80014 - 1, | ||
277 | .flags = IORESOURCE_MEM, | ||
278 | }, | ||
279 | [1] = { | ||
280 | .start = intcs_evt2irq(0xe80), | ||
281 | .flags = IORESOURCE_IRQ, | ||
282 | }, | ||
283 | }; | ||
284 | |||
285 | static struct platform_device tmu00_device = { | ||
286 | .name = "sh_tmu", | ||
287 | .id = 0, | ||
288 | .dev = { | ||
289 | .platform_data = &tmu00_platform_data, | ||
290 | }, | ||
291 | .resource = tmu00_resources, | ||
292 | .num_resources = ARRAY_SIZE(tmu00_resources), | ||
293 | }; | ||
294 | |||
295 | static struct sh_timer_config tmu01_platform_data = { | ||
296 | .name = "TMU01", | ||
297 | .channel_offset = 0x10, | ||
298 | .timer_bit = 1, | ||
299 | .clocksource_rating = 200, | ||
300 | }; | ||
301 | |||
302 | static struct resource tmu01_resources[] = { | ||
303 | [0] = { | ||
304 | .name = "TMU01", | ||
305 | .start = 0xfff80014, | ||
306 | .end = 0xfff80020 - 1, | ||
307 | .flags = IORESOURCE_MEM, | ||
308 | }, | ||
309 | [1] = { | ||
310 | .start = intcs_evt2irq(0xea0), | ||
311 | .flags = IORESOURCE_IRQ, | ||
312 | }, | ||
313 | }; | ||
314 | |||
315 | static struct platform_device tmu01_device = { | ||
316 | .name = "sh_tmu", | ||
317 | .id = 1, | ||
318 | .dev = { | ||
319 | .platform_data = &tmu01_platform_data, | ||
320 | }, | ||
321 | .resource = tmu01_resources, | ||
322 | .num_resources = ARRAY_SIZE(tmu01_resources), | ||
323 | }; | ||
324 | |||
325 | static struct sh_timer_config tmu02_platform_data = { | ||
326 | .name = "TMU02", | ||
327 | .channel_offset = 0x1C, | ||
328 | .timer_bit = 2, | ||
329 | .clocksource_rating = 200, | ||
330 | }; | ||
331 | |||
332 | static struct resource tmu02_resources[] = { | ||
333 | [0] = { | ||
334 | .name = "TMU02", | ||
335 | .start = 0xfff80020, | ||
336 | .end = 0xfff8002C - 1, | ||
337 | .flags = IORESOURCE_MEM, | ||
338 | }, | ||
339 | [1] = { | ||
340 | .start = intcs_evt2irq(0xec0), | ||
341 | .flags = IORESOURCE_IRQ, | ||
342 | }, | ||
343 | }; | ||
344 | |||
345 | static struct platform_device tmu02_device = { | ||
346 | .name = "sh_tmu", | ||
347 | .id = 2, | ||
348 | .dev = { | ||
349 | .platform_data = &tmu02_platform_data, | ||
350 | }, | ||
351 | .resource = tmu02_resources, | ||
352 | .num_resources = ARRAY_SIZE(tmu02_resources), | ||
353 | }; | ||
354 | |||
264 | static struct platform_device *r8a7740_early_devices[] __initdata = { | 355 | static struct platform_device *r8a7740_early_devices[] __initdata = { |
265 | &scif0_device, | 356 | &scif0_device, |
266 | &scif1_device, | 357 | &scif1_device, |
@@ -272,6 +363,9 @@ static struct platform_device *r8a7740_early_devices[] __initdata = { | |||
272 | &scif7_device, | 363 | &scif7_device, |
273 | &scifb_device, | 364 | &scifb_device, |
274 | &cmt10_device, | 365 | &cmt10_device, |
366 | &tmu00_device, | ||
367 | &tmu01_device, | ||
368 | &tmu02_device, | ||
275 | }; | 369 | }; |
276 | 370 | ||
277 | /* DMA */ | 371 | /* DMA */ |