sh: Switch to new style TMU device
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Wed, 23 Apr 2014 11:15:15 +0000 (13:15 +0200)
committerSimon Horman <horms+renesas@verge.net.au>
Sun, 11 May 2014 10:35:27 +0000 (19:35 +0900)
The TMU (Timer Unit) 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>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
30 files changed:
arch/sh/kernel/cpu/clock-cpg.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/clock-sh7722.c
arch/sh/kernel/cpu/sh4a/clock-sh7723.c
arch/sh/kernel/cpu/sh4a/clock-sh7724.c
arch/sh/kernel/cpu/sh4a/clock-sh7734.c
arch/sh/kernel/cpu/sh4a/clock-sh7757.c
arch/sh/kernel/cpu/sh4a/clock-sh7785.c
arch/sh/kernel/cpu/sh4a/clock-sh7786.c
arch/sh/kernel/cpu/sh4a/clock-shx3.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-sh7734.c
arch/sh/kernel/cpu/sh4a/setup-sh7757.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

index 8de314b8e5df3c70d4912caa4fa7d1fa724bd94e..121ef690763f7dbac7663fe7d89fdcb9cdd48b40 100644 (file)
@@ -56,7 +56,10 @@ int __init __deprecated cpg_clk_init(void)
 
        clkdev_add_table(lookups, ARRAY_SIZE(lookups));
 
-       clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-tmu-sh3.0", "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL);
+       clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL);
        clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL);
        clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
        clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
index c76b2543b85f4f105b2edf5451efecbf34eb60de..6a72fd14de21c838be8976dde92acc6dc53484de 100644 (file)
@@ -143,25 +143,18 @@ static struct platform_device rtc_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xfffffe94,
-               .end    = 0xfffffe9f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xfffffe90, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu-sh3",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -170,67 +163,10 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0xe,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xfffffea0,
-               .end    = 0xfffffeab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1a,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xfffffeac,
-               .end    = 0xfffffebb,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh7705_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &rtc_device,
 };
 
@@ -245,8 +181,6 @@ static struct platform_device *sh7705_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index ff1465c0519cbcf81878528d258055886c4f6d99..9139d14b9c53460587b4be67de041e44e49893fe 100644 (file)
@@ -185,25 +185,18 @@ static struct platform_device scif2_device = {
 #endif
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xfffffe94,
-               .end    = 0xfffffe9f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xfffffe90, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu-sh3",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -212,61 +205,6 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0xe,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xfffffea0,
-               .end    = 0xfffffeab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1a,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xfffffeac,
-               .end    = 0xfffffebb,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh770x_devices[] __initdata = {
        &scif0_device,
 #if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
@@ -279,8 +217,6 @@ static struct platform_device *sh770x_devices[] __initdata = {
        &scif2_device,
 #endif
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &rtc_device,
 };
 
@@ -303,8 +239,6 @@ static struct platform_device *sh770x_early_devices[] __initdata = {
        &scif2_device,
 #endif
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index e2ce9360ed5ac0eb65dbbfab2921fa1f644f5791..e9ed300dba5cabbde3282c5cce93dd96fde3ca6e 100644 (file)
@@ -142,25 +142,18 @@ static struct platform_device scif1_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xa412fe94,
-               .end    = 0xa412fe9f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xa412fe90, 0x28),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu-sh3",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -169,67 +162,10 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0xe,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xa412fea0,
-               .end    = 0xa412feab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1a,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xa412feac,
-               .end    = 0xa412feb5,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh7710_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &rtc_device,
 };
 
@@ -244,8 +180,6 @@ static struct platform_device *sh7710_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index a53d21925b9422695fef43154302becbe77a91be..84df85a5b800c6a6c25414fe2e81501c31697c37 100644 (file)
@@ -172,25 +172,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x02,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xa412fe94,
-               .end    = 0xa412fe9f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xa412fe90, 0x28),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu-sh3",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -199,68 +192,11 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0xe,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xa412fea0,
-               .end    = 0xa412feab,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1a,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xa412feac,
-               .end    = 0xa412feb5,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh7720_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &rtc_device,
        &usb_ohci_device,
        &usbf_device,
@@ -278,8 +214,6 @@ static struct platform_device *sh7720_early_devices[] __initdata = {
        &scif1_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index a8bd778d5ac881244dc161857c307557d9363091..e7a7b3cdf68daeb11f85f8173ea001ec906dcba8 100644 (file)
@@ -41,25 +41,18 @@ static struct platform_device scif0_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -68,66 +61,9 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh4202_devices[] __initdata = {
        &scif0_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 static int __init sh4202_devices_setup(void)
@@ -140,8 +76,6 @@ arch_initcall(sh4202_devices_setup);
 static struct platform_device *sh4202_early_devices[] __initdata = {
        &scif0_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index a447a248491f8dbdb0479ba2db03de3392100fc7..5f08c59b9f3e6252d45ad31a5525136d0361cb2a 100644 (file)
@@ -82,25 +82,18 @@ static struct platform_device scif_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -109,26 +102,23 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
+/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
+#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
+       defined(CONFIG_CPU_SUBTYPE_SH7751) || \
+       defined(CONFIG_CPU_SUBTYPE_SH7751R)
+
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 3,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xfe100000, 0x20),
+       DEFINE_RES_IRQ(evt2irq(0xb00)),
+       DEFINE_RES_IRQ(evt2irq(0xb80)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -137,104 +127,15 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
-#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
-       defined(CONFIG_CPU_SUBTYPE_SH7751) || \
-       defined(CONFIG_CPU_SUBTYPE_SH7751R)
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xfe100008,
-               .end    = 0xfe100013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xb00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xfe100014,
-               .end    = 0xfe10001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xb80),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
 #endif
 
 static struct platform_device *sh7750_devices[] __initdata = {
        &rtc_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 #if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
        defined(CONFIG_CPU_SUBTYPE_SH7751) || \
        defined(CONFIG_CPU_SUBTYPE_SH7751R)
-       &tmu3_device,
-       &tmu4_device,
+       &tmu1_device,
 #endif
 };
 
@@ -254,13 +155,10 @@ arch_initcall(sh7750_devices_setup);
 
 static struct platform_device *sh7750_early_devices[] __initdata = {
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 #if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
        defined(CONFIG_CPU_SUBTYPE_SH7751) || \
        defined(CONFIG_CPU_SUBTYPE_SH7751R)
-       &tmu3_device,
-       &tmu4_device,
+       &tmu1_device,
 #endif
 };
 
index 1abd9fb4a3865c7492abe77bf82a741793e7c6c3..973b736b3b981f75595fe5e2eb1ee30e7fe012f4 100644 (file)
@@ -227,25 +227,18 @@ static struct platform_device scif3_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -254,61 +247,6 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 
 static struct platform_device *sh7760_devices[] __initdata = {
        &scif0_device,
@@ -316,8 +254,6 @@ static struct platform_device *sh7760_devices[] __initdata = {
        &scif2_device,
        &scif3_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 static int __init sh7760_devices_setup(void)
@@ -333,8 +269,6 @@ static struct platform_device *sh7760_early_devices[] __initdata = {
        &scif2_device,
        &scif3_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index 40974934512aa5f6594d8b9ea88ae60eb09b26d5..8f07a1a386929e5dafb5650a52cc862457dae189 100644 (file)
@@ -203,9 +203,7 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),
        CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU]),
 
        CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
        CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
index da64734b0fd3b3583f5e31353338504f26c91729..ccbcab550df24efc93896cba8136222ba130b101 100644 (file)
@@ -264,12 +264,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
        CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
 
        CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
index f917f192650785ad340d844895e64374281f802c..f579dd528198919914d9433984b02df7084d90f0 100644 (file)
@@ -304,17 +304,13 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
        CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
 
        CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]),
        CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
        CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
        CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
        CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
        CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
index ed9501519ab36355e0f572f2c6b0c0669f6d711e..1fdf1ee672de130f6c36ee73a3959cae5084ae3e 100644 (file)
@@ -201,15 +201,9 @@ static struct clk_lookup lookups[] = {
        CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]),
        CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP016]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP016]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP016]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP015]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP015]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP015]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP014]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP014]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP014]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP014]),
        CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]),
        CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]),
        CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]),
index 5c0e3c33516168891aebe5f3283b90fe179ba1af..9a28fdb36387363f8d42ce67ad3c0bd140cb4088 100644 (file)
@@ -123,8 +123,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
        CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP113]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP114]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
        CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
index 1c83788db76a1f0c0055a1b8dd088073380cc579..17d0ea55a5a2f24ac54178e88308114395807498 100644 (file)
@@ -146,12 +146,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]),
        CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
 
        CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),
        CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
index 8bba6f15902350d4b7429e960e0a49627b60ef59..bec2a83f1ba5dc224c49db9dac0e20d22e15a5ff 100644 (file)
@@ -155,18 +155,10 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]),
        CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP010]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP010]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP010]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.9", &mstp_clks[MSTP011]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.10", &mstp_clks[MSTP011]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.11", &mstp_clks[MSTP011]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP010]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.3", &mstp_clks[MSTP011]),
 
        CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]),
        CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]),
index a9422dab0ce747115bca41176e47d63f63d78ec4..9a49a44f6f94c85d0d13e991cab8eab836083fb4 100644 (file)
@@ -124,12 +124,8 @@ static struct clk_lookup lookups[] = {
        CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),
        CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]),
 
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
-       CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
+       CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
 
        CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
        CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
index ad96492f290d090efb180ce131e1553b252244ec..ceb3dedad983c8d8c92bf703b72498be852a6ec6 100644 (file)
@@ -247,25 +247,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -274,61 +267,6 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh7343_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@ -336,8 +274,6 @@ static struct platform_device *sh7343_devices[] __initdata = {
        &scif3_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &iic0_device,
        &iic1_device,
        &vpu_device,
@@ -363,8 +299,6 @@ static struct platform_device *sh7343_early_devices[] __initdata = {
        &scif3_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index 4e4985d95e53ae2288dccbfb00b49eb9e91ee3f4..f75f67343139a2bcc96d1ec77d3bf7225304e0a3 100644 (file)
@@ -195,25 +195,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 16,
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -222,67 +215,10 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh7366_devices[] __initdata = {
        &scif0_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &iic_device,
        &usb_host_device,
        &vpu_device,
@@ -305,8 +241,6 @@ static struct platform_device *sh7366_early_devices[] __initdata = {
        &scif0_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index 4e3218f288e781e9880903e12e878682fe1bdac1..57f83a92a505a639b02beba2b0494ea93d8aa3c5 100644 (file)
@@ -432,25 +432,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -459,61 +452,6 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = 18,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct siu_platform siu_platform_data = {
        .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX,
        .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX,
@@ -549,8 +487,6 @@ static struct platform_device *sh7722_devices[] __initdata = {
        &scif2_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
        &rtc_device,
        &usbf_device,
        &iic_device,
@@ -578,8 +514,6 @@ static struct platform_device *sh7722_early_devices[] __initdata = {
        &scif2_device,
        &cmt_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 void __init plat_early_device_setup(void)
index 5dfdb850126200019a7e67baa86c596e395640f5..3533b56dd46509d3477b4f9261a695c8a9b8c8b3 100644 (file)
@@ -264,25 +264,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -292,25 +285,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd90000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x920)),
+       DEFINE_RES_IRQ(evt2irq(0x940)),
+       DEFINE_RES_IRQ(evt2irq(0x960)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -319,114 +305,6 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffd90008,
-               .end    = 0xffd90013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x920),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffd90014,
-               .end    = 0xffd9001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x940),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffd90020,
-               .end    = 0xffd9002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x920),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 static struct resource rtc_resources[] = {
        [0] = {
                .start  = 0xa465fec0,
@@ -517,10 +395,6 @@ static struct platform_device *sh7723_devices[] __initdata = {
        &cmt_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
        &rtc_device,
        &iic_device,
        &sh7723_usb_host_device,
@@ -550,10 +424,6 @@ static struct platform_device *sh7723_early_devices[] __initdata = {
        &cmt_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 void __init plat_early_device_setup(void)
index b435f076f29271cd7d2d9ba802c768b82a8a8a76..b9e84b1d3aa72c9e38a6992c35a3d57f94093ea6 100644 (file)
@@ -667,25 +667,18 @@ static struct platform_device cmt_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -695,25 +688,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd90000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x920)),
+       DEFINE_RES_IRQ(evt2irq(0x940)),
+       DEFINE_RES_IRQ(evt2irq(0x960)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -722,115 +708,6 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffd90008,
-               .end    = 0xffd90013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x920),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffd90014,
-               .end    = 0xffd9001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x940),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffd90020,
-               .end    = 0xffd9002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x920),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 /* JPU */
 static struct uio_info jpu_platform_data = {
        .name = "JPU",
@@ -928,10 +805,6 @@ static struct platform_device *sh7724_devices[] __initdata = {
        &cmt_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
        &dma0_device,
        &dma1_device,
        &rtc_device,
@@ -971,10 +844,6 @@ static struct platform_device *sh7724_early_devices[] __initdata = {
        &cmt_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 void __init plat_early_device_setup(void)
index dad4ed1b2f9429e48803c81bac5d5e1273507905..f617bcb734dfeb76a507965c58dad6c3211a3ef2 100644 (file)
@@ -200,25 +200,18 @@ static struct platform_device i2c0_device = {
 
 /* TMU */
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xFFD80008,
-               .end    = 0xFFD80014 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name   = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -228,26 +221,19 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xFFD80014,
-               .end    = 0xFFD80020 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd81000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x480)),
+       DEFINE_RES_IRQ(evt2irq(0x4a0)),
+       DEFINE_RES_IRQ(evt2irq(0x4c0)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id                     = 1,
+       .name           = "sh-tmu",
+       .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
        },
@@ -256,25 +242,19 @@ static struct platform_device tmu1_device = {
 };
 
 static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
+       .channels_mask = 7,
 };
 
 static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xFFD80020,
-               .end    = 0xFFD80030 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd82000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x500)),
+       DEFINE_RES_IRQ(evt2irq(0x520)),
+       DEFINE_RES_IRQ(evt2irq(0x540)),
 };
 
 static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id                     = 2,
+       .name           = "sh-tmu",
+       .id             = 2,
        .dev = {
                .platform_data  = &tmu2_platform_data,
        },
@@ -282,169 +262,6 @@ static struct platform_device tmu2_device = {
        .num_resources  = ARRAY_SIZE(tmu2_resources),
 };
 
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xFFD81008,
-               .end    = 0xFFD81014 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x480),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id                     = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xFFD81014,
-               .end    = 0xFFD81020 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4A0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id                     = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xFFD81020,
-               .end    = 0xFFD81030 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4C0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id                     = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
-static struct sh_timer_config tmu6_platform_data = {
-       .channel_offset = 0x4,
-       .timer_bit = 0,
-};
-
-static struct resource tmu6_resources[] = {
-       [0] = {
-               .start  = 0xFFD82008,
-               .end    = 0xFFD82014 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x500),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu6_device = {
-       .name           = "sh_tmu",
-       .id                     = 6,
-       .dev = {
-               .platform_data  = &tmu6_platform_data,
-       },
-       .resource       = tmu6_resources,
-       .num_resources  = ARRAY_SIZE(tmu6_resources),
-};
-
-static struct sh_timer_config tmu7_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu7_resources[] = {
-       [0] = {
-               .start  = 0xFFD82014,
-               .end    = 0xFFD82020 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x520),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu7_device = {
-       .name           = "sh_tmu",
-       .id                     = 7,
-       .dev = {
-               .platform_data  = &tmu7_platform_data,
-       },
-       .resource       = tmu7_resources,
-       .num_resources  = ARRAY_SIZE(tmu7_resources),
-};
-
-static struct sh_timer_config tmu8_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu8_resources[] = {
-       [0] = {
-               .start  = 0xFFD82020,
-               .end    = 0xFFD82030 - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x540),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu8_device = {
-       .name           = "sh_tmu",
-       .id                     = 8,
-       .dev = {
-               .platform_data  = &tmu8_platform_data,
-       },
-       .resource       = tmu8_resources,
-       .num_resources  = ARRAY_SIZE(tmu8_resources),
-};
-
 static struct platform_device *sh7734_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@ -455,12 +272,6 @@ static struct platform_device *sh7734_devices[] __initdata = {
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
-       &tmu6_device,
-       &tmu7_device,
-       &tmu8_device,
        &rtc_device,
 };
 
@@ -474,12 +285,6 @@ static struct platform_device *sh7734_early_devices[] __initdata = {
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
-       &tmu6_device,
-       &tmu7_device,
-       &tmu8_device,
 };
 
 void __init plat_early_device_setup(void)
index e43e5db539139b55cc058ca6aaecdf51bad98746..7b24ec4b409aef03df85a72372ebec4d4d11757b 100644 (file)
@@ -87,25 +87,17 @@ static struct platform_device scif4_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 3,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xfe430008,
-               .end    = 0xfe430013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x580),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xfe430000, 0x20),
+       DEFINE_RES_IRQ(evt2irq(0x580)),
+       DEFINE_RES_IRQ(evt2irq(0x5a0)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -114,34 +106,6 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xfe430014,
-               .end    = 0xfe43001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
 static struct resource spi0_resources[] = {
        [0] = {
                .start  = 0xfe002000,
@@ -782,7 +746,6 @@ static struct platform_device *sh7757_devices[] __initdata = {
        &scif3_device,
        &scif4_device,
        &tmu0_device,
-       &tmu1_device,
        &dma0_device,
        &dma1_device,
        &dma2_device,
@@ -806,7 +769,6 @@ static struct platform_device *sh7757_early_devices[] __initdata = {
        &scif3_device,
        &scif4_device,
        &tmu0_device,
-       &tmu1_device,
 };
 
 void __init plat_early_device_setup(void)
index 5eebbd7f4c21926df78e7cbad53f32db255cb036..5a47d670ddecae12577fa9176be06243c9e68c94 100644 (file)
@@ -158,25 +158,18 @@ static struct platform_device usbf_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x580),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x580)),
+       DEFINE_RES_IRQ(evt2irq(0x5a0)),
+       DEFINE_RES_IRQ(evt2irq(0x5c0)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -186,25 +179,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5a0),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd88000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0xe00)),
+       DEFINE_RES_IRQ(evt2irq(0xe20)),
+       DEFINE_RES_IRQ(evt2irq(0xe40)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -213,124 +199,12 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffd88008,
-               .end    = 0xffd88013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffd88014,
-               .end    = 0xffd8801f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe20),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffd88020,
-               .end    = 0xffd8802b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe40),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 static struct platform_device *sh7763_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif2_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
        &rtc_device,
        &usb_ohci_device,
        &usbf_device,
@@ -349,10 +223,6 @@ static struct platform_device *sh7763_early_devices[] __initdata = {
        &scif2_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 void __init plat_early_device_setup(void)
index e1ba8cb74e5ade17fd74b5b551964cbd4ff3799e..e9b532a76c378c9a5043a48d618f17974489d182 100644 (file)
@@ -226,25 +226,18 @@ static struct platform_device scif9_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -254,25 +247,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd81000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x460)),
+       DEFINE_RES_IRQ(evt2irq(0x480)),
+       DEFINE_RES_IRQ(evt2irq(0x4a0)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -282,24 +268,18 @@ static struct platform_device tmu1_device = {
 };
 
 static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
+       .channels_mask = 7,
 };
 
 static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd82000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x4c0)),
+       DEFINE_RES_IRQ(evt2irq(0x4e0)),
+       DEFINE_RES_IRQ(evt2irq(0x500)),
 };
 
 static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 2,
        .dev = {
                .platform_data  = &tmu2_platform_data,
@@ -308,168 +288,6 @@ static struct platform_device tmu2_device = {
        .num_resources  = ARRAY_SIZE(tmu2_resources),
 };
 
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffd81008,
-               .end    = 0xffd81013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x460),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffd81014,
-               .end    = 0xffd8101f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x480),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffd81020,
-               .end    = 0xffd8102f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
-static struct sh_timer_config tmu6_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu6_resources[] = {
-       [0] = {
-               .start  = 0xffd82008,
-               .end    = 0xffd82013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu6_device = {
-       .name           = "sh_tmu",
-       .id             = 6,
-       .dev = {
-               .platform_data  = &tmu6_platform_data,
-       },
-       .resource       = tmu6_resources,
-       .num_resources  = ARRAY_SIZE(tmu6_resources),
-};
-
-static struct sh_timer_config tmu7_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu7_resources[] = {
-       [0] = {
-               .start  = 0xffd82014,
-               .end    = 0xffd8201f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4e0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu7_device = {
-       .name           = "sh_tmu",
-       .id             = 7,
-       .dev = {
-               .platform_data  = &tmu7_platform_data,
-       },
-       .resource       = tmu7_resources,
-       .num_resources  = ARRAY_SIZE(tmu7_resources),
-};
-
-static struct sh_timer_config tmu8_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu8_resources[] = {
-       [0] = {
-               .start  = 0xffd82020,
-               .end    = 0xffd8202b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x500),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu8_device = {
-       .name           = "sh_tmu",
-       .id             = 8,
-       .dev = {
-               .platform_data  = &tmu8_platform_data,
-       },
-       .resource       = tmu8_resources,
-       .num_resources  = ARRAY_SIZE(tmu8_resources),
-};
-
 static struct platform_device *sh7770_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
@@ -484,12 +302,6 @@ static struct platform_device *sh7770_devices[] __initdata = {
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
-       &tmu6_device,
-       &tmu7_device,
-       &tmu8_device,
 };
 
 static int __init sh7770_devices_setup(void)
@@ -513,12 +325,6 @@ static struct platform_device *sh7770_early_devices[] __initdata = {
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
-       &tmu6_device,
-       &tmu7_device,
-       &tmu8_device,
 };
 
 void __init plat_early_device_setup(void)
index 668e54bafa863fe21525b7fb519792818ac84d2f..3ee7dd9b3a6587ceceb627b273d55c5ef687fb9f 100644 (file)
@@ -62,25 +62,18 @@ static struct platform_device scif1_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x580),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x580)),
+       DEFINE_RES_IRQ(evt2irq(0x5a0)),
+       DEFINE_RES_IRQ(evt2irq(0x5c0)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -90,25 +83,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5a0),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffdc0000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0xe00)),
+       DEFINE_RES_IRQ(evt2irq(0xe20)),
+       DEFINE_RES_IRQ(evt2irq(0xe40)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -117,114 +103,6 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffdc0008,
-               .end    = 0xffdc0013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffdc0014,
-               .end    = 0xffdc001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe20),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffdc0020,
-               .end    = 0xffdc002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe40),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 static struct resource rtc_resources[] = {
        [0] = {
                .start  = 0xffe80000,
@@ -386,10 +264,6 @@ static struct platform_device *sh7780_devices[] __initdata = {
        &scif1_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
        &rtc_device,
        &dma0_device,
        &dma1_device,
@@ -407,10 +281,6 @@ static struct platform_device *sh7780_early_devices[] __initdata = {
        &scif1_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 void __init plat_early_device_setup(void)
index 4aa67914020935f82c4c37b352b2155fbcc75dea..c72d5a5d09959637fc004b0b3ccc16d2ec05f8a6 100644 (file)
@@ -152,25 +152,18 @@ static struct platform_device scif5_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x580),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x580)),
+       DEFINE_RES_IRQ(evt2irq(0x5a0)),
+       DEFINE_RES_IRQ(evt2irq(0x5c0)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -180,25 +173,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5a0),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffdc0000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0xe00)),
+       DEFINE_RES_IRQ(evt2irq(0xe20)),
+       DEFINE_RES_IRQ(evt2irq(0xe40)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -207,114 +193,6 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x5c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffdc0008,
-               .end    = 0xffdc0013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe00),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffdc0014,
-               .end    = 0xffdc001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe20),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffdc0020,
-               .end    = 0xffdc002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0xe40),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 /* DMA */
 static const struct sh_dmae_channel sh7785_dmae0_channels[] = {
        {
@@ -460,10 +338,6 @@ static struct platform_device *sh7785_devices[] __initdata = {
        &scif5_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
        &dma0_device,
        &dma1_device,
 };
@@ -484,10 +358,6 @@ static struct platform_device *sh7785_early_devices[] __initdata = {
        &scif5_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 void __init plat_early_device_setup(void)
index 5d619a551a3b6142d3b5ac761b694995a172b04f..479e79bdd3d07a48bc4de4bade427dfa7923b879 100644 (file)
@@ -175,25 +175,18 @@ static struct platform_device scif5_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffd80008,
-               .end    = 0xffd80013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffd80000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -203,25 +196,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffd80014,
-               .end    = 0xffd8001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffda0000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x480)),
+       DEFINE_RES_IRQ(evt2irq(0x4a0)),
+       DEFINE_RES_IRQ(evt2irq(0x4c0)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -231,24 +217,18 @@ static struct platform_device tmu1_device = {
 };
 
 static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
+       .channels_mask = 7,
 };
 
 static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffd80020,
-               .end    = 0xffd8002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffdc0000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x7a0)),
+       DEFINE_RES_IRQ(evt2irq(0x7a0)),
+       DEFINE_RES_IRQ(evt2irq(0x7a0)),
 };
 
 static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 2,
        .dev = {
                .platform_data  = &tmu2_platform_data,
@@ -258,24 +238,18 @@ static struct platform_device tmu2_device = {
 };
 
 static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
+       .channels_mask = 7,
 };
 
 static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffda0008,
-               .end    = 0xffda0013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x480),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffde0000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x7c0)),
+       DEFINE_RES_IRQ(evt2irq(0x7c0)),
+       DEFINE_RES_IRQ(evt2irq(0x7c0)),
 };
 
 static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 3,
        .dev = {
                .platform_data  = &tmu3_platform_data,
@@ -284,222 +258,6 @@ static struct platform_device tmu3_device = {
        .num_resources  = ARRAY_SIZE(tmu3_resources),
 };
 
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffda0014,
-               .end    = 0xffda001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffda0020,
-               .end    = 0xffda002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
-static struct sh_timer_config tmu6_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu6_resources[] = {
-       [0] = {
-               .start  = 0xffdc0008,
-               .end    = 0xffdc0013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu6_device = {
-       .name           = "sh_tmu",
-       .id             = 6,
-       .dev = {
-               .platform_data  = &tmu6_platform_data,
-       },
-       .resource       = tmu6_resources,
-       .num_resources  = ARRAY_SIZE(tmu6_resources),
-};
-
-static struct sh_timer_config tmu7_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu7_resources[] = {
-       [0] = {
-               .start  = 0xffdc0014,
-               .end    = 0xffdc001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu7_device = {
-       .name           = "sh_tmu",
-       .id             = 7,
-       .dev = {
-               .platform_data  = &tmu7_platform_data,
-       },
-       .resource       = tmu7_resources,
-       .num_resources  = ARRAY_SIZE(tmu7_resources),
-};
-
-static struct sh_timer_config tmu8_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu8_resources[] = {
-       [0] = {
-               .start  = 0xffdc0020,
-               .end    = 0xffdc002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu8_device = {
-       .name           = "sh_tmu",
-       .id             = 8,
-       .dev = {
-               .platform_data  = &tmu8_platform_data,
-       },
-       .resource       = tmu8_resources,
-       .num_resources  = ARRAY_SIZE(tmu8_resources),
-};
-
-static struct sh_timer_config tmu9_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu9_resources[] = {
-       [0] = {
-               .start  = 0xffde0008,
-               .end    = 0xffde0013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu9_device = {
-       .name           = "sh_tmu",
-       .id             = 9,
-       .dev = {
-               .platform_data  = &tmu9_platform_data,
-       },
-       .resource       = tmu9_resources,
-       .num_resources  = ARRAY_SIZE(tmu9_resources),
-};
-
-static struct sh_timer_config tmu10_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu10_resources[] = {
-       [0] = {
-               .start  = 0xffde0014,
-               .end    = 0xffde001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu10_device = {
-       .name           = "sh_tmu",
-       .id             = 10,
-       .dev = {
-               .platform_data  = &tmu10_platform_data,
-       },
-       .resource       = tmu10_resources,
-       .num_resources  = ARRAY_SIZE(tmu10_resources),
-};
-
-static struct sh_timer_config tmu11_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu11_resources[] = {
-       [0] = {
-               .start  = 0xffde0020,
-               .end    = 0xffde002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x7c0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu11_device = {
-       .name           = "sh_tmu",
-       .id             = 11,
-       .dev = {
-               .platform_data  = &tmu11_platform_data,
-       },
-       .resource       = tmu11_resources,
-       .num_resources  = ARRAY_SIZE(tmu11_resources),
-};
-
 static const struct sh_dmae_channel dmac0_channels[] = {
        {
                .offset = 0,
@@ -641,15 +399,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = {
        &tmu0_device,
        &tmu1_device,
        &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
-       &tmu6_device,
-       &tmu7_device,
-       &tmu8_device,
-       &tmu9_device,
-       &tmu10_device,
-       &tmu11_device,
 };
 
 static struct platform_device *sh7786_devices[] __initdata = {
index 0856bcbb1da0df740ca0ba33ea7f552abf47b7af..a78c5feb4e3bf44c07ca0eaaae38af957ebd8918 100644 (file)
@@ -100,25 +100,18 @@ static struct platform_device scif2_device = {
 };
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = 0xffc10008,
-               .end    = 0xffc10013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x400),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffc10000, 0x30),
+       DEFINE_RES_IRQ(evt2irq(0x400)),
+       DEFINE_RES_IRQ(evt2irq(0x420)),
+       DEFINE_RES_IRQ(evt2irq(0x440)),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -128,25 +121,18 @@ static struct platform_device tmu0_device = {
 };
 
 static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = 0xffc10014,
-               .end    = 0xffc1001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x420),
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(0xffc20000, 0x2c),
+       DEFINE_RES_IRQ(evt2irq(0x460)),
+       DEFINE_RES_IRQ(evt2irq(0x480)),
+       DEFINE_RES_IRQ(evt2irq(0x4a0)),
 };
 
 static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 1,
        .dev = {
                .platform_data  = &tmu1_platform_data,
@@ -155,124 +141,12 @@ static struct platform_device tmu1_device = {
        .num_resources  = ARRAY_SIZE(tmu1_resources),
 };
 
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = 0xffc10020,
-               .end    = 0xffc1002f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x440),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
-static struct sh_timer_config tmu3_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-};
-
-static struct resource tmu3_resources[] = {
-       [0] = {
-               .start  = 0xffc20008,
-               .end    = 0xffc20013,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x460),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu3_device = {
-       .name           = "sh_tmu",
-       .id             = 3,
-       .dev = {
-               .platform_data  = &tmu3_platform_data,
-       },
-       .resource       = tmu3_resources,
-       .num_resources  = ARRAY_SIZE(tmu3_resources),
-};
-
-static struct sh_timer_config tmu4_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-};
-
-static struct resource tmu4_resources[] = {
-       [0] = {
-               .start  = 0xffc20014,
-               .end    = 0xffc2001f,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x480),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu4_device = {
-       .name           = "sh_tmu",
-       .id             = 4,
-       .dev = {
-               .platform_data  = &tmu4_platform_data,
-       },
-       .resource       = tmu4_resources,
-       .num_resources  = ARRAY_SIZE(tmu4_resources),
-};
-
-static struct sh_timer_config tmu5_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu5_resources[] = {
-       [0] = {
-               .start  = 0xffc20020,
-               .end    = 0xffc2002b,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = evt2irq(0x4a0),
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu5_device = {
-       .name           = "sh_tmu",
-       .id             = 5,
-       .dev = {
-               .platform_data  = &tmu5_platform_data,
-       },
-       .resource       = tmu5_resources,
-       .num_resources  = ARRAY_SIZE(tmu5_resources),
-};
-
 static struct platform_device *shx3_early_devices[] __initdata = {
        &scif0_device,
        &scif1_device,
        &scif2_device,
        &tmu0_device,
        &tmu1_device,
-       &tmu2_device,
-       &tmu3_device,
-       &tmu4_device,
-       &tmu5_device,
 };
 
 static int __init shx3_devices_setup(void)
index 14d68213d16bdf6412d41c8b91f2f819f1ecc58a..1bf0b2cf665253c48b3d9d947664e54df418f7e5 100644 (file)
@@ -71,30 +71,20 @@ static struct platform_device rtc_device = {
 
 #define        TMU_BLOCK_OFF   0x01020000
 #define TMU_BASE       PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
-#define TMU0_BASE      (TMU_BASE + 0x8 + (0xc * 0x0))
-#define TMU1_BASE      (TMU_BASE + 0x8 + (0xc * 0x1))
-#define TMU2_BASE      (TMU_BASE + 0x8 + (0xc * 0x2))
 
 static struct sh_timer_config tmu0_platform_data = {
-       .channel_offset = 0x04,
-       .timer_bit = 0,
-       .clockevent_rating = 200,
+       .channels_mask = 7,
 };
 
 static struct resource tmu0_resources[] = {
-       [0] = {
-               .start  = TMU0_BASE,
-               .end    = TMU0_BASE + 0xc - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_TUNI0,
-               .flags  = IORESOURCE_IRQ,
-       },
+       DEFINE_RES_MEM(TMU_BASE, 0x30),
+       DEFINE_RES_IRQ(IRQ_TUNI0),
+       DEFINE_RES_IRQ(IRQ_TUNI1),
+       DEFINE_RES_IRQ(IRQ_TUNI2),
 };
 
 static struct platform_device tmu0_device = {
-       .name           = "sh_tmu",
+       .name           = "sh-tmu",
        .id             = 0,
        .dev = {
                .platform_data  = &tmu0_platform_data,
@@ -103,66 +93,9 @@ static struct platform_device tmu0_device = {
        .num_resources  = ARRAY_SIZE(tmu0_resources),
 };
 
-static struct sh_timer_config tmu1_platform_data = {
-       .channel_offset = 0x10,
-       .timer_bit = 1,
-       .clocksource_rating = 200,
-};
-
-static struct resource tmu1_resources[] = {
-       [0] = {
-               .start  = TMU1_BASE,
-               .end    = TMU1_BASE + 0xc - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_TUNI1,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu1_device = {
-       .name           = "sh_tmu",
-       .id             = 1,
-       .dev = {
-               .platform_data  = &tmu1_platform_data,
-       },
-       .resource       = tmu1_resources,
-       .num_resources  = ARRAY_SIZE(tmu1_resources),
-};
-
-static struct sh_timer_config tmu2_platform_data = {
-       .channel_offset = 0x1c,
-       .timer_bit = 2,
-};
-
-static struct resource tmu2_resources[] = {
-       [0] = {
-               .start  = TMU2_BASE,
-               .end    = TMU2_BASE + 0xc - 1,
-               .flags  = IORESOURCE_MEM,
-       },
-       [1] = {
-               .start  = IRQ_TUNI2,
-               .flags  = IORESOURCE_IRQ,
-       },
-};
-
-static struct platform_device tmu2_device = {
-       .name           = "sh_tmu",
-       .id             = 2,
-       .dev = {
-               .platform_data  = &tmu2_platform_data,
-       },
-       .resource       = tmu2_resources,
-       .num_resources  = ARRAY_SIZE(tmu2_resources),
-};
-
 static struct platform_device *sh5_early_devices[] __initdata = {
        &scif0_device,
        &tmu0_device,
-       &tmu1_device,
-       &tmu2_device,
 };
 
 static struct platform_device *sh5_devices[] __initdata = {