aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/setup-r8a7740.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/setup-r8a7740.c')
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c106
1 files changed, 95 insertions, 11 deletions
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 095222469d03..847567d55487 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -27,7 +27,6 @@
27#include <linux/serial_sci.h> 27#include <linux/serial_sci.h>
28#include <linux/sh_dma.h> 28#include <linux/sh_dma.h>
29#include <linux/sh_timer.h> 29#include <linux/sh_timer.h>
30#include <linux/dma-mapping.h>
31#include <mach/dma-register.h> 30#include <mach/dma-register.h>
32#include <mach/r8a7740.h> 31#include <mach/r8a7740.h>
33#include <mach/pm-rmobile.h> 32#include <mach/pm-rmobile.h>
@@ -262,6 +261,97 @@ static struct platform_device cmt10_device = {
262 .num_resources = ARRAY_SIZE(cmt10_resources), 261 .num_resources = ARRAY_SIZE(cmt10_resources),
263}; 262};
264 263
264/* TMU */
265static struct sh_timer_config tmu00_platform_data = {
266 .name = "TMU00",
267 .channel_offset = 0x4,
268 .timer_bit = 0,
269 .clockevent_rating = 200,
270};
271
272static 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
285static 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
295static struct sh_timer_config tmu01_platform_data = {
296 .name = "TMU01",
297 .channel_offset = 0x10,
298 .timer_bit = 1,
299 .clocksource_rating = 200,
300};
301
302static 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
315static 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
325static struct sh_timer_config tmu02_platform_data = {
326 .name = "TMU02",
327 .channel_offset = 0x1C,
328 .timer_bit = 2,
329 .clocksource_rating = 200,
330};
331
332static 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
345static 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
265static struct platform_device *r8a7740_early_devices[] __initdata = { 355static struct platform_device *r8a7740_early_devices[] __initdata = {
266 &scif0_device, 356 &scif0_device,
267 &scif1_device, 357 &scif1_device,
@@ -273,6 +363,9 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
273 &scif7_device, 363 &scif7_device,
274 &scifb_device, 364 &scifb_device,
275 &cmt10_device, 365 &cmt10_device,
366 &tmu00_device,
367 &tmu01_device,
368 &tmu02_device,
276}; 369};
277 370
278/* DMA */ 371/* DMA */
@@ -705,12 +798,6 @@ void __init r8a7740_add_standard_devices(void)
705 rmobile_add_device_to_domain("A3SP", &i2c1_device); 798 rmobile_add_device_to_domain("A3SP", &i2c1_device);
706} 799}
707 800
708static void __init r8a7740_earlytimer_init(void)
709{
710 r8a7740_clock_init(0);
711 shmobile_earlytimer_init();
712}
713
714void __init r8a7740_add_early_devices(void) 801void __init r8a7740_add_early_devices(void)
715{ 802{
716 early_platform_add_devices(r8a7740_early_devices, 803 early_platform_add_devices(r8a7740_early_devices,
@@ -718,9 +805,6 @@ void __init r8a7740_add_early_devices(void)
718 805
719 /* setup early console here as well */ 806 /* setup early console here as well */
720 shmobile_setup_console(); 807 shmobile_setup_console();
721
722 /* override timer setup with soc-specific code */
723 shmobile_timer.init = r8a7740_earlytimer_init;
724} 808}
725 809
726#ifdef CONFIG_USE_OF 810#ifdef CONFIG_USE_OF
@@ -763,7 +847,7 @@ DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)")
763 .init_irq = r8a7740_init_irq, 847 .init_irq = r8a7740_init_irq,
764 .handle_irq = shmobile_handle_irq_intc, 848 .handle_irq = shmobile_handle_irq_intc,
765 .init_machine = r8a7740_add_standard_devices_dt, 849 .init_machine = r8a7740_add_standard_devices_dt,
766 .timer = &shmobile_timer, 850 .init_time = shmobile_timer_init,
767 .dt_compat = r8a7740_boards_compat_dt, 851 .dt_compat = r8a7740_boards_compat_dt,
768MACHINE_END 852MACHINE_END
769 853