aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2014-05-21 17:05:58 -0400
committerOlof Johansson <olof@lixom.net>2014-05-21 17:05:58 -0400
commit82711e7b46d80a6fd946166bd012b052d53b8ff4 (patch)
tree0dbfdd45542ab318e733a91724620ce9a6f79617
parent91f0f06ccbd2a0648160aad6783b7da92e2880d7 (diff)
parentc17fcfbcc0f6b4f3cae761149e1a6108dd6750e7 (diff)
Merge tag 'renesas-clock-cleanup2-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/boards
Merge "Renesas SoC Clock Cleanups for v3.16" from Simon Horman: Work from Laurent Pinchart to switch all Renesas platforms to the new style CMT, MTU2 and TMU device platform data. This is in preparation for initialising these devices using DT on ARM Based Renesas SoCs. * tag 'renesas-clock-cleanup2-for-v3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: r7s72100: Switch to new style MTU2 device sh: Switch to new style MTU2 device ARM: shmobile: r8a7779: Switch to new style TMU device ARM: shmobile: r8a7778: Switch to new style TMU device ARM: shmobile: r8a7740: Switch to new style TMU device ARM: shmobile: sh73a0: Switch to new style TMU device ARM: shmobile: sh7372: Switch to new style TMU device sh: Switch to new style TMU device ARM: shmobile: r8a7791: Switch to new style CMT device ARM: shmobile: r8a7790: Switch to new style CMT device ARM: shmobile: r8a7740: Switch to new style CMT device ARM: shmobile: r8a73a4: Switch to new style CMT device ARM: shmobile: sh73a0: Switch to new style CMT device ARM: shmobile: sh7372: Switch to new style CMT device sh: Switch to new style CMT device Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c2
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r7s72100.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a73a4.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7740.c10
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7778.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7779.c4
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7790.c2
-rw-r--r--arch/arm/mach-shmobile/clock-r8a7791.c2
-rw-r--r--arch/arm/mach-shmobile/clock-sh7372.c9
-rw-r--r--arch/arm/mach-shmobile/clock-sh73a0.c5
-rw-r--r--arch/arm/mach-shmobile/setup-r7s72100.c26
-rw-r--r--arch/arm/mach-shmobile/setup-r8a73a4.c17
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7740.c133
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7778.c28
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7779.c66
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7790.c17
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c17
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c89
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c92
-rw-r--r--arch/sh/kernel/cpu/clock-cpg.c10
-rw-r--r--arch/sh/kernel/cpu/sh2/setup-sh7619.c66
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7264.c4
-rw-r--r--arch/sh/kernel/cpu/sh2a/clock-sh7269.c4
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-mxg.c98
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7201.c98
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7203.c133
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7206.c164
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7264.c140
-rw-r--r--arch/sh/kernel/cpu/sh2a/setup-sh7269.c133
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7705.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh770x.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7710.c78
-rw-r--r--arch/sh/kernel/cpu/sh3/setup-sh7720.c228
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh4-202.c78
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7750.c138
-rw-r--r--arch/sh/kernel/cpu/sh4/setup-sh7760.c78
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7343.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7366.c2
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7722.c6
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7723.c10
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7724.c10
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7734.c12
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7757.c4
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7786.c16
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-shx3.c8
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7343.c96
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7366.c96
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7722.c96
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7723.c172
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7724.c173
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7734.c235
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7757.c48
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7763.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7770.c230
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7780.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7785.c154
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-sh7786.c299
-rw-r--r--arch/sh/kernel/cpu/sh4a/setup-shx3.c150
-rw-r--r--arch/sh/kernel/cpu/sh5/setup-sh5.c79
61 files changed, 553 insertions, 3796 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index 941f8b394e84..bd9093221f76 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -86,7 +86,7 @@ static void __init koelsch_add_du_device(void)
86 * devices until they get moved to DT. 86 * devices until they get moved to DT.
87 */ 87 */
88static const struct clk_name clk_names[] __initconst = { 88static const struct clk_name clk_names[] __initconst = {
89 { "cmt0", NULL, "sh_cmt.0" }, 89 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
90 { "scifa0", NULL, "sh-sci.0" }, 90 { "scifa0", NULL, "sh-sci.0" },
91 { "scifa1", NULL, "sh-sci.1" }, 91 { "scifa1", NULL, "sh-sci.1" },
92 { "scifb0", NULL, "sh-sci.2" }, 92 { "scifb0", NULL, "sh-sci.2" },
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 1eb48cffb4c5..1bca2748aa7c 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -90,7 +90,7 @@ static void __init lager_add_du_device(void)
90 * devices until they get moved to DT. 90 * devices until they get moved to DT.
91 */ 91 */
92static const struct clk_name clk_names[] __initconst = { 92static const struct clk_name clk_names[] __initconst = {
93 { "cmt0", NULL, "sh_cmt.0" }, 93 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
94 { "scifa0", NULL, "sh-sci.0" }, 94 { "scifa0", NULL, "sh-sci.0" },
95 { "scifa1", NULL, "sh-sci.1" }, 95 { "scifa1", NULL, "sh-sci.1" },
96 { "scifb0", NULL, "sh-sci.2" }, 96 { "scifb0", NULL, "sh-sci.2" },
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index bee0073c9b64..644f1c2a96c7 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -204,7 +204,6 @@ static struct clk_lookup lookups[] = {
204 CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]), 204 CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
205 CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]), 205 CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
206 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]), 206 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]),
207 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
208 207
209 /* ICK */ 208 /* ICK */
210 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]), 209 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]),
@@ -215,6 +214,7 @@ static struct clk_lookup lookups[] = {
215 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), 214 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
216 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), 215 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
217 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), 216 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
217 CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP33]),
218}; 218};
219 219
220void __init r7s72100_clock_init(void) 220void __init r7s72100_clock_init(void)
diff --git a/arch/arm/mach-shmobile/clock-r8a73a4.c b/arch/arm/mach-shmobile/clock-r8a73a4.c
index 7348d58f500e..b5bc22c6a858 100644
--- a/arch/arm/mach-shmobile/clock-r8a73a4.c
+++ b/arch/arm/mach-shmobile/clock-r8a73a4.c
@@ -597,7 +597,7 @@ static struct clk_lookup lookups[] = {
597 CLKDEV_DEV_ID("e6560000.i2c", &mstp_clks[MSTP317]), 597 CLKDEV_DEV_ID("e6560000.i2c", &mstp_clks[MSTP317]),
598 CLKDEV_DEV_ID("e6500000.i2c", &mstp_clks[MSTP318]), 598 CLKDEV_DEV_ID("e6500000.i2c", &mstp_clks[MSTP318]),
599 CLKDEV_DEV_ID("e6510000.i2c", &mstp_clks[MSTP323]), 599 CLKDEV_DEV_ID("e6510000.i2c", &mstp_clks[MSTP323]),
600 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), 600 CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.1", &mstp_clks[MSTP329]),
601 CLKDEV_DEV_ID("e60b0000.i2c", &mstp_clks[MSTP409]), 601 CLKDEV_DEV_ID("e60b0000.i2c", &mstp_clks[MSTP409]),
602 CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP410]), 602 CLKDEV_DEV_ID("e6540000.i2c", &mstp_clks[MSTP410]),
603 CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP411]), 603 CLKDEV_DEV_ID("e6530000.i2c", &mstp_clks[MSTP411]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7740.c b/arch/arm/mach-shmobile/clock-r8a7740.c
index dd989f93498f..2c1044a55769 100644
--- a/arch/arm/mach-shmobile/clock-r8a7740.c
+++ b/arch/arm/mach-shmobile/clock-r8a7740.c
@@ -548,15 +548,9 @@ static struct clk_lookup lookups[] = {
548 548
549 /* MSTP32 clocks */ 549 /* MSTP32 clocks */
550 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]), 550 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.0", &mstp_clks[MSTP100]),
551 CLKDEV_DEV_ID("sh_tmu.3", &mstp_clks[MSTP111]),
552 CLKDEV_DEV_ID("sh_tmu.4", &mstp_clks[MSTP111]),
553 CLKDEV_DEV_ID("sh_tmu.5", &mstp_clks[MSTP111]),
554 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), 551 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]),
555 CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]), 552 CLKDEV_DEV_ID("fff20000.i2c", &mstp_clks[MSTP116]),
556 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), 553 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]),
557 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]),
558 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]),
559 CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP125]),
560 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), 554 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]),
561 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]), 555 CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[MSTP128]),
562 556
@@ -583,7 +577,6 @@ static struct clk_lookup lookups[] = {
583 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]), 577 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP230]),
584 CLKDEV_DEV_ID("e6cc0000.sci", &mstp_clks[MSTP230]), 578 CLKDEV_DEV_ID("e6cc0000.sci", &mstp_clks[MSTP230]),
585 579
586 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]),
587 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), 580 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]),
588 CLKDEV_DEV_ID("fe1f0000.sound", &mstp_clks[MSTP328]), 581 CLKDEV_DEV_ID("fe1f0000.sound", &mstp_clks[MSTP328]),
589 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]), 582 CLKDEV_DEV_ID("i2c-sh_mobile.1", &mstp_clks[MSTP323]),
@@ -604,6 +597,9 @@ static struct clk_lookup lookups[] = {
604 CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]), 597 CLKDEV_DEV_ID("e6870000.sd", &mstp_clks[MSTP415]),
605 598
606 /* ICK */ 599 /* ICK */
600 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP111]),
601 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]),
602 CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]),
607 CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]), 603 CLKDEV_ICK_ID("host", "renesas_usbhs", &mstp_clks[MSTP416]),
608 CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]), 604 CLKDEV_ICK_ID("func", "renesas_usbhs", &mstp_clks[MSTP407]),
609 CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]), 605 CLKDEV_ICK_ID("phy", "renesas_usbhs", &mstp_clks[MSTP406]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c
index 6609beb9b9b4..13f8f3ab8840 100644
--- a/arch/arm/mach-shmobile/clock-r8a7778.c
+++ b/arch/arm/mach-shmobile/clock-r8a7778.c
@@ -207,8 +207,6 @@ static struct clk_lookup lookups[] = {
207 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ 207 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */
208 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ 208 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */
209 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ 209 CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */
210 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */
211 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */
212 CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ 210 CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */
213 CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ 211 CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */
214 CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ 212 CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */
@@ -239,6 +237,8 @@ static struct clk_lookup lookups[] = {
239 CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]), 237 CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]),
240 CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]), 238 CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]),
241 CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]), 239 CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]),
240 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
241 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
242}; 242};
243 243
244void __init r8a7778_clock_init(void) 244void __init r8a7778_clock_init(void)
diff --git a/arch/arm/mach-shmobile/clock-r8a7779.c b/arch/arm/mach-shmobile/clock-r8a7779.c
index 8e403ae0c7b2..a13298bd37a8 100644
--- a/arch/arm/mach-shmobile/clock-r8a7779.c
+++ b/arch/arm/mach-shmobile/clock-r8a7779.c
@@ -173,9 +173,7 @@ static struct clk_lookup lookups[] = {
173 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */ 173 CLKDEV_DEV_ID("ohci-platform.1", &mstp_clks[MSTP101]), /* USB OHCI port2 */
174 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */ 174 CLKDEV_DEV_ID("ehci-platform.0", &mstp_clks[MSTP100]), /* USB EHCI port0/1 */
175 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */ 175 CLKDEV_DEV_ID("ohci-platform.0", &mstp_clks[MSTP100]), /* USB OHCI port0/1 */
176 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ 176 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]), /* TMU0 */
177 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP016]), /* TMU01 */
178 CLKDEV_DEV_ID("sh_tmu.2", &mstp_clks[MSTP016]), /* TMU02 */
179 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */ 177 CLKDEV_DEV_ID("i2c-rcar.0", &mstp_clks[MSTP030]), /* I2C0 */
180 CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */ 178 CLKDEV_DEV_ID("ffc70000.i2c", &mstp_clks[MSTP030]), /* I2C0 */
181 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */ 179 CLKDEV_DEV_ID("i2c-rcar.1", &mstp_clks[MSTP029]), /* I2C1 */
diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index a936ae7de083..296a057109e4 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -357,7 +357,6 @@ static struct clk_lookup lookups[] = {
357 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]), 357 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]),
358 CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]), 358 CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]),
359 CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), 359 CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]),
360 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]),
361 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), 360 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
362 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]), 361 CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]),
363 CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]), 362 CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]),
@@ -367,6 +366,7 @@ static struct clk_lookup lookups[] = {
367 CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]), 366 CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]),
368 367
369 /* ICK */ 368 /* ICK */
369 CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.0", &mstp_clks[MSTP124]),
370 CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]), 370 CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]),
371 CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7790", &mstp_clks[MSTP726]), 371 CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7790", &mstp_clks[MSTP726]),
372 CLKDEV_ICK_ID("lvds.1", "rcar-du-r8a7790", &mstp_clks[MSTP725]), 372 CLKDEV_ICK_ID("lvds.1", "rcar-du-r8a7790", &mstp_clks[MSTP725]),
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c
index 3b26c7eee873..e2fdfcc14436 100644
--- a/arch/arm/mach-shmobile/clock-r8a7791.c
+++ b/arch/arm/mach-shmobile/clock-r8a7791.c
@@ -264,7 +264,7 @@ static struct clk_lookup lookups[] = {
264 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), 264 CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]),
265 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]), 265 CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]),
266 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), 266 CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]),
267 CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), 267 CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.0", &mstp_clks[MSTP124]),
268 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), 268 CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]),
269 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), 269 CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
270 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]), 270 CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]),
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c
index 28489978b09c..d16d9ca7f79e 100644
--- a/arch/arm/mach-shmobile/clock-sh7372.c
+++ b/arch/arm/mach-shmobile/clock-sh7372.c
@@ -515,8 +515,6 @@ static struct clk_lookup lookups[] = {
515 CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */ 515 CLKDEV_DEV_ID("uio_pdrv_genirq.1", &mstp_clks[MSTP128]), /* VEU0 */
516 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU */ 516 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU */
517 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2 */ 517 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2 */
518 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
519 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
520 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */ 518 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX0 */
521 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */ 519 CLKDEV_DEV_ID("sh_mobile_lcdc_fb.1", &mstp_clks[MSTP117]), /* LCDC1 */
522 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */ 520 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* IIC0 */
@@ -565,10 +563,7 @@ static struct clk_lookup lookups[] = {
565 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ 563 CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */
566 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ 564 CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */
567 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ 565 CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */
568 CLKDEV_DEV_ID("sh_cmt.4", &mstp_clks[MSTP405]), /* CMT4 */
569 CLKDEV_DEV_ID("sh_cmt.3", &mstp_clks[MSTP404]), /* CMT3 */
570 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ 566 CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */
571 CLKDEV_DEV_ID("sh_cmt.2", &mstp_clks[MSTP400]), /* CMT2 */
572 567
573 /* ICK */ 568 /* ICK */
574 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]), 569 CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSIT]),
@@ -580,7 +575,11 @@ static struct clk_lookup lookups[] = {
580 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]), 575 CLKDEV_ICK_ID("ick", "sh-mobile-hdmi", &div6_reparent_clks[DIV6_HDMI]),
581 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]), 576 CLKDEV_ICK_ID("icka", "sh_fsi2", &div6_reparent_clks[DIV6_FSIA]),
582 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]), 577 CLKDEV_ICK_ID("ickb", "sh_fsi2", &div6_reparent_clks[DIV6_FSIB]),
578 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */
583 CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]), 579 CLKDEV_ICK_ID("spu2", "sh_fsi2", &mstp_clks[MSTP223]),
580 CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.4", &mstp_clks[MSTP405]), /* CMT4 */
581 CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.3", &mstp_clks[MSTP404]), /* CMT3 */
582 CLKDEV_ICK_ID("fck", "sh-cmt-32-fast.2", &mstp_clks[MSTP400]), /* CMT2 */
584 CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]), 583 CLKDEV_ICK_ID("diva", "sh_fsi2", &fsidivs[FSIDIV_A]),
585 CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]), 584 CLKDEV_ICK_ID("divb", "sh_fsi2", &fsidivs[FSIDIV_B]),
586 CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk), 585 CLKDEV_ICK_ID("xcka", "sh_fsi2", &fsiack_clk),
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c
index 23edf8360c27..0d9cd1fe0212 100644
--- a/arch/arm/mach-shmobile/clock-sh73a0.c
+++ b/arch/arm/mach-shmobile/clock-sh73a0.c
@@ -633,8 +633,6 @@ static struct clk_lookup lookups[] = {
633 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */ 633 CLKDEV_DEV_ID("sh-mobile-csi2.1", &mstp_clks[MSTP128]), /* CSI2-RX1 */
634 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */ 634 CLKDEV_DEV_ID("sh_mobile_ceu.0", &mstp_clks[MSTP127]), /* CEU0 */
635 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */ 635 CLKDEV_DEV_ID("sh-mobile-csi2.0", &mstp_clks[MSTP126]), /* CSI2-RX0 */
636 CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP125]), /* TMU00 */
637 CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP125]), /* TMU01 */
638 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */ 636 CLKDEV_DEV_ID("sh-mipi-dsi.0", &mstp_clks[MSTP118]), /* DSITX */
639 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */ 637 CLKDEV_DEV_ID("i2c-sh_mobile.0", &mstp_clks[MSTP116]), /* I2C0 */
640 CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */ 638 CLKDEV_DEV_ID("e6820000.i2c", &mstp_clks[MSTP116]), /* I2C0 */
@@ -650,7 +648,6 @@ static struct clk_lookup lookups[] = {
650 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */ 648 CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP201]), /* SCIFA3 */
651 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */ 649 CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP200]), /* SCIFA4 */
652 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */ 650 CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP331]), /* SCIFA6 */
653 CLKDEV_DEV_ID("sh_cmt.10", &mstp_clks[MSTP329]), /* CMT10 */
654 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */ 651 CLKDEV_DEV_ID("sh_fsi2", &mstp_clks[MSTP328]), /* FSI */
655 CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */ 652 CLKDEV_DEV_ID("ec230000.sound", &mstp_clks[MSTP328]), /* FSI */
656 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */ 653 CLKDEV_DEV_ID("sh_irda.0", &mstp_clks[MSTP325]), /* IrDA */
@@ -683,6 +680,8 @@ static struct clk_lookup lookups[] = {
683 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), 680 CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
684 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk), 681 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
685 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk), 682 CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
683 CLKDEV_ICK_ID("fck", "sh-cmt-48.1", &mstp_clks[MSTP329]), /* CMT1 */
684 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP125]), /* TMU0 */
686}; 685};
687 686
688void __init sh73a0_clock_init(void) 687void __init sh73a0_clock_init(void)
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index 9c0b3a9d5f7a..545db1512480 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -62,24 +62,16 @@ R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
62 sizeof(scif##index##_platform_data)) 62 sizeof(scif##index##_platform_data))
63 63
64 64
65static struct sh_timer_config mtu2_0_platform_data __initdata = { 65static struct resource mtu2_resources[] __initdata = {
66 .name = "MTU2_0", 66 DEFINE_RES_MEM(0xfcff0000, 0x400),
67 .timer_bit = 0, 67 DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
68 .channel_offset = -0x80,
69 .clockevent_rating = 200,
70}; 68};
71 69
72static struct resource mtu2_0_resources[] __initdata = { 70#define r7s72100_register_mtu2() \
73 DEFINE_RES_MEM(0xfcff0300, 0x27), 71 platform_device_register_resndata(&platform_bus, "sh-mtu2", \
74 DEFINE_RES_IRQ(gic_iid(139)), /* MTU2 TGI0A */ 72 -1, mtu2_resources, \
75}; 73 ARRAY_SIZE(mtu2_resources), \
76 74 NULL, 0)
77#define r7s72100_register_mtu2(idx) \
78 platform_device_register_resndata(&platform_bus, "sh_mtu2", \
79 idx, mtu2_##idx##_resources, \
80 ARRAY_SIZE(mtu2_##idx##_resources), \
81 &mtu2_##idx##_platform_data, \
82 sizeof(struct sh_timer_config))
83 75
84void __init r7s72100_add_dt_devices(void) 76void __init r7s72100_add_dt_devices(void)
85{ 77{
@@ -91,7 +83,7 @@ void __init r7s72100_add_dt_devices(void)
91 r7s72100_register_scif(5); 83 r7s72100_register_scif(5);
92 r7s72100_register_scif(6); 84 r7s72100_register_scif(6);
93 r7s72100_register_scif(7); 85 r7s72100_register_scif(7);
94 r7s72100_register_mtu2(0); 86 r7s72100_register_mtu2();
95} 87}
96 88
97void __init r7s72100_init_early(void) 89void __init r7s72100_init_early(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a73a4.c b/arch/arm/mach-shmobile/setup-r8a73a4.c
index cd36f8078325..9333770cfac2 100644
--- a/arch/arm/mach-shmobile/setup-r8a73a4.c
+++ b/arch/arm/mach-shmobile/setup-r8a73a4.c
@@ -169,20 +169,17 @@ static const struct resource thermal0_resources[] = {
169 thermal0_resources, \ 169 thermal0_resources, \
170 ARRAY_SIZE(thermal0_resources)) 170 ARRAY_SIZE(thermal0_resources))
171 171
172static struct sh_timer_config cmt10_platform_data = { 172static struct sh_timer_config cmt1_platform_data = {
173 .name = "CMT10", 173 .channels_mask = 0xff,
174 .timer_bit = 0,
175 .clockevent_rating = 80,
176}; 174};
177 175
178static struct resource cmt10_resources[] = { 176static struct resource cmt1_resources[] = {
179 DEFINE_RES_MEM(0xe6130010, 0x0c), 177 DEFINE_RES_MEM(0xe6130000, 0x1004),
180 DEFINE_RES_MEM(0xe6130000, 0x04), 178 DEFINE_RES_IRQ(gic_spi(120)),
181 DEFINE_RES_IRQ(gic_spi(120)), /* CMT1_0 */
182}; 179};
183 180
184#define r8a7790_register_cmt(idx) \ 181#define r8a7790_register_cmt(idx) \
185 platform_device_register_resndata(&platform_bus, "sh_cmt", \ 182 platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
186 idx, cmt##idx##_resources, \ 183 idx, cmt##idx##_resources, \
187 ARRAY_SIZE(cmt##idx##_resources), \ 184 ARRAY_SIZE(cmt##idx##_resources), \
188 &cmt##idx##_platform_data, \ 185 &cmt##idx##_platform_data, \
@@ -196,7 +193,7 @@ void __init r8a73a4_add_dt_devices(void)
196 r8a73a4_register_scif(3); 193 r8a73a4_register_scif(3);
197 r8a73a4_register_scif(4); 194 r8a73a4_register_scif(4);
198 r8a73a4_register_scif(5); 195 r8a73a4_register_scif(5);
199 r8a7790_register_cmt(10); 196 r8a7790_register_cmt(1);
200} 197}
201 198
202/* DMA */ 199/* DMA */
diff --git a/arch/arm/mach-shmobile/setup-r8a7740.c b/arch/arm/mach-shmobile/setup-r8a7740.c
index 8f3c68101d59..b7a09bb45fc9 100644
--- a/arch/arm/mach-shmobile/setup-r8a7740.c
+++ b/arch/arm/mach-shmobile/setup-r8a7740.c
@@ -237,126 +237,45 @@ R8A7740_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(107));
237R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108)); 237R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108));
238 238
239/* CMT */ 239/* CMT */
240static struct sh_timer_config cmt10_platform_data = { 240static struct sh_timer_config cmt1_platform_data = {
241 .name = "CMT10", 241 .channels_mask = 0x3f,
242 .channel_offset = 0x10,
243 .timer_bit = 0,
244 .clockevent_rating = 125,
245 .clocksource_rating = 125,
246}; 242};
247 243
248static struct resource cmt10_resources[] = { 244static struct resource cmt1_resources[] = {
249 [0] = { 245 DEFINE_RES_MEM(0xe6138000, 0x170),
250 .name = "CMT10", 246 DEFINE_RES_IRQ(gic_spi(58)),
251 .start = 0xe6138010,
252 .end = 0xe613801b,
253 .flags = IORESOURCE_MEM,
254 },
255 [1] = {
256 .start = gic_spi(58),
257 .flags = IORESOURCE_IRQ,
258 },
259}; 247};
260 248
261static struct platform_device cmt10_device = { 249static struct platform_device cmt1_device = {
262 .name = "sh_cmt", 250 .name = "sh-cmt-48",
263 .id = 10, 251 .id = 1,
264 .dev = { 252 .dev = {
265 .platform_data = &cmt10_platform_data, 253 .platform_data = &cmt1_platform_data,
266 }, 254 },
267 .resource = cmt10_resources, 255 .resource = cmt1_resources,
268 .num_resources = ARRAY_SIZE(cmt10_resources), 256 .num_resources = ARRAY_SIZE(cmt1_resources),
269}; 257};
270 258
271/* TMU */ 259/* TMU */
272static struct sh_timer_config tmu00_platform_data = { 260static struct sh_timer_config tmu0_platform_data = {
273 .name = "TMU00", 261 .channels_mask = 7,
274 .channel_offset = 0x4,
275 .timer_bit = 0,
276 .clockevent_rating = 200,
277}; 262};
278 263
279static struct resource tmu00_resources[] = { 264static struct resource tmu0_resources[] = {
280 [0] = { 265 DEFINE_RES_MEM(0xfff80000, 0x2c),
281 .name = "TMU00", 266 DEFINE_RES_IRQ(gic_spi(198)),
282 .start = 0xfff80008, 267 DEFINE_RES_IRQ(gic_spi(199)),
283 .end = 0xfff80014 - 1, 268 DEFINE_RES_IRQ(gic_spi(200)),
284 .flags = IORESOURCE_MEM,
285 },
286 [1] = {
287 .start = gic_spi(198),
288 .flags = IORESOURCE_IRQ,
289 },
290}; 269};
291 270
292static struct platform_device tmu00_device = { 271static struct platform_device tmu0_device = {
293 .name = "sh_tmu", 272 .name = "sh-tmu",
294 .id = 0, 273 .id = 0,
295 .dev = { 274 .dev = {
296 .platform_data = &tmu00_platform_data, 275 .platform_data = &tmu0_platform_data,
297 },
298 .resource = tmu00_resources,
299 .num_resources = ARRAY_SIZE(tmu00_resources),
300};
301
302static struct sh_timer_config tmu01_platform_data = {
303 .name = "TMU01",
304 .channel_offset = 0x10,
305 .timer_bit = 1,
306 .clocksource_rating = 200,
307};
308
309static struct resource tmu01_resources[] = {
310 [0] = {
311 .name = "TMU01",
312 .start = 0xfff80014,
313 .end = 0xfff80020 - 1,
314 .flags = IORESOURCE_MEM,
315 },
316 [1] = {
317 .start = gic_spi(199),
318 .flags = IORESOURCE_IRQ,
319 },
320};
321
322static struct platform_device tmu01_device = {
323 .name = "sh_tmu",
324 .id = 1,
325 .dev = {
326 .platform_data = &tmu01_platform_data,
327 },
328 .resource = tmu01_resources,
329 .num_resources = ARRAY_SIZE(tmu01_resources),
330};
331
332static struct sh_timer_config tmu02_platform_data = {
333 .name = "TMU02",
334 .channel_offset = 0x1C,
335 .timer_bit = 2,
336 .clocksource_rating = 200,
337};
338
339static struct resource tmu02_resources[] = {
340 [0] = {
341 .name = "TMU02",
342 .start = 0xfff80020,
343 .end = 0xfff8002C - 1,
344 .flags = IORESOURCE_MEM,
345 },
346 [1] = {
347 .start = gic_spi(200),
348 .flags = IORESOURCE_IRQ,
349 },
350};
351
352static struct platform_device tmu02_device = {
353 .name = "sh_tmu",
354 .id = 2,
355 .dev = {
356 .platform_data = &tmu02_platform_data,
357 }, 276 },
358 .resource = tmu02_resources, 277 .resource = tmu0_resources,
359 .num_resources = ARRAY_SIZE(tmu02_resources), 278 .num_resources = ARRAY_SIZE(tmu0_resources),
360}; 279};
361 280
362/* IPMMUI (an IPMMU module for ICB/LMB) */ 281/* IPMMUI (an IPMMU module for ICB/LMB) */
@@ -400,7 +319,7 @@ static struct platform_device *r8a7740_devices_dt[] __initdata = {
400 &scif6_device, 319 &scif6_device,
401 &scif7_device, 320 &scif7_device,
402 &scif8_device, 321 &scif8_device,
403 &cmt10_device, 322 &cmt1_device,
404}; 323};
405 324
406static struct platform_device *r8a7740_early_devices[] __initdata = { 325static struct platform_device *r8a7740_early_devices[] __initdata = {
@@ -408,9 +327,7 @@ static struct platform_device *r8a7740_early_devices[] __initdata = {
408 &irqpin1_device, 327 &irqpin1_device,
409 &irqpin2_device, 328 &irqpin2_device,
410 &irqpin3_device, 329 &irqpin3_device,
411 &tmu00_device, 330 &tmu0_device,
412 &tmu01_device,
413 &tmu02_device,
414 &ipmmu_device, 331 &ipmmu_device,
415}; 332};
416 333
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c
index 6d694526e4ca..8c02e24f2483 100644
--- a/arch/arm/mach-shmobile/setup-r8a7778.c
+++ b/arch/arm/mach-shmobile/setup-r8a7778.c
@@ -71,33 +71,20 @@ R8A7778_SCIF(5, 0xffe45000, gic_iid(0x6b));
71 sizeof(scif##index##_platform_data)) 71 sizeof(scif##index##_platform_data))
72 72
73/* TMU */ 73/* TMU */
74static struct resource sh_tmu0_resources[] __initdata = { 74static struct sh_timer_config sh_tmu0_platform_data = {
75 DEFINE_RES_MEM(0xffd80008, 12), 75 .channels_mask = 7,
76 DEFINE_RES_IRQ(gic_iid(0x40)),
77};
78
79static struct sh_timer_config sh_tmu0_platform_data __initdata = {
80 .name = "TMU00",
81 .channel_offset = 0x4,
82 .timer_bit = 0,
83 .clockevent_rating = 200,
84}; 76};
85 77
86static struct resource sh_tmu1_resources[] __initdata = { 78static struct resource sh_tmu0_resources[] = {
87 DEFINE_RES_MEM(0xffd80014, 12), 79 DEFINE_RES_MEM(0xffd80000, 0x30),
80 DEFINE_RES_IRQ(gic_iid(0x40)),
88 DEFINE_RES_IRQ(gic_iid(0x41)), 81 DEFINE_RES_IRQ(gic_iid(0x41)),
89}; 82 DEFINE_RES_IRQ(gic_iid(0x42)),
90
91static struct sh_timer_config sh_tmu1_platform_data __initdata = {
92 .name = "TMU01",
93 .channel_offset = 0x10,
94 .timer_bit = 1,
95 .clocksource_rating = 200,
96}; 83};
97 84
98#define r8a7778_register_tmu(idx) \ 85#define r8a7778_register_tmu(idx) \
99 platform_device_register_resndata( \ 86 platform_device_register_resndata( \
100 &platform_bus, "sh_tmu", idx, \ 87 &platform_bus, "sh-tmu", idx, \
101 sh_tmu##idx##_resources, \ 88 sh_tmu##idx##_resources, \
102 ARRAY_SIZE(sh_tmu##idx##_resources), \ 89 ARRAY_SIZE(sh_tmu##idx##_resources), \
103 &sh_tmu##idx##_platform_data, \ 90 &sh_tmu##idx##_platform_data, \
@@ -312,7 +299,6 @@ void __init r8a7778_add_dt_devices(void)
312 r8a7778_register_scif(4); 299 r8a7778_register_scif(4);
313 r8a7778_register_scif(5); 300 r8a7778_register_scif(5);
314 r8a7778_register_tmu(0); 301 r8a7778_register_tmu(0);
315 r8a7778_register_tmu(1);
316} 302}
317 303
318/* HPB-DMA */ 304/* HPB-DMA */
diff --git a/arch/arm/mach-shmobile/setup-r8a7779.c b/arch/arm/mach-shmobile/setup-r8a7779.c
index 8e860b36997a..d197b5adc886 100644
--- a/arch/arm/mach-shmobile/setup-r8a7779.c
+++ b/arch/arm/mach-shmobile/setup-r8a7779.c
@@ -219,64 +219,25 @@ R8A7779_SCIF(4, 0xffe44000, gic_iid(0x7c));
219R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); 219R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d));
220 220
221/* TMU */ 221/* TMU */
222static struct sh_timer_config tmu00_platform_data = { 222static struct sh_timer_config tmu0_platform_data = {
223 .name = "TMU00", 223 .channels_mask = 7,
224 .channel_offset = 0x4,
225 .timer_bit = 0,
226 .clockevent_rating = 200,
227}; 224};
228 225
229static struct resource tmu00_resources[] = { 226static struct resource tmu0_resources[] = {
230 [0] = { 227 DEFINE_RES_MEM(0xffd80000, 0x30),
231 .name = "TMU00", 228 DEFINE_RES_IRQ(gic_iid(0x40)),
232 .start = 0xffd80008, 229 DEFINE_RES_IRQ(gic_iid(0x41)),
233 .end = 0xffd80013, 230 DEFINE_RES_IRQ(gic_iid(0x42)),
234 .flags = IORESOURCE_MEM,
235 },
236 [1] = {
237 .start = gic_iid(0x40),
238 .flags = IORESOURCE_IRQ,
239 },
240}; 231};
241 232
242static struct platform_device tmu00_device = { 233static struct platform_device tmu0_device = {
243 .name = "sh_tmu", 234 .name = "sh-tmu",
244 .id = 0, 235 .id = 0,
245 .dev = { 236 .dev = {
246 .platform_data = &tmu00_platform_data, 237 .platform_data = &tmu0_platform_data,
247 },
248 .resource = tmu00_resources,
249 .num_resources = ARRAY_SIZE(tmu00_resources),
250};
251
252static struct sh_timer_config tmu01_platform_data = {
253 .name = "TMU01",
254 .channel_offset = 0x10,
255 .timer_bit = 1,
256 .clocksource_rating = 200,
257};
258
259static struct resource tmu01_resources[] = {
260 [0] = {
261 .name = "TMU01",
262 .start = 0xffd80014,
263 .end = 0xffd8001f,
264 .flags = IORESOURCE_MEM,
265 },
266 [1] = {
267 .start = gic_iid(0x41),
268 .flags = IORESOURCE_IRQ,
269 },
270};
271
272static struct platform_device tmu01_device = {
273 .name = "sh_tmu",
274 .id = 1,
275 .dev = {
276 .platform_data = &tmu01_platform_data,
277 }, 238 },
278 .resource = tmu01_resources, 239 .resource = tmu0_resources,
279 .num_resources = ARRAY_SIZE(tmu01_resources), 240 .num_resources = ARRAY_SIZE(tmu0_resources),
280}; 241};
281 242
282/* I2C */ 243/* I2C */
@@ -685,8 +646,7 @@ static struct platform_device *r8a7779_devices_dt[] __initdata = {
685 &scif3_device, 646 &scif3_device,
686 &scif4_device, 647 &scif4_device,
687 &scif5_device, 648 &scif5_device,
688 &tmu00_device, 649 &tmu0_device,
689 &tmu01_device,
690}; 650};
691 651
692static struct platform_device *r8a7779_standard_devices[] __initdata = { 652static struct platform_device *r8a7779_standard_devices[] __initdata = {
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index c4616f0698c6..87327f353d1b 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -269,20 +269,17 @@ static const struct resource thermal_resources[] __initconst = {
269 thermal_resources, \ 269 thermal_resources, \
270 ARRAY_SIZE(thermal_resources)) 270 ARRAY_SIZE(thermal_resources))
271 271
272static const struct sh_timer_config cmt00_platform_data __initconst = { 272static struct sh_timer_config cmt0_platform_data = {
273 .name = "CMT00", 273 .channels_mask = 0x60,
274 .timer_bit = 0,
275 .clockevent_rating = 80,
276}; 274};
277 275
278static const struct resource cmt00_resources[] __initconst = { 276static struct resource cmt0_resources[] = {
279 DEFINE_RES_MEM(0xffca0510, 0x0c), 277 DEFINE_RES_MEM(0xffca0000, 0x1004),
280 DEFINE_RES_MEM(0xffca0500, 0x04), 278 DEFINE_RES_IRQ(gic_spi(142)),
281 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
282}; 279};
283 280
284#define r8a7790_register_cmt(idx) \ 281#define r8a7790_register_cmt(idx) \
285 platform_device_register_resndata(&platform_bus, "sh_cmt", \ 282 platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
286 idx, cmt##idx##_resources, \ 283 idx, cmt##idx##_resources, \
287 ARRAY_SIZE(cmt##idx##_resources), \ 284 ARRAY_SIZE(cmt##idx##_resources), \
288 &cmt##idx##_platform_data, \ 285 &cmt##idx##_platform_data, \
@@ -300,7 +297,7 @@ void __init r8a7790_add_dt_devices(void)
300 r8a7790_register_scif(7); 297 r8a7790_register_scif(7);
301 r8a7790_register_scif(8); 298 r8a7790_register_scif(8);
302 r8a7790_register_scif(9); 299 r8a7790_register_scif(9);
303 r8a7790_register_cmt(00); 300 r8a7790_register_cmt(0);
304} 301}
305 302
306void __init r8a7790_add_standard_devices(void) 303void __init r8a7790_add_standard_devices(void)
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index e28404e43860..561653d639d7 100644
--- a/arch/arm/mach-shmobile/setup-r8a7791.c
+++ b/arch/arm/mach-shmobile/setup-r8a7791.c
@@ -128,20 +128,17 @@ R8A7791_SCIFA(14, 0xe6c80000, gic_spi(31)); /* SCIFA5 */
128 &scif##index##_platform_data, \ 128 &scif##index##_platform_data, \
129 sizeof(scif##index##_platform_data)) 129 sizeof(scif##index##_platform_data))
130 130
131static const struct sh_timer_config cmt00_platform_data __initconst = { 131static struct sh_timer_config cmt0_platform_data = {
132 .name = "CMT00", 132 .channels_mask = 0x60,
133 .timer_bit = 0,
134 .clockevent_rating = 80,
135}; 133};
136 134
137static const struct resource cmt00_resources[] __initconst = { 135static struct resource cmt0_resources[] = {
138 DEFINE_RES_MEM(0xffca0510, 0x0c), 136 DEFINE_RES_MEM(0xffca0000, 0x1004),
139 DEFINE_RES_MEM(0xffca0500, 0x04), 137 DEFINE_RES_IRQ(gic_spi(142)),
140 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
141}; 138};
142 139
143#define r8a7791_register_cmt(idx) \ 140#define r8a7791_register_cmt(idx) \
144 platform_device_register_resndata(&platform_bus, "sh_cmt", \ 141 platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
145 idx, cmt##idx##_resources, \ 142 idx, cmt##idx##_resources, \
146 ARRAY_SIZE(cmt##idx##_resources), \ 143 ARRAY_SIZE(cmt##idx##_resources), \
147 &cmt##idx##_platform_data, \ 144 &cmt##idx##_platform_data, \
@@ -200,7 +197,7 @@ void __init r8a7791_add_dt_devices(void)
200 r8a7791_register_scif(12); 197 r8a7791_register_scif(12);
201 r8a7791_register_scif(13); 198 r8a7791_register_scif(13);
202 r8a7791_register_scif(14); 199 r8a7791_register_scif(14);
203 r8a7791_register_cmt(00); 200 r8a7791_register_cmt(0);
204} 201}
205 202
206void __init r8a7791_add_standard_devices(void) 203void __init r8a7791_add_standard_devices(void)
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index 27301278c208..178acfeeca7a 100644
--- a/arch/arm/mach-shmobile/setup-sh7372.c
+++ b/arch/arm/mach-shmobile/setup-sh7372.c
@@ -119,28 +119,16 @@ SH7372_SCIF(PORT_SCIFB, 6, 0xe6c30000, evt2irq(0x0d60));
119 119
120/* CMT */ 120/* CMT */
121static struct sh_timer_config cmt2_platform_data = { 121static struct sh_timer_config cmt2_platform_data = {
122 .name = "CMT2", 122 .channels_mask = 0x20,
123 .channel_offset = 0x40,
124 .timer_bit = 5,
125 .clockevent_rating = 125,
126 .clocksource_rating = 125,
127}; 123};
128 124
129static struct resource cmt2_resources[] = { 125static struct resource cmt2_resources[] = {
130 [0] = { 126 DEFINE_RES_MEM(0xe6130000, 0x50),
131 .name = "CMT2", 127 DEFINE_RES_IRQ(evt2irq(0x0b80)),
132 .start = 0xe6130040,
133 .end = 0xe613004b,
134 .flags = IORESOURCE_MEM,
135 },
136 [1] = {
137 .start = evt2irq(0x0b80), /* CMT2 */
138 .flags = IORESOURCE_IRQ,
139 },
140}; 128};
141 129
142static struct platform_device cmt2_device = { 130static struct platform_device cmt2_device = {
143 .name = "sh_cmt", 131 .name = "sh-cmt-32-fast",
144 .id = 2, 132 .id = 2,
145 .dev = { 133 .dev = {
146 .platform_data = &cmt2_platform_data, 134 .platform_data = &cmt2_platform_data,
@@ -150,64 +138,25 @@ static struct platform_device cmt2_device = {
150}; 138};
151 139
152/* TMU */ 140/* TMU */
153static struct sh_timer_config tmu00_platform_data = { 141static struct sh_timer_config tmu0_platform_data = {
154 .name = "TMU00", 142 .channels_mask = 7,
155 .channel_offset = 0x4,
156 .timer_bit = 0,
157 .clockevent_rating = 200,
158}; 143};
159 144
160static struct resource tmu00_resources[] = { 145static struct resource tmu0_resources[] = {
161 [0] = { 146 DEFINE_RES_MEM(0xfff60000, 0x2c),
162 .name = "TMU00", 147 DEFINE_RES_IRQ(intcs_evt2irq(0xe80)),
163 .start = 0xfff60008, 148 DEFINE_RES_IRQ(intcs_evt2irq(0xea0)),
164 .end = 0xfff60013, 149 DEFINE_RES_IRQ(intcs_evt2irq(0xec0)),
165 .flags = IORESOURCE_MEM,
166 },
167 [1] = {
168 .start = intcs_evt2irq(0xe80), /* TMU_TUNI0 */
169 .flags = IORESOURCE_IRQ,
170 },
171}; 150};
172 151
173static struct platform_device tmu00_device = { 152static struct platform_device tmu0_device = {
174 .name = "sh_tmu", 153 .name = "sh-tmu",
175 .id = 0, 154 .id = 0,
176 .dev = { 155 .dev = {
177 .platform_data = &tmu00_platform_data, 156 .platform_data = &tmu0_platform_data,
178 },
179 .resource = tmu00_resources,
180 .num_resources = ARRAY_SIZE(tmu00_resources),
181};
182
183static struct sh_timer_config tmu01_platform_data = {
184 .name = "TMU01",
185 .channel_offset = 0x10,
186 .timer_bit = 1,
187 .clocksource_rating = 200,
188};
189
190static struct resource tmu01_resources[] = {
191 [0] = {
192 .name = "TMU01",
193 .start = 0xfff60014,
194 .end = 0xfff6001f,
195 .flags = IORESOURCE_MEM,
196 },
197 [1] = {
198 .start = intcs_evt2irq(0xea0), /* TMU_TUNI1 */
199 .flags = IORESOURCE_IRQ,
200 },
201};
202
203static struct platform_device tmu01_device = {
204 .name = "sh_tmu",
205 .id = 1,
206 .dev = {
207 .platform_data = &tmu01_platform_data,
208 }, 157 },
209 .resource = tmu01_resources, 158 .resource = tmu0_resources,
210 .num_resources = ARRAY_SIZE(tmu01_resources), 159 .num_resources = ARRAY_SIZE(tmu0_resources),
211}; 160};
212 161
213/* I2C */ 162/* I2C */
@@ -952,8 +901,7 @@ static struct platform_device *sh7372_early_devices[] __initdata = {
952 &scif5_device, 901 &scif5_device,
953 &scif6_device, 902 &scif6_device,
954 &cmt2_device, 903 &cmt2_device,
955 &tmu00_device, 904 &tmu0_device,
956 &tmu01_device,
957 &ipmmu_device, 905 &ipmmu_device,
958}; 906};
959 907
@@ -1000,8 +948,7 @@ void __init sh7372_add_standard_devices(void)
1000 { "A4R", &veu2_device, }, 948 { "A4R", &veu2_device, },
1001 { "A4R", &veu3_device, }, 949 { "A4R", &veu3_device, },
1002 { "A4R", &jpu_device, }, 950 { "A4R", &jpu_device, },
1003 { "A4R", &tmu00_device, }, 951 { "A4R", &tmu0_device, },
1004 { "A4R", &tmu01_device, },
1005 }; 952 };
1006 953
1007 sh7372_init_pm_domains(); 954 sh7372_init_pm_domains();
diff --git a/arch/arm/mach-shmobile/setup-sh73a0.c b/arch/arm/mach-shmobile/setup-sh73a0.c
index f74ab530c71d..ad00724a2269 100644
--- a/arch/arm/mach-shmobile/setup-sh73a0.c
+++ b/arch/arm/mach-shmobile/setup-sh73a0.c
@@ -104,86 +104,45 @@ SH73A0_SCIF(PORT_SCIFA, 6, 0xe6cc0000, gic_spi(156));
104SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143)); 104SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143));
105SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80)); 105SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80));
106 106
107static struct sh_timer_config cmt10_platform_data = { 107static struct sh_timer_config cmt1_platform_data = {
108 .name = "CMT10", 108 .channels_mask = 0x3f,
109 .channel_offset = 0x10,
110 .timer_bit = 0,
111 .clockevent_rating = 80,
112 .clocksource_rating = 125,
113}; 109};
114 110
115static struct resource cmt10_resources[] = { 111static struct resource cmt1_resources[] = {
116 [0] = { 112 DEFINE_RES_MEM(0xe6138000, 0x200),
117 .name = "CMT10", 113 DEFINE_RES_IRQ(gic_spi(65)),
118 .start = 0xe6138010,
119 .end = 0xe613801b,
120 .flags = IORESOURCE_MEM,
121 },
122 [1] = {
123 .start = gic_spi(65),
124 .flags = IORESOURCE_IRQ,
125 },
126}; 114};
127 115
128static struct platform_device cmt10_device = { 116static struct platform_device cmt1_device = {
129 .name = "sh_cmt", 117 .name = "sh-cmt-48",
130 .id = 10, 118 .id = 1,
131 .dev = { 119 .dev = {
132 .platform_data = &cmt10_platform_data, 120 .platform_data = &cmt1_platform_data,
133 }, 121 },
134 .resource = cmt10_resources, 122 .resource = cmt1_resources,
135 .num_resources = ARRAY_SIZE(cmt10_resources), 123 .num_resources = ARRAY_SIZE(cmt1_resources),
136}; 124};
137 125
138/* TMU */ 126/* TMU */
139static struct sh_timer_config tmu00_platform_data = { 127static struct sh_timer_config tmu0_platform_data = {
140 .name = "TMU00", 128 .channels_mask = 7,
141 .channel_offset = 0x4,
142 .timer_bit = 0,
143 .clockevent_rating = 200,
144}; 129};
145 130
146static struct resource tmu00_resources[] = { 131static struct resource tmu0_resources[] = {
147 [0] = DEFINE_RES_MEM(0xfff60008, 0xc), 132 DEFINE_RES_MEM(0xfff60000, 0x2c),
148 [1] = { 133 DEFINE_RES_IRQ(intcs_evt2irq(0xe80)),
149 .start = intcs_evt2irq(0x0e80), /* TMU0_TUNI00 */ 134 DEFINE_RES_IRQ(intcs_evt2irq(0xea0)),
150 .flags = IORESOURCE_IRQ, 135 DEFINE_RES_IRQ(intcs_evt2irq(0xec0)),
151 },
152}; 136};
153 137
154static struct platform_device tmu00_device = { 138static struct platform_device tmu0_device = {
155 .name = "sh_tmu", 139 .name = "sh-tmu",
156 .id = 0, 140 .id = 0,
157 .dev = { 141 .dev = {
158 .platform_data = &tmu00_platform_data, 142 .platform_data = &tmu0_platform_data,
159 },
160 .resource = tmu00_resources,
161 .num_resources = ARRAY_SIZE(tmu00_resources),
162};
163
164static struct sh_timer_config tmu01_platform_data = {
165 .name = "TMU01",
166 .channel_offset = 0x10,
167 .timer_bit = 1,
168 .clocksource_rating = 200,
169};
170
171static struct resource tmu01_resources[] = {
172 [0] = DEFINE_RES_MEM(0xfff60014, 0xc),
173 [1] = {
174 .start = intcs_evt2irq(0x0ea0), /* TMU0_TUNI01 */
175 .flags = IORESOURCE_IRQ,
176 },
177};
178
179static struct platform_device tmu01_device = {
180 .name = "sh_tmu",
181 .id = 1,
182 .dev = {
183 .platform_data = &tmu01_platform_data,
184 }, 143 },
185 .resource = tmu01_resources, 144 .resource = tmu0_resources,
186 .num_resources = ARRAY_SIZE(tmu01_resources), 145 .num_resources = ARRAY_SIZE(tmu0_resources),
187}; 146};
188 147
189static struct resource i2c0_resources[] = { 148static struct resource i2c0_resources[] = {
@@ -746,12 +705,11 @@ static struct platform_device *sh73a0_devices_dt[] __initdata = {
746 &scif6_device, 705 &scif6_device,
747 &scif7_device, 706 &scif7_device,
748 &scif8_device, 707 &scif8_device,
749 &cmt10_device, 708 &cmt1_device,
750}; 709};
751 710
752static struct platform_device *sh73a0_early_devices[] __initdata = { 711static struct platform_device *sh73a0_early_devices[] __initdata = {
753 &tmu00_device, 712 &tmu0_device,
754 &tmu01_device,
755 &ipmmu_device, 713 &ipmmu_device,
756}; 714};
757 715
diff --git a/arch/sh/kernel/cpu/clock-cpg.c b/arch/sh/kernel/cpu/clock-cpg.c
index f59b1f30d44b..8525a671266f 100644
--- a/arch/sh/kernel/cpu/clock-cpg.c
+++ b/arch/sh/kernel/cpu/clock-cpg.c
@@ -56,9 +56,13 @@ int __init __deprecated cpg_clk_init(void)
56 56
57 clkdev_add_table(lookups, ARRAY_SIZE(lookups)); 57 clkdev_add_table(lookups, ARRAY_SIZE(lookups));
58 58
59 clk_add_alias("tmu_fck", NULL, "peripheral_clk", NULL); 59 clk_add_alias("fck", "sh-tmu-sh3.0", "peripheral_clk", NULL);
60 clk_add_alias("mtu2_fck", NULL, "peripheral_clk", NULL); 60 clk_add_alias("fck", "sh-tmu.0", "peripheral_clk", NULL);
61 clk_add_alias("cmt_fck", NULL, "peripheral_clk", NULL); 61 clk_add_alias("fck", "sh-tmu.1", "peripheral_clk", NULL);
62 clk_add_alias("fck", "sh-tmu.2", "peripheral_clk", NULL);
63 clk_add_alias("fck", "sh-mtu2", "peripheral_clk", NULL);
64 clk_add_alias("fck", "sh-cmt-16.0", "peripheral_clk", NULL);
65 clk_add_alias("fck", "sh-cmt-32.0", "peripheral_clk", NULL);
62 clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL); 66 clk_add_alias("sci_ick", NULL, "peripheral_clk", NULL);
63 67
64 return ret; 68 return ret;
diff --git a/arch/sh/kernel/cpu/sh2/setup-sh7619.c b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
index 3860b0be56c7..58c19adae900 100644
--- a/arch/sh/kernel/cpu/sh2/setup-sh7619.c
+++ b/arch/sh/kernel/cpu/sh2/setup-sh7619.c
@@ -152,62 +152,24 @@ static struct platform_device eth_device = {
152 .resource = eth_resources, 152 .resource = eth_resources,
153}; 153};
154 154
155static struct sh_timer_config cmt0_platform_data = { 155static struct sh_timer_config cmt_platform_data = {
156 .channel_offset = 0x02, 156 .channels_mask = 3,
157 .timer_bit = 0,
158 .clockevent_rating = 125,
159 .clocksource_rating = 0, /* disabled due to code generation issues */
160}; 157};
161 158
162static struct resource cmt0_resources[] = { 159static struct resource cmt_resources[] = {
163 [0] = { 160 DEFINE_RES_MEM(0xf84a0070, 0x10),
164 .start = 0xf84a0072, 161 DEFINE_RES_IRQ(86),
165 .end = 0xf84a0077, 162 DEFINE_RES_IRQ(87),
166 .flags = IORESOURCE_MEM,
167 },
168 [1] = {
169 .start = 86,
170 .flags = IORESOURCE_IRQ,
171 },
172}; 163};
173 164
174static struct platform_device cmt0_device = { 165static struct platform_device cmt_device = {
175 .name = "sh_cmt", 166 .name = "sh-cmt-16",
176 .id = 0, 167 .id = 0,
177 .dev = { 168 .dev = {
178 .platform_data = &cmt0_platform_data, 169 .platform_data = &cmt_platform_data,
179 },
180 .resource = cmt0_resources,
181 .num_resources = ARRAY_SIZE(cmt0_resources),
182};
183
184static struct sh_timer_config cmt1_platform_data = {
185 .channel_offset = 0x08,
186 .timer_bit = 1,
187 .clockevent_rating = 125,
188 .clocksource_rating = 0, /* disabled due to code generation issues */
189};
190
191static struct resource cmt1_resources[] = {
192 [0] = {
193 .start = 0xf84a0078,
194 .end = 0xf84a007d,
195 .flags = IORESOURCE_MEM,
196 },
197 [1] = {
198 .start = 87,
199 .flags = IORESOURCE_IRQ,
200 },
201};
202
203static struct platform_device cmt1_device = {
204 .name = "sh_cmt",
205 .id = 1,
206 .dev = {
207 .platform_data = &cmt1_platform_data,
208 }, 170 },
209 .resource = cmt1_resources, 171 .resource = cmt_resources,
210 .num_resources = ARRAY_SIZE(cmt1_resources), 172 .num_resources = ARRAY_SIZE(cmt_resources),
211}; 173};
212 174
213static struct platform_device *sh7619_devices[] __initdata = { 175static struct platform_device *sh7619_devices[] __initdata = {
@@ -215,8 +177,7 @@ static struct platform_device *sh7619_devices[] __initdata = {
215 &scif1_device, 177 &scif1_device,
216 &scif2_device, 178 &scif2_device,
217 &eth_device, 179 &eth_device,
218 &cmt0_device, 180 &cmt_device,
219 &cmt1_device,
220}; 181};
221 182
222static int __init sh7619_devices_setup(void) 183static int __init sh7619_devices_setup(void)
@@ -235,8 +196,7 @@ static struct platform_device *sh7619_early_devices[] __initdata = {
235 &scif0_device, 196 &scif0_device,
236 &scif1_device, 197 &scif1_device,
237 &scif2_device, 198 &scif2_device,
238 &cmt0_device, 199 &cmt_device,
239 &cmt1_device,
240}; 200};
241 201
242#define STBCR3 0xf80a0000 202#define STBCR3 0xf80a0000
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
index fdf585c95289..8638fba6cd7f 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7264.c
@@ -117,9 +117,9 @@ static struct clk_lookup lookups[] = {
117 /* MSTP clocks */ 117 /* MSTP clocks */
118 CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]), 118 CLKDEV_CON_ID("sci_ick", &mstp_clks[MSTP77]),
119 CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]), 119 CLKDEV_CON_ID("vdc3", &mstp_clks[MSTP74]),
120 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), 120 CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
121 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), 121 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
122 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), 122 CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP35]),
123 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]), 123 CLKDEV_CON_ID("sdhi0", &mstp_clks[MSTP34]),
124 CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]), 124 CLKDEV_CON_ID("sdhi1", &mstp_clks[MSTP33]),
125 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), 125 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c
index 6b787620de99..f8a5c2abdfb3 100644
--- a/arch/sh/kernel/cpu/sh2a/clock-sh7269.c
+++ b/arch/sh/kernel/cpu/sh2a/clock-sh7269.c
@@ -158,9 +158,9 @@ static struct clk_lookup lookups[] = {
158 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), 158 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
159 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), 159 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
160 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), 160 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
161 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP72]), 161 CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[MSTP72]),
162 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]), 162 CLKDEV_CON_ID("usb0", &mstp_clks[MSTP60]),
163 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP35]), 163 CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP35]),
164 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]), 164 CLKDEV_CON_ID("adc0", &mstp_clks[MSTP32]),
165 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]), 165 CLKDEV_CON_ID("rtc0", &mstp_clks[MSTP30]),
166}; 166};
diff --git a/arch/sh/kernel/cpu/sh2a/setup-mxg.c b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
index 63e996f9a7ed..26fcdbd4127a 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-mxg.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-mxg.c
@@ -114,88 +114,18 @@ static struct intc_mask_reg mask_registers[] __initdata = {
114static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups, 114static DECLARE_INTC_DESC(intc_desc, "mxg", vectors, groups,
115 mask_registers, prio_registers, NULL); 115 mask_registers, prio_registers, NULL);
116 116
117static struct sh_timer_config mtu2_0_platform_data = { 117static struct resource mtu2_resources[] = {
118 .channel_offset = -0x80, 118 DEFINE_RES_MEM(0xff801000, 0x400),
119 .timer_bit = 0, 119 DEFINE_RES_IRQ_NAMED(228, "tgi0a"),
120 .clockevent_rating = 200, 120 DEFINE_RES_IRQ_NAMED(234, "tgi1a"),
121 DEFINE_RES_IRQ_NAMED(240, "tgi2a"),
121}; 122};
122 123
123static struct resource mtu2_0_resources[] = { 124static struct platform_device mtu2_device = {
124 [0] = { 125 .name = "sh-mtu2",
125 .start = 0xff801300, 126 .id = -1,
126 .end = 0xff801326, 127 .resource = mtu2_resources,
127 .flags = IORESOURCE_MEM, 128 .num_resources = ARRAY_SIZE(mtu2_resources),
128 },
129 [1] = {
130 .start = 228,
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device mtu2_0_device = {
136 .name = "sh_mtu2",
137 .id = 0,
138 .dev = {
139 .platform_data = &mtu2_0_platform_data,
140 },
141 .resource = mtu2_0_resources,
142 .num_resources = ARRAY_SIZE(mtu2_0_resources),
143};
144
145static struct sh_timer_config mtu2_1_platform_data = {
146 .channel_offset = -0x100,
147 .timer_bit = 1,
148 .clockevent_rating = 200,
149};
150
151static struct resource mtu2_1_resources[] = {
152 [0] = {
153 .start = 0xff801380,
154 .end = 0xff801390,
155 .flags = IORESOURCE_MEM,
156 },
157 [1] = {
158 .start = 234,
159 .flags = IORESOURCE_IRQ,
160 },
161};
162
163static struct platform_device mtu2_1_device = {
164 .name = "sh_mtu2",
165 .id = 1,
166 .dev = {
167 .platform_data = &mtu2_1_platform_data,
168 },
169 .resource = mtu2_1_resources,
170 .num_resources = ARRAY_SIZE(mtu2_1_resources),
171};
172
173static struct sh_timer_config mtu2_2_platform_data = {
174 .channel_offset = 0x80,
175 .timer_bit = 2,
176 .clockevent_rating = 200,
177};
178
179static struct resource mtu2_2_resources[] = {
180 [0] = {
181 .start = 0xff801000,
182 .end = 0xff80100a,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = 240,
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device mtu2_2_device = {
192 .name = "sh_mtu2",
193 .id = 2,
194 .dev = {
195 .platform_data = &mtu2_2_platform_data,
196 },
197 .resource = mtu2_2_resources,
198 .num_resources = ARRAY_SIZE(mtu2_2_resources),
199}; 129};
200 130
201static struct plat_sci_port scif0_platform_data = { 131static struct plat_sci_port scif0_platform_data = {
@@ -221,9 +151,7 @@ static struct platform_device scif0_device = {
221 151
222static struct platform_device *mxg_devices[] __initdata = { 152static struct platform_device *mxg_devices[] __initdata = {
223 &scif0_device, 153 &scif0_device,
224 &mtu2_0_device, 154 &mtu2_device,
225 &mtu2_1_device,
226 &mtu2_2_device,
227}; 155};
228 156
229static int __init mxg_devices_setup(void) 157static int __init mxg_devices_setup(void)
@@ -240,9 +168,7 @@ void __init plat_irq_setup(void)
240 168
241static struct platform_device *mxg_early_devices[] __initdata = { 169static struct platform_device *mxg_early_devices[] __initdata = {
242 &scif0_device, 170 &scif0_device,
243 &mtu2_0_device, 171 &mtu2_device,
244 &mtu2_1_device,
245 &mtu2_2_device,
246}; 172};
247 173
248void __init plat_early_device_setup(void) 174void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
index 2c6874461536..abc0ce9fb800 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7201.c
@@ -365,88 +365,18 @@ static struct platform_device rtc_device = {
365 .resource = rtc_resources, 365 .resource = rtc_resources,
366}; 366};
367 367
368static struct sh_timer_config mtu2_0_platform_data = { 368static struct resource mtu2_resources[] = {
369 .channel_offset = -0x80, 369 DEFINE_RES_MEM(0xfffe4000, 0x400),
370 .timer_bit = 0, 370 DEFINE_RES_IRQ_NAMED(108, "tgi0a"),
371 .clockevent_rating = 200, 371 DEFINE_RES_IRQ_NAMED(116, "tgi1a"),
372 DEFINE_RES_IRQ_NAMED(124, "tgi1b"),
372}; 373};
373 374
374static struct resource mtu2_0_resources[] = { 375static struct platform_device mtu2_device = {
375 [0] = { 376 .name = "sh-mtu2",
376 .start = 0xfffe4300, 377 .id = -1,
377 .end = 0xfffe4326, 378 .resource = mtu2_resources,
378 .flags = IORESOURCE_MEM, 379 .num_resources = ARRAY_SIZE(mtu2_resources),
379 },
380 [1] = {
381 .start = 108,
382 .flags = IORESOURCE_IRQ,
383 },
384};
385
386static struct platform_device mtu2_0_device = {
387 .name = "sh_mtu2",
388 .id = 0,
389 .dev = {
390 .platform_data = &mtu2_0_platform_data,
391 },
392 .resource = mtu2_0_resources,
393 .num_resources = ARRAY_SIZE(mtu2_0_resources),
394};
395
396static struct sh_timer_config mtu2_1_platform_data = {
397 .channel_offset = -0x100,
398 .timer_bit = 1,
399 .clockevent_rating = 200,
400};
401
402static struct resource mtu2_1_resources[] = {
403 [0] = {
404 .start = 0xfffe4380,
405 .end = 0xfffe4390,
406 .flags = IORESOURCE_MEM,
407 },
408 [1] = {
409 .start = 116,
410 .flags = IORESOURCE_IRQ,
411 },
412};
413
414static struct platform_device mtu2_1_device = {
415 .name = "sh_mtu2",
416 .id = 1,
417 .dev = {
418 .platform_data = &mtu2_1_platform_data,
419 },
420 .resource = mtu2_1_resources,
421 .num_resources = ARRAY_SIZE(mtu2_1_resources),
422};
423
424static struct sh_timer_config mtu2_2_platform_data = {
425 .channel_offset = 0x80,
426 .timer_bit = 2,
427 .clockevent_rating = 200,
428};
429
430static struct resource mtu2_2_resources[] = {
431 [0] = {
432 .start = 0xfffe4000,
433 .end = 0xfffe400a,
434 .flags = IORESOURCE_MEM,
435 },
436 [1] = {
437 .start = 124,
438 .flags = IORESOURCE_IRQ,
439 },
440};
441
442static struct platform_device mtu2_2_device = {
443 .name = "sh_mtu2",
444 .id = 2,
445 .dev = {
446 .platform_data = &mtu2_2_platform_data,
447 },
448 .resource = mtu2_2_resources,
449 .num_resources = ARRAY_SIZE(mtu2_2_resources),
450}; 380};
451 381
452static struct platform_device *sh7201_devices[] __initdata = { 382static struct platform_device *sh7201_devices[] __initdata = {
@@ -459,9 +389,7 @@ static struct platform_device *sh7201_devices[] __initdata = {
459 &scif6_device, 389 &scif6_device,
460 &scif7_device, 390 &scif7_device,
461 &rtc_device, 391 &rtc_device,
462 &mtu2_0_device, 392 &mtu2_device,
463 &mtu2_1_device,
464 &mtu2_2_device,
465}; 393};
466 394
467static int __init sh7201_devices_setup(void) 395static int __init sh7201_devices_setup(void)
@@ -485,9 +413,7 @@ static struct platform_device *sh7201_early_devices[] __initdata = {
485 &scif5_device, 413 &scif5_device,
486 &scif6_device, 414 &scif6_device,
487 &scif7_device, 415 &scif7_device,
488 &mtu2_0_device, 416 &mtu2_device,
489 &mtu2_1_device,
490 &mtu2_2_device,
491}; 417};
492 418
493#define STBCR3 0xfffe0408 419#define STBCR3 0xfffe0408
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
index d55a0f30ada3..3b4894cba92f 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7203.c
@@ -265,118 +265,37 @@ static struct platform_device scif3_device = {
265 }, 265 },
266}; 266};
267 267
268static struct sh_timer_config cmt0_platform_data = { 268static struct sh_timer_config cmt_platform_data = {
269 .channel_offset = 0x02, 269 .channels_mask = 3,
270 .timer_bit = 0,
271 .clockevent_rating = 125,
272 .clocksource_rating = 0, /* disabled due to code generation issues */
273}; 270};
274 271
275static struct resource cmt0_resources[] = { 272static struct resource cmt_resources[] = {
276 [0] = { 273 DEFINE_RES_MEM(0xfffec000, 0x10),
277 .start = 0xfffec002, 274 DEFINE_RES_IRQ(142),
278 .end = 0xfffec007, 275 DEFINE_RES_IRQ(143),
279 .flags = IORESOURCE_MEM,
280 },
281 [1] = {
282 .start = 142,
283 .flags = IORESOURCE_IRQ,
284 },
285};
286
287static struct platform_device cmt0_device = {
288 .name = "sh_cmt",
289 .id = 0,
290 .dev = {
291 .platform_data = &cmt0_platform_data,
292 },
293 .resource = cmt0_resources,
294 .num_resources = ARRAY_SIZE(cmt0_resources),
295};
296
297static struct sh_timer_config cmt1_platform_data = {
298 .channel_offset = 0x08,
299 .timer_bit = 1,
300 .clockevent_rating = 125,
301 .clocksource_rating = 0, /* disabled due to code generation issues */
302};
303
304static struct resource cmt1_resources[] = {
305 [0] = {
306 .start = 0xfffec008,
307 .end = 0xfffec00d,
308 .flags = IORESOURCE_MEM,
309 },
310 [1] = {
311 .start = 143,
312 .flags = IORESOURCE_IRQ,
313 },
314};
315
316static struct platform_device cmt1_device = {
317 .name = "sh_cmt",
318 .id = 1,
319 .dev = {
320 .platform_data = &cmt1_platform_data,
321 },
322 .resource = cmt1_resources,
323 .num_resources = ARRAY_SIZE(cmt1_resources),
324};
325
326static struct sh_timer_config mtu2_0_platform_data = {
327 .channel_offset = -0x80,
328 .timer_bit = 0,
329 .clockevent_rating = 200,
330};
331
332static struct resource mtu2_0_resources[] = {
333 [0] = {
334 .start = 0xfffe4300,
335 .end = 0xfffe4326,
336 .flags = IORESOURCE_MEM,
337 },
338 [1] = {
339 .start = 146,
340 .flags = IORESOURCE_IRQ,
341 },
342}; 276};
343 277
344static struct platform_device mtu2_0_device = { 278static struct platform_device cmt_device = {
345 .name = "sh_mtu2", 279 .name = "sh-cmt-16",
346 .id = 0, 280 .id = 0,
347 .dev = { 281 .dev = {
348 .platform_data = &mtu2_0_platform_data, 282 .platform_data = &cmt_platform_data,
349 }, 283 },
350 .resource = mtu2_0_resources, 284 .resource = cmt_resources,
351 .num_resources = ARRAY_SIZE(mtu2_0_resources), 285 .num_resources = ARRAY_SIZE(cmt_resources),
352}; 286};
353 287
354static struct sh_timer_config mtu2_1_platform_data = { 288static struct resource mtu2_resources[] = {
355 .channel_offset = -0x100, 289 DEFINE_RES_MEM(0xfffe4000, 0x400),
356 .timer_bit = 1, 290 DEFINE_RES_IRQ_NAMED(146, "tgi0a"),
357 .clockevent_rating = 200, 291 DEFINE_RES_IRQ_NAMED(153, "tgi1a"),
358}; 292};
359 293
360static struct resource mtu2_1_resources[] = { 294static struct platform_device mtu2_device = {
361 [0] = { 295 .name = "sh-mtu2",
362 .start = 0xfffe4380, 296 .id = -1,
363 .end = 0xfffe4390, 297 .resource = mtu2_resources,
364 .flags = IORESOURCE_MEM, 298 .num_resources = ARRAY_SIZE(mtu2_resources),
365 },
366 [1] = {
367 .start = 153,
368 .flags = IORESOURCE_IRQ,
369 },
370};
371
372static struct platform_device mtu2_1_device = {
373 .name = "sh_mtu2",
374 .id = 1,
375 .dev = {
376 .platform_data = &mtu2_1_platform_data,
377 },
378 .resource = mtu2_1_resources,
379 .num_resources = ARRAY_SIZE(mtu2_1_resources),
380}; 299};
381 300
382static struct resource rtc_resources[] = { 301static struct resource rtc_resources[] = {
@@ -404,10 +323,8 @@ static struct platform_device *sh7203_devices[] __initdata = {
404 &scif1_device, 323 &scif1_device,
405 &scif2_device, 324 &scif2_device,
406 &scif3_device, 325 &scif3_device,
407 &cmt0_device, 326 &cmt_device,
408 &cmt1_device, 327 &mtu2_device,
409 &mtu2_0_device,
410 &mtu2_1_device,
411 &rtc_device, 328 &rtc_device,
412}; 329};
413 330
@@ -428,10 +345,8 @@ static struct platform_device *sh7203_early_devices[] __initdata = {
428 &scif1_device, 345 &scif1_device,
429 &scif2_device, 346 &scif2_device,
430 &scif3_device, 347 &scif3_device,
431 &cmt0_device, 348 &cmt_device,
432 &cmt1_device, 349 &mtu2_device,
433 &mtu2_0_device,
434 &mtu2_1_device,
435}; 350};
436 351
437#define STBCR3 0xfffe0408 352#define STBCR3 0xfffe0408
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
index 241e745e3ced..49bc5a34bec1 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7206.c
@@ -217,146 +217,38 @@ static struct platform_device scif3_device = {
217 }, 217 },
218}; 218};
219 219
220static struct sh_timer_config cmt0_platform_data = { 220static struct sh_timer_config cmt_platform_data = {
221 .channel_offset = 0x02, 221 .channels_mask = 3,
222 .timer_bit = 0,
223 .clockevent_rating = 125,
224 .clocksource_rating = 0, /* disabled due to code generation issues */
225}; 222};
226 223
227static struct resource cmt0_resources[] = { 224static struct resource cmt_resources[] = {
228 [0] = { 225 DEFINE_RES_MEM(0xfffec000, 0x10),
229 .start = 0xfffec002, 226 DEFINE_RES_IRQ(140),
230 .end = 0xfffec007, 227 DEFINE_RES_IRQ(144),
231 .flags = IORESOURCE_MEM,
232 },
233 [1] = {
234 .start = 140,
235 .flags = IORESOURCE_IRQ,
236 },
237};
238
239static struct platform_device cmt0_device = {
240 .name = "sh_cmt",
241 .id = 0,
242 .dev = {
243 .platform_data = &cmt0_platform_data,
244 },
245 .resource = cmt0_resources,
246 .num_resources = ARRAY_SIZE(cmt0_resources),
247};
248
249static struct sh_timer_config cmt1_platform_data = {
250 .channel_offset = 0x08,
251 .timer_bit = 1,
252 .clockevent_rating = 125,
253 .clocksource_rating = 0, /* disabled due to code generation issues */
254};
255
256static struct resource cmt1_resources[] = {
257 [0] = {
258 .start = 0xfffec008,
259 .end = 0xfffec00d,
260 .flags = IORESOURCE_MEM,
261 },
262 [1] = {
263 .start = 144,
264 .flags = IORESOURCE_IRQ,
265 },
266};
267
268static struct platform_device cmt1_device = {
269 .name = "sh_cmt",
270 .id = 1,
271 .dev = {
272 .platform_data = &cmt1_platform_data,
273 },
274 .resource = cmt1_resources,
275 .num_resources = ARRAY_SIZE(cmt1_resources),
276};
277
278static struct sh_timer_config mtu2_0_platform_data = {
279 .channel_offset = -0x80,
280 .timer_bit = 0,
281 .clockevent_rating = 200,
282};
283
284static struct resource mtu2_0_resources[] = {
285 [0] = {
286 .start = 0xfffe4300,
287 .end = 0xfffe4326,
288 .flags = IORESOURCE_MEM,
289 },
290 [1] = {
291 .start = 156,
292 .flags = IORESOURCE_IRQ,
293 },
294}; 228};
295 229
296static struct platform_device mtu2_0_device = { 230static struct platform_device cmt_device = {
297 .name = "sh_mtu2", 231 .name = "sh-cmt-16",
298 .id = 0, 232 .id = 0,
299 .dev = { 233 .dev = {
300 .platform_data = &mtu2_0_platform_data, 234 .platform_data = &cmt_platform_data,
301 }, 235 },
302 .resource = mtu2_0_resources, 236 .resource = cmt_resources,
303 .num_resources = ARRAY_SIZE(mtu2_0_resources), 237 .num_resources = ARRAY_SIZE(cmt_resources),
304}; 238};
305 239
306static struct sh_timer_config mtu2_1_platform_data = { 240static struct resource mtu2_resources[] = {
307 .channel_offset = -0x100, 241 DEFINE_RES_MEM(0xfffe4000, 0x400),
308 .timer_bit = 1, 242 DEFINE_RES_IRQ_NAMED(156, "tgi0a"),
309 .clockevent_rating = 200, 243 DEFINE_RES_IRQ_NAMED(164, "tgi1a"),
244 DEFINE_RES_IRQ_NAMED(180, "tgi2a"),
310}; 245};
311 246
312static struct resource mtu2_1_resources[] = { 247static struct platform_device mtu2_device = {
313 [0] = { 248 .name = "sh-mtu2s",
314 .start = 0xfffe4380, 249 .id = -1,
315 .end = 0xfffe4390, 250 .resource = mtu2_resources,
316 .flags = IORESOURCE_MEM, 251 .num_resources = ARRAY_SIZE(mtu2_resources),
317 },
318 [1] = {
319 .start = 164,
320 .flags = IORESOURCE_IRQ,
321 },
322};
323
324static struct platform_device mtu2_1_device = {
325 .name = "sh_mtu2",
326 .id = 1,
327 .dev = {
328 .platform_data = &mtu2_1_platform_data,
329 },
330 .resource = mtu2_1_resources,
331 .num_resources = ARRAY_SIZE(mtu2_1_resources),
332};
333
334static struct sh_timer_config mtu2_2_platform_data = {
335 .channel_offset = 0x80,
336 .timer_bit = 2,
337 .clockevent_rating = 200,
338};
339
340static struct resource mtu2_2_resources[] = {
341 [0] = {
342 .start = 0xfffe4000,
343 .end = 0xfffe400a,
344 .flags = IORESOURCE_MEM,
345 },
346 [1] = {
347 .start = 180,
348 .flags = IORESOURCE_IRQ,
349 },
350};
351
352static struct platform_device mtu2_2_device = {
353 .name = "sh_mtu2",
354 .id = 2,
355 .dev = {
356 .platform_data = &mtu2_2_platform_data,
357 },
358 .resource = mtu2_2_resources,
359 .num_resources = ARRAY_SIZE(mtu2_2_resources),
360}; 252};
361 253
362static struct platform_device *sh7206_devices[] __initdata = { 254static struct platform_device *sh7206_devices[] __initdata = {
@@ -364,11 +256,8 @@ static struct platform_device *sh7206_devices[] __initdata = {
364 &scif1_device, 256 &scif1_device,
365 &scif2_device, 257 &scif2_device,
366 &scif3_device, 258 &scif3_device,
367 &cmt0_device, 259 &cmt_device,
368 &cmt1_device, 260 &mtu2_device,
369 &mtu2_0_device,
370 &mtu2_1_device,
371 &mtu2_2_device,
372}; 261};
373 262
374static int __init sh7206_devices_setup(void) 263static int __init sh7206_devices_setup(void)
@@ -388,11 +277,8 @@ static struct platform_device *sh7206_early_devices[] __initdata = {
388 &scif1_device, 277 &scif1_device,
389 &scif2_device, 278 &scif2_device,
390 &scif3_device, 279 &scif3_device,
391 &cmt0_device, 280 &cmt_device,
392 &cmt1_device, 281 &mtu2_device,
393 &mtu2_0_device,
394 &mtu2_1_device,
395 &mtu2_2_device,
396}; 282};
397 283
398#define STBCR3 0xfffe0408 284#define STBCR3 0xfffe0408
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
index ad5b0f429882..608146455562 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7264.c
@@ -433,125 +433,37 @@ static struct platform_device scif7_device = {
433 }, 433 },
434}; 434};
435 435
436static struct sh_timer_config cmt0_platform_data = { 436static struct sh_timer_config cmt_platform_data = {
437 .channel_offset = 0x02, 437 .channels_mask = 3,
438 .timer_bit = 0,
439 .clockevent_rating = 125,
440 .clocksource_rating = 0, /* disabled due to code generation issues */
441}; 438};
442 439
443static struct resource cmt0_resources[] = { 440static struct resource cmt_resources[] = {
444 [0] = { 441 DEFINE_RES_MEM(0xfffec000, 0x10),
445 .name = "CMT0", 442 DEFINE_RES_IRQ(175),
446 .start = 0xfffec002, 443 DEFINE_RES_IRQ(176),
447 .end = 0xfffec007,
448 .flags = IORESOURCE_MEM,
449 },
450 [1] = {
451 .start = 175,
452 .flags = IORESOURCE_IRQ,
453 },
454};
455
456static struct platform_device cmt0_device = {
457 .name = "sh_cmt",
458 .id = 0,
459 .dev = {
460 .platform_data = &cmt0_platform_data,
461 },
462 .resource = cmt0_resources,
463 .num_resources = ARRAY_SIZE(cmt0_resources),
464};
465
466static struct sh_timer_config cmt1_platform_data = {
467 .name = "CMT1",
468 .channel_offset = 0x08,
469 .timer_bit = 1,
470 .clockevent_rating = 125,
471 .clocksource_rating = 0, /* disabled due to code generation issues */
472};
473
474static struct resource cmt1_resources[] = {
475 [0] = {
476 .name = "CMT1",
477 .start = 0xfffec008,
478 .end = 0xfffec00d,
479 .flags = IORESOURCE_MEM,
480 },
481 [1] = {
482 .start = 176,
483 .flags = IORESOURCE_IRQ,
484 },
485};
486
487static struct platform_device cmt1_device = {
488 .name = "sh_cmt",
489 .id = 1,
490 .dev = {
491 .platform_data = &cmt1_platform_data,
492 },
493 .resource = cmt1_resources,
494 .num_resources = ARRAY_SIZE(cmt1_resources),
495};
496
497static struct sh_timer_config mtu2_0_platform_data = {
498 .name = "MTU2_0",
499 .channel_offset = -0x80,
500 .timer_bit = 0,
501 .clockevent_rating = 200,
502};
503
504static struct resource mtu2_0_resources[] = {
505 [0] = {
506 .name = "MTU2_0",
507 .start = 0xfffe4300,
508 .end = 0xfffe4326,
509 .flags = IORESOURCE_MEM,
510 },
511 [1] = {
512 .start = 179,
513 .flags = IORESOURCE_IRQ,
514 },
515}; 444};
516 445
517static struct platform_device mtu2_0_device = { 446static struct platform_device cmt_device = {
518 .name = "sh_mtu2", 447 .name = "sh-cmt-16",
519 .id = 0, 448 .id = 0,
520 .dev = { 449 .dev = {
521 .platform_data = &mtu2_0_platform_data, 450 .platform_data = &cmt_platform_data,
522 }, 451 },
523 .resource = mtu2_0_resources, 452 .resource = cmt_resources,
524 .num_resources = ARRAY_SIZE(mtu2_0_resources), 453 .num_resources = ARRAY_SIZE(cmt_resources),
525}; 454};
526 455
527static struct sh_timer_config mtu2_1_platform_data = { 456static struct resource mtu2_resources[] = {
528 .name = "MTU2_1", 457 DEFINE_RES_MEM(0xfffe4000, 0x400),
529 .channel_offset = -0x100, 458 DEFINE_RES_IRQ_NAMED(179, "tgi0a"),
530 .timer_bit = 1, 459 DEFINE_RES_IRQ_NAMED(186, "tgi1a"),
531 .clockevent_rating = 200,
532}; 460};
533 461
534static struct resource mtu2_1_resources[] = { 462static struct platform_device mtu2_device = {
535 [0] = { 463 .name = "sh-mtu2",
536 .name = "MTU2_1", 464 .id = -1,
537 .start = 0xfffe4380, 465 .resource = mtu2_resources,
538 .end = 0xfffe4390, 466 .num_resources = ARRAY_SIZE(mtu2_resources),
539 .flags = IORESOURCE_MEM,
540 },
541 [1] = {
542 .start = 186,
543 .flags = IORESOURCE_IRQ,
544 },
545};
546
547static struct platform_device mtu2_1_device = {
548 .name = "sh_mtu2",
549 .id = 1,
550 .dev = {
551 .platform_data = &mtu2_1_platform_data,
552 },
553 .resource = mtu2_1_resources,
554 .num_resources = ARRAY_SIZE(mtu2_1_resources),
555}; 467};
556 468
557static struct resource rtc_resources[] = { 469static struct resource rtc_resources[] = {
@@ -620,10 +532,8 @@ static struct platform_device *sh7264_devices[] __initdata = {
620 &scif5_device, 532 &scif5_device,
621 &scif6_device, 533 &scif6_device,
622 &scif7_device, 534 &scif7_device,
623 &cmt0_device, 535 &cmt_device,
624 &cmt1_device, 536 &mtu2_device,
625 &mtu2_0_device,
626 &mtu2_1_device,
627 &rtc_device, 537 &rtc_device,
628 &r8a66597_usb_host_device, 538 &r8a66597_usb_host_device,
629}; 539};
@@ -649,10 +559,8 @@ static struct platform_device *sh7264_early_devices[] __initdata = {
649 &scif5_device, 559 &scif5_device,
650 &scif6_device, 560 &scif6_device,
651 &scif7_device, 561 &scif7_device,
652 &cmt0_device, 562 &cmt_device,
653 &cmt1_device, 563 &mtu2_device,
654 &mtu2_0_device,
655 &mtu2_1_device,
656}; 564};
657 565
658void __init plat_early_device_setup(void) 566void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
index 3995119f65dc..16ce5aa77bdd 100644
--- a/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
+++ b/arch/sh/kernel/cpu/sh2a/setup-sh7269.c
@@ -455,118 +455,37 @@ static struct platform_device scif7_device = {
455 }, 455 },
456}; 456};
457 457
458static struct sh_timer_config cmt0_platform_data = { 458static struct sh_timer_config cmt_platform_data = {
459 .channel_offset = 0x02, 459 .channels_mask = 3,
460 .timer_bit = 0,
461 .clockevent_rating = 125,
462 .clocksource_rating = 0, /* disabled due to code generation issues */
463}; 460};
464 461
465static struct resource cmt0_resources[] = { 462static struct resource cmt_resources[] = {
466 [0] = { 463 DEFINE_RES_MEM(0xfffec000, 0x10),
467 .start = 0xfffec002, 464 DEFINE_RES_IRQ(188),
468 .end = 0xfffec007, 465 DEFINE_RES_IRQ(189),
469 .flags = IORESOURCE_MEM,
470 },
471 [1] = {
472 .start = 188,
473 .flags = IORESOURCE_IRQ,
474 },
475};
476
477static struct platform_device cmt0_device = {
478 .name = "sh_cmt",
479 .id = 0,
480 .dev = {
481 .platform_data = &cmt0_platform_data,
482 },
483 .resource = cmt0_resources,
484 .num_resources = ARRAY_SIZE(cmt0_resources),
485};
486
487static struct sh_timer_config cmt1_platform_data = {
488 .channel_offset = 0x08,
489 .timer_bit = 1,
490 .clockevent_rating = 125,
491 .clocksource_rating = 0, /* disabled due to code generation issues */
492};
493
494static struct resource cmt1_resources[] = {
495 [0] = {
496 .start = 0xfffec008,
497 .end = 0xfffec00d,
498 .flags = IORESOURCE_MEM,
499 },
500 [1] = {
501 .start = 189,
502 .flags = IORESOURCE_IRQ,
503 },
504};
505
506static struct platform_device cmt1_device = {
507 .name = "sh_cmt",
508 .id = 1,
509 .dev = {
510 .platform_data = &cmt1_platform_data,
511 },
512 .resource = cmt1_resources,
513 .num_resources = ARRAY_SIZE(cmt1_resources),
514};
515
516static struct sh_timer_config mtu2_0_platform_data = {
517 .channel_offset = -0x80,
518 .timer_bit = 0,
519 .clockevent_rating = 200,
520};
521
522static struct resource mtu2_0_resources[] = {
523 [0] = {
524 .start = 0xfffe4300,
525 .end = 0xfffe4326,
526 .flags = IORESOURCE_MEM,
527 },
528 [1] = {
529 .start = 192,
530 .flags = IORESOURCE_IRQ,
531 },
532}; 466};
533 467
534static struct platform_device mtu2_0_device = { 468static struct platform_device cmt_device = {
535 .name = "sh_mtu2", 469 .name = "sh-cmt-16",
536 .id = 0, 470 .id = 0,
537 .dev = { 471 .dev = {
538 .platform_data = &mtu2_0_platform_data, 472 .platform_data = &cmt_platform_data,
539 }, 473 },
540 .resource = mtu2_0_resources, 474 .resource = cmt_resources,
541 .num_resources = ARRAY_SIZE(mtu2_0_resources), 475 .num_resources = ARRAY_SIZE(cmt_resources),
542}; 476};
543 477
544static struct sh_timer_config mtu2_1_platform_data = { 478static struct resource mtu2_resources[] = {
545 .channel_offset = -0x100, 479 DEFINE_RES_MEM(0xfffe4000, 0x400),
546 .timer_bit = 1, 480 DEFINE_RES_IRQ_NAMED(192, "tgi0a"),
547 .clockevent_rating = 200, 481 DEFINE_RES_IRQ_NAMED(203, "tgi1a"),
548}; 482};
549 483
550static struct resource mtu2_1_resources[] = { 484static struct platform_device mtu2_device = {
551 [0] = { 485 .name = "sh-mtu2",
552 .start = 0xfffe4380, 486 .id = -1,
553 .end = 0xfffe4390, 487 .resource = mtu2_resources,
554 .flags = IORESOURCE_MEM, 488 .num_resources = ARRAY_SIZE(mtu2_resources),
555 },
556 [1] = {
557 .start = 203,
558 .flags = IORESOURCE_IRQ,
559 },
560};
561
562static struct platform_device mtu2_1_device = {
563 .name = "sh_mtu2",
564 .id = 1,
565 .dev = {
566 .platform_data = &mtu2_1_platform_data,
567 },
568 .resource = mtu2_1_resources,
569 .num_resources = ARRAY_SIZE(mtu2_1_resources),
570}; 489};
571 490
572static struct resource rtc_resources[] = { 491static struct resource rtc_resources[] = {
@@ -629,10 +548,8 @@ static struct platform_device *sh7269_devices[] __initdata = {
629 &scif5_device, 548 &scif5_device,
630 &scif6_device, 549 &scif6_device,
631 &scif7_device, 550 &scif7_device,
632 &cmt0_device, 551 &cmt_device,
633 &cmt1_device, 552 &mtu2_device,
634 &mtu2_0_device,
635 &mtu2_1_device,
636 &rtc_device, 553 &rtc_device,
637 &r8a66597_usb_host_device, 554 &r8a66597_usb_host_device,
638}; 555};
@@ -658,10 +575,8 @@ static struct platform_device *sh7269_early_devices[] __initdata = {
658 &scif5_device, 575 &scif5_device,
659 &scif6_device, 576 &scif6_device,
660 &scif7_device, 577 &scif7_device,
661 &cmt0_device, 578 &cmt_device,
662 &cmt1_device, 579 &mtu2_device,
663 &mtu2_0_device,
664 &mtu2_1_device,
665}; 580};
666 581
667void __init plat_early_device_setup(void) 582void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7705.c b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
index c76b2543b85f..6a72fd14de21 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7705.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7705.c
@@ -143,25 +143,18 @@ static struct platform_device rtc_device = {
143}; 143};
144 144
145static struct sh_timer_config tmu0_platform_data = { 145static struct sh_timer_config tmu0_platform_data = {
146 .channel_offset = 0x02, 146 .channels_mask = 7,
147 .timer_bit = 0,
148 .clockevent_rating = 200,
149}; 147};
150 148
151static struct resource tmu0_resources[] = { 149static struct resource tmu0_resources[] = {
152 [0] = { 150 DEFINE_RES_MEM(0xfffffe90, 0x2c),
153 .start = 0xfffffe94, 151 DEFINE_RES_IRQ(evt2irq(0x400)),
154 .end = 0xfffffe9f, 152 DEFINE_RES_IRQ(evt2irq(0x420)),
155 .flags = IORESOURCE_MEM, 153 DEFINE_RES_IRQ(evt2irq(0x440)),
156 },
157 [1] = {
158 .start = evt2irq(0x400),
159 .flags = IORESOURCE_IRQ,
160 },
161}; 154};
162 155
163static struct platform_device tmu0_device = { 156static struct platform_device tmu0_device = {
164 .name = "sh_tmu", 157 .name = "sh-tmu-sh3",
165 .id = 0, 158 .id = 0,
166 .dev = { 159 .dev = {
167 .platform_data = &tmu0_platform_data, 160 .platform_data = &tmu0_platform_data,
@@ -170,67 +163,10 @@ static struct platform_device tmu0_device = {
170 .num_resources = ARRAY_SIZE(tmu0_resources), 163 .num_resources = ARRAY_SIZE(tmu0_resources),
171}; 164};
172 165
173static struct sh_timer_config tmu1_platform_data = {
174 .channel_offset = 0xe,
175 .timer_bit = 1,
176 .clocksource_rating = 200,
177};
178
179static struct resource tmu1_resources[] = {
180 [0] = {
181 .start = 0xfffffea0,
182 .end = 0xfffffeab,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = evt2irq(0x420),
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device tmu1_device = {
192 .name = "sh_tmu",
193 .id = 1,
194 .dev = {
195 .platform_data = &tmu1_platform_data,
196 },
197 .resource = tmu1_resources,
198 .num_resources = ARRAY_SIZE(tmu1_resources),
199};
200
201static struct sh_timer_config tmu2_platform_data = {
202 .channel_offset = 0x1a,
203 .timer_bit = 2,
204};
205
206static struct resource tmu2_resources[] = {
207 [0] = {
208 .start = 0xfffffeac,
209 .end = 0xfffffebb,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = evt2irq(0x440),
214 .flags = IORESOURCE_IRQ,
215 },
216};
217
218static struct platform_device tmu2_device = {
219 .name = "sh_tmu",
220 .id = 2,
221 .dev = {
222 .platform_data = &tmu2_platform_data,
223 },
224 .resource = tmu2_resources,
225 .num_resources = ARRAY_SIZE(tmu2_resources),
226};
227
228static struct platform_device *sh7705_devices[] __initdata = { 166static struct platform_device *sh7705_devices[] __initdata = {
229 &scif0_device, 167 &scif0_device,
230 &scif1_device, 168 &scif1_device,
231 &tmu0_device, 169 &tmu0_device,
232 &tmu1_device,
233 &tmu2_device,
234 &rtc_device, 170 &rtc_device,
235}; 171};
236 172
@@ -245,8 +181,6 @@ static struct platform_device *sh7705_early_devices[] __initdata = {
245 &scif0_device, 181 &scif0_device,
246 &scif1_device, 182 &scif1_device,
247 &tmu0_device, 183 &tmu0_device,
248 &tmu1_device,
249 &tmu2_device,
250}; 184};
251 185
252void __init plat_early_device_setup(void) 186void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh770x.c b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
index ff1465c0519c..9139d14b9c53 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh770x.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh770x.c
@@ -185,25 +185,18 @@ static struct platform_device scif2_device = {
185#endif 185#endif
186 186
187static struct sh_timer_config tmu0_platform_data = { 187static struct sh_timer_config tmu0_platform_data = {
188 .channel_offset = 0x02, 188 .channels_mask = 7,
189 .timer_bit = 0,
190 .clockevent_rating = 200,
191}; 189};
192 190
193static struct resource tmu0_resources[] = { 191static struct resource tmu0_resources[] = {
194 [0] = { 192 DEFINE_RES_MEM(0xfffffe90, 0x2c),
195 .start = 0xfffffe94, 193 DEFINE_RES_IRQ(evt2irq(0x400)),
196 .end = 0xfffffe9f, 194 DEFINE_RES_IRQ(evt2irq(0x420)),
197 .flags = IORESOURCE_MEM, 195 DEFINE_RES_IRQ(evt2irq(0x440)),
198 },
199 [1] = {
200 .start = evt2irq(0x400),
201 .flags = IORESOURCE_IRQ,
202 },
203}; 196};
204 197
205static struct platform_device tmu0_device = { 198static struct platform_device tmu0_device = {
206 .name = "sh_tmu", 199 .name = "sh-tmu-sh3",
207 .id = 0, 200 .id = 0,
208 .dev = { 201 .dev = {
209 .platform_data = &tmu0_platform_data, 202 .platform_data = &tmu0_platform_data,
@@ -212,61 +205,6 @@ static struct platform_device tmu0_device = {
212 .num_resources = ARRAY_SIZE(tmu0_resources), 205 .num_resources = ARRAY_SIZE(tmu0_resources),
213}; 206};
214 207
215static struct sh_timer_config tmu1_platform_data = {
216 .channel_offset = 0xe,
217 .timer_bit = 1,
218 .clocksource_rating = 200,
219};
220
221static struct resource tmu1_resources[] = {
222 [0] = {
223 .start = 0xfffffea0,
224 .end = 0xfffffeab,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x420),
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu1_device = {
234 .name = "sh_tmu",
235 .id = 1,
236 .dev = {
237 .platform_data = &tmu1_platform_data,
238 },
239 .resource = tmu1_resources,
240 .num_resources = ARRAY_SIZE(tmu1_resources),
241};
242
243static struct sh_timer_config tmu2_platform_data = {
244 .channel_offset = 0x1a,
245 .timer_bit = 2,
246};
247
248static struct resource tmu2_resources[] = {
249 [0] = {
250 .start = 0xfffffeac,
251 .end = 0xfffffebb,
252 .flags = IORESOURCE_MEM,
253 },
254 [1] = {
255 .start = evt2irq(0x440),
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device tmu2_device = {
261 .name = "sh_tmu",
262 .id = 2,
263 .dev = {
264 .platform_data = &tmu2_platform_data,
265 },
266 .resource = tmu2_resources,
267 .num_resources = ARRAY_SIZE(tmu2_resources),
268};
269
270static struct platform_device *sh770x_devices[] __initdata = { 208static struct platform_device *sh770x_devices[] __initdata = {
271 &scif0_device, 209 &scif0_device,
272#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \ 210#if defined(CONFIG_CPU_SUBTYPE_SH7706) || \
@@ -279,8 +217,6 @@ static struct platform_device *sh770x_devices[] __initdata = {
279 &scif2_device, 217 &scif2_device,
280#endif 218#endif
281 &tmu0_device, 219 &tmu0_device,
282 &tmu1_device,
283 &tmu2_device,
284 &rtc_device, 220 &rtc_device,
285}; 221};
286 222
@@ -303,8 +239,6 @@ static struct platform_device *sh770x_early_devices[] __initdata = {
303 &scif2_device, 239 &scif2_device,
304#endif 240#endif
305 &tmu0_device, 241 &tmu0_device,
306 &tmu1_device,
307 &tmu2_device,
308}; 242};
309 243
310void __init plat_early_device_setup(void) 244void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7710.c b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
index e2ce9360ed5a..e9ed300dba5c 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7710.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7710.c
@@ -142,25 +142,18 @@ static struct platform_device scif1_device = {
142}; 142};
143 143
144static struct sh_timer_config tmu0_platform_data = { 144static struct sh_timer_config tmu0_platform_data = {
145 .channel_offset = 0x02, 145 .channels_mask = 7,
146 .timer_bit = 0,
147 .clockevent_rating = 200,
148}; 146};
149 147
150static struct resource tmu0_resources[] = { 148static struct resource tmu0_resources[] = {
151 [0] = { 149 DEFINE_RES_MEM(0xa412fe90, 0x28),
152 .start = 0xa412fe94, 150 DEFINE_RES_IRQ(evt2irq(0x400)),
153 .end = 0xa412fe9f, 151 DEFINE_RES_IRQ(evt2irq(0x420)),
154 .flags = IORESOURCE_MEM, 152 DEFINE_RES_IRQ(evt2irq(0x440)),
155 },
156 [1] = {
157 .start = evt2irq(0x400),
158 .flags = IORESOURCE_IRQ,
159 },
160}; 153};
161 154
162static struct platform_device tmu0_device = { 155static struct platform_device tmu0_device = {
163 .name = "sh_tmu", 156 .name = "sh-tmu-sh3",
164 .id = 0, 157 .id = 0,
165 .dev = { 158 .dev = {
166 .platform_data = &tmu0_platform_data, 159 .platform_data = &tmu0_platform_data,
@@ -169,67 +162,10 @@ static struct platform_device tmu0_device = {
169 .num_resources = ARRAY_SIZE(tmu0_resources), 162 .num_resources = ARRAY_SIZE(tmu0_resources),
170}; 163};
171 164
172static struct sh_timer_config tmu1_platform_data = {
173 .channel_offset = 0xe,
174 .timer_bit = 1,
175 .clocksource_rating = 200,
176};
177
178static struct resource tmu1_resources[] = {
179 [0] = {
180 .start = 0xa412fea0,
181 .end = 0xa412feab,
182 .flags = IORESOURCE_MEM,
183 },
184 [1] = {
185 .start = evt2irq(0x420),
186 .flags = IORESOURCE_IRQ,
187 },
188};
189
190static struct platform_device tmu1_device = {
191 .name = "sh_tmu",
192 .id = 1,
193 .dev = {
194 .platform_data = &tmu1_platform_data,
195 },
196 .resource = tmu1_resources,
197 .num_resources = ARRAY_SIZE(tmu1_resources),
198};
199
200static struct sh_timer_config tmu2_platform_data = {
201 .channel_offset = 0x1a,
202 .timer_bit = 2,
203};
204
205static struct resource tmu2_resources[] = {
206 [0] = {
207 .start = 0xa412feac,
208 .end = 0xa412feb5,
209 .flags = IORESOURCE_MEM,
210 },
211 [1] = {
212 .start = evt2irq(0x440),
213 .flags = IORESOURCE_IRQ,
214 },
215};
216
217static struct platform_device tmu2_device = {
218 .name = "sh_tmu",
219 .id = 2,
220 .dev = {
221 .platform_data = &tmu2_platform_data,
222 },
223 .resource = tmu2_resources,
224 .num_resources = ARRAY_SIZE(tmu2_resources),
225};
226
227static struct platform_device *sh7710_devices[] __initdata = { 165static struct platform_device *sh7710_devices[] __initdata = {
228 &scif0_device, 166 &scif0_device,
229 &scif1_device, 167 &scif1_device,
230 &tmu0_device, 168 &tmu0_device,
231 &tmu1_device,
232 &tmu2_device,
233 &rtc_device, 169 &rtc_device,
234}; 170};
235 171
@@ -244,8 +180,6 @@ static struct platform_device *sh7710_early_devices[] __initdata = {
244 &scif0_device, 180 &scif0_device,
245 &scif1_device, 181 &scif1_device,
246 &tmu0_device, 182 &tmu0_device,
247 &tmu1_device,
248 &tmu2_device,
249}; 183};
250 184
251void __init plat_early_device_setup(void) 185void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh3/setup-sh7720.c b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
index 1d5729dc0724..84df85a5b800 100644
--- a/arch/sh/kernel/cpu/sh3/setup-sh7720.c
+++ b/arch/sh/kernel/cpu/sh3/setup-sh7720.c
@@ -152,163 +152,38 @@ static struct platform_device usbf_device = {
152 .resource = usbf_resources, 152 .resource = usbf_resources,
153}; 153};
154 154
155static struct sh_timer_config cmt0_platform_data = { 155static struct sh_timer_config cmt_platform_data = {
156 .channel_offset = 0x10, 156 .channels_mask = 0x1f,
157 .timer_bit = 0,
158 .clockevent_rating = 125,
159 .clocksource_rating = 125,
160}; 157};
161 158
162static struct resource cmt0_resources[] = { 159static struct resource cmt_resources[] = {
163 [0] = { 160 DEFINE_RES_MEM(0x044a0000, 0x60),
164 .start = 0x044a0010, 161 DEFINE_RES_IRQ(evt2irq(0xf00)),
165 .end = 0x044a001b,
166 .flags = IORESOURCE_MEM,
167 },
168 [1] = {
169 .start = evt2irq(0xf00),
170 .flags = IORESOURCE_IRQ,
171 },
172}; 162};
173 163
174static struct platform_device cmt0_device = { 164static struct platform_device cmt_device = {
175 .name = "sh_cmt", 165 .name = "sh-cmt-32",
176 .id = 0, 166 .id = 0,
177 .dev = { 167 .dev = {
178 .platform_data = &cmt0_platform_data, 168 .platform_data = &cmt_platform_data,
179 },
180 .resource = cmt0_resources,
181 .num_resources = ARRAY_SIZE(cmt0_resources),
182};
183
184static struct sh_timer_config cmt1_platform_data = {
185 .channel_offset = 0x20,
186 .timer_bit = 1,
187};
188
189static struct resource cmt1_resources[] = {
190 [0] = {
191 .start = 0x044a0020,
192 .end = 0x044a002b,
193 .flags = IORESOURCE_MEM,
194 },
195 [1] = {
196 .start = evt2irq(0xf00),
197 .flags = IORESOURCE_IRQ,
198 },
199};
200
201static struct platform_device cmt1_device = {
202 .name = "sh_cmt",
203 .id = 1,
204 .dev = {
205 .platform_data = &cmt1_platform_data,
206 },
207 .resource = cmt1_resources,
208 .num_resources = ARRAY_SIZE(cmt1_resources),
209};
210
211static struct sh_timer_config cmt2_platform_data = {
212 .channel_offset = 0x30,
213 .timer_bit = 2,
214};
215
216static struct resource cmt2_resources[] = {
217 [0] = {
218 .start = 0x044a0030,
219 .end = 0x044a003b,
220 .flags = IORESOURCE_MEM,
221 },
222 [1] = {
223 .start = evt2irq(0xf00),
224 .flags = IORESOURCE_IRQ,
225 },
226};
227
228static struct platform_device cmt2_device = {
229 .name = "sh_cmt",
230 .id = 2,
231 .dev = {
232 .platform_data = &cmt2_platform_data,
233 },
234 .resource = cmt2_resources,
235 .num_resources = ARRAY_SIZE(cmt2_resources),
236};
237
238static struct sh_timer_config cmt3_platform_data = {
239 .channel_offset = 0x40,
240 .timer_bit = 3,
241};
242
243static struct resource cmt3_resources[] = {
244 [0] = {
245 .start = 0x044a0040,
246 .end = 0x044a004b,
247 .flags = IORESOURCE_MEM,
248 },
249 [1] = {
250 .start = evt2irq(0xf00),
251 .flags = IORESOURCE_IRQ,
252 },
253};
254
255static struct platform_device cmt3_device = {
256 .name = "sh_cmt",
257 .id = 3,
258 .dev = {
259 .platform_data = &cmt3_platform_data,
260 }, 169 },
261 .resource = cmt3_resources, 170 .resource = cmt_resources,
262 .num_resources = ARRAY_SIZE(cmt3_resources), 171 .num_resources = ARRAY_SIZE(cmt_resources),
263};
264
265static struct sh_timer_config cmt4_platform_data = {
266 .channel_offset = 0x50,
267 .timer_bit = 4,
268};
269
270static struct resource cmt4_resources[] = {
271 [0] = {
272 .start = 0x044a0050,
273 .end = 0x044a005b,
274 .flags = IORESOURCE_MEM,
275 },
276 [1] = {
277 .start = evt2irq(0xf00),
278 .flags = IORESOURCE_IRQ,
279 },
280};
281
282static struct platform_device cmt4_device = {
283 .name = "sh_cmt",
284 .id = 4,
285 .dev = {
286 .platform_data = &cmt4_platform_data,
287 },
288 .resource = cmt4_resources,
289 .num_resources = ARRAY_SIZE(cmt4_resources),
290}; 172};
291 173
292static struct sh_timer_config tmu0_platform_data = { 174static struct sh_timer_config tmu0_platform_data = {
293 .channel_offset = 0x02, 175 .channels_mask = 7,
294 .timer_bit = 0,
295 .clockevent_rating = 200,
296}; 176};
297 177
298static struct resource tmu0_resources[] = { 178static struct resource tmu0_resources[] = {
299 [0] = { 179 DEFINE_RES_MEM(0xa412fe90, 0x28),
300 .start = 0xa412fe94, 180 DEFINE_RES_IRQ(evt2irq(0x400)),
301 .end = 0xa412fe9f, 181 DEFINE_RES_IRQ(evt2irq(0x420)),
302 .flags = IORESOURCE_MEM, 182 DEFINE_RES_IRQ(evt2irq(0x440)),
303 },
304 [1] = {
305 .start = evt2irq(0x400),
306 .flags = IORESOURCE_IRQ,
307 },
308}; 183};
309 184
310static struct platform_device tmu0_device = { 185static struct platform_device tmu0_device = {
311 .name = "sh_tmu", 186 .name = "sh-tmu-sh3",
312 .id = 0, 187 .id = 0,
313 .dev = { 188 .dev = {
314 .platform_data = &tmu0_platform_data, 189 .platform_data = &tmu0_platform_data,
@@ -317,72 +192,11 @@ static struct platform_device tmu0_device = {
317 .num_resources = ARRAY_SIZE(tmu0_resources), 192 .num_resources = ARRAY_SIZE(tmu0_resources),
318}; 193};
319 194
320static struct sh_timer_config tmu1_platform_data = {
321 .channel_offset = 0xe,
322 .timer_bit = 1,
323 .clocksource_rating = 200,
324};
325
326static struct resource tmu1_resources[] = {
327 [0] = {
328 .start = 0xa412fea0,
329 .end = 0xa412feab,
330 .flags = IORESOURCE_MEM,
331 },
332 [1] = {
333 .start = evt2irq(0x420),
334 .flags = IORESOURCE_IRQ,
335 },
336};
337
338static struct platform_device tmu1_device = {
339 .name = "sh_tmu",
340 .id = 1,
341 .dev = {
342 .platform_data = &tmu1_platform_data,
343 },
344 .resource = tmu1_resources,
345 .num_resources = ARRAY_SIZE(tmu1_resources),
346};
347
348static struct sh_timer_config tmu2_platform_data = {
349 .channel_offset = 0x1a,
350 .timer_bit = 2,
351};
352
353static struct resource tmu2_resources[] = {
354 [0] = {
355 .start = 0xa412feac,
356 .end = 0xa412feb5,
357 .flags = IORESOURCE_MEM,
358 },
359 [1] = {
360 .start = evt2irq(0x440),
361 .flags = IORESOURCE_IRQ,
362 },
363};
364
365static struct platform_device tmu2_device = {
366 .name = "sh_tmu",
367 .id = 2,
368 .dev = {
369 .platform_data = &tmu2_platform_data,
370 },
371 .resource = tmu2_resources,
372 .num_resources = ARRAY_SIZE(tmu2_resources),
373};
374
375static struct platform_device *sh7720_devices[] __initdata = { 195static struct platform_device *sh7720_devices[] __initdata = {
376 &scif0_device, 196 &scif0_device,
377 &scif1_device, 197 &scif1_device,
378 &cmt0_device, 198 &cmt_device,
379 &cmt1_device,
380 &cmt2_device,
381 &cmt3_device,
382 &cmt4_device,
383 &tmu0_device, 199 &tmu0_device,
384 &tmu1_device,
385 &tmu2_device,
386 &rtc_device, 200 &rtc_device,
387 &usb_ohci_device, 201 &usb_ohci_device,
388 &usbf_device, 202 &usbf_device,
@@ -398,14 +212,8 @@ arch_initcall(sh7720_devices_setup);
398static struct platform_device *sh7720_early_devices[] __initdata = { 212static struct platform_device *sh7720_early_devices[] __initdata = {
399 &scif0_device, 213 &scif0_device,
400 &scif1_device, 214 &scif1_device,
401 &cmt0_device, 215 &cmt_device,
402 &cmt1_device,
403 &cmt2_device,
404 &cmt3_device,
405 &cmt4_device,
406 &tmu0_device, 216 &tmu0_device,
407 &tmu1_device,
408 &tmu2_device,
409}; 217};
410 218
411void __init plat_early_device_setup(void) 219void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
index a8bd778d5ac8..e7a7b3cdf68d 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh4-202.c
@@ -41,25 +41,18 @@ static struct platform_device scif0_device = {
41}; 41};
42 42
43static struct sh_timer_config tmu0_platform_data = { 43static struct sh_timer_config tmu0_platform_data = {
44 .channel_offset = 0x04, 44 .channels_mask = 7,
45 .timer_bit = 0,
46 .clockevent_rating = 200,
47}; 45};
48 46
49static struct resource tmu0_resources[] = { 47static struct resource tmu0_resources[] = {
50 [0] = { 48 DEFINE_RES_MEM(0xffd80000, 0x30),
51 .start = 0xffd80008, 49 DEFINE_RES_IRQ(evt2irq(0x400)),
52 .end = 0xffd80013, 50 DEFINE_RES_IRQ(evt2irq(0x420)),
53 .flags = IORESOURCE_MEM, 51 DEFINE_RES_IRQ(evt2irq(0x440)),
54 },
55 [1] = {
56 .start = evt2irq(0x400),
57 .flags = IORESOURCE_IRQ,
58 },
59}; 52};
60 53
61static struct platform_device tmu0_device = { 54static struct platform_device tmu0_device = {
62 .name = "sh_tmu", 55 .name = "sh-tmu",
63 .id = 0, 56 .id = 0,
64 .dev = { 57 .dev = {
65 .platform_data = &tmu0_platform_data, 58 .platform_data = &tmu0_platform_data,
@@ -68,66 +61,9 @@ static struct platform_device tmu0_device = {
68 .num_resources = ARRAY_SIZE(tmu0_resources), 61 .num_resources = ARRAY_SIZE(tmu0_resources),
69}; 62};
70 63
71static struct sh_timer_config tmu1_platform_data = {
72 .channel_offset = 0x10,
73 .timer_bit = 1,
74 .clocksource_rating = 200,
75};
76
77static struct resource tmu1_resources[] = {
78 [0] = {
79 .start = 0xffd80014,
80 .end = 0xffd8001f,
81 .flags = IORESOURCE_MEM,
82 },
83 [1] = {
84 .start = evt2irq(0x420),
85 .flags = IORESOURCE_IRQ,
86 },
87};
88
89static struct platform_device tmu1_device = {
90 .name = "sh_tmu",
91 .id = 1,
92 .dev = {
93 .platform_data = &tmu1_platform_data,
94 },
95 .resource = tmu1_resources,
96 .num_resources = ARRAY_SIZE(tmu1_resources),
97};
98
99static struct sh_timer_config tmu2_platform_data = {
100 .channel_offset = 0x1c,
101 .timer_bit = 2,
102};
103
104static struct resource tmu2_resources[] = {
105 [0] = {
106 .start = 0xffd80020,
107 .end = 0xffd8002f,
108 .flags = IORESOURCE_MEM,
109 },
110 [1] = {
111 .start = evt2irq(0x440),
112 .flags = IORESOURCE_IRQ,
113 },
114};
115
116static struct platform_device tmu2_device = {
117 .name = "sh_tmu",
118 .id = 2,
119 .dev = {
120 .platform_data = &tmu2_platform_data,
121 },
122 .resource = tmu2_resources,
123 .num_resources = ARRAY_SIZE(tmu2_resources),
124};
125
126static struct platform_device *sh4202_devices[] __initdata = { 64static struct platform_device *sh4202_devices[] __initdata = {
127 &scif0_device, 65 &scif0_device,
128 &tmu0_device, 66 &tmu0_device,
129 &tmu1_device,
130 &tmu2_device,
131}; 67};
132 68
133static int __init sh4202_devices_setup(void) 69static int __init sh4202_devices_setup(void)
@@ -140,8 +76,6 @@ arch_initcall(sh4202_devices_setup);
140static struct platform_device *sh4202_early_devices[] __initdata = { 76static struct platform_device *sh4202_early_devices[] __initdata = {
141 &scif0_device, 77 &scif0_device,
142 &tmu0_device, 78 &tmu0_device,
143 &tmu1_device,
144 &tmu2_device,
145}; 79};
146 80
147void __init plat_early_device_setup(void) 81void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7750.c b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
index a447a248491f..5f08c59b9f3e 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7750.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7750.c
@@ -82,25 +82,18 @@ static struct platform_device scif_device = {
82}; 82};
83 83
84static struct sh_timer_config tmu0_platform_data = { 84static struct sh_timer_config tmu0_platform_data = {
85 .channel_offset = 0x04, 85 .channels_mask = 7,
86 .timer_bit = 0,
87 .clockevent_rating = 200,
88}; 86};
89 87
90static struct resource tmu0_resources[] = { 88static struct resource tmu0_resources[] = {
91 [0] = { 89 DEFINE_RES_MEM(0xffd80000, 0x30),
92 .start = 0xffd80008, 90 DEFINE_RES_IRQ(evt2irq(0x400)),
93 .end = 0xffd80013, 91 DEFINE_RES_IRQ(evt2irq(0x420)),
94 .flags = IORESOURCE_MEM, 92 DEFINE_RES_IRQ(evt2irq(0x440)),
95 },
96 [1] = {
97 .start = evt2irq(0x400),
98 .flags = IORESOURCE_IRQ,
99 },
100}; 93};
101 94
102static struct platform_device tmu0_device = { 95static struct platform_device tmu0_device = {
103 .name = "sh_tmu", 96 .name = "sh-tmu",
104 .id = 0, 97 .id = 0,
105 .dev = { 98 .dev = {
106 .platform_data = &tmu0_platform_data, 99 .platform_data = &tmu0_platform_data,
@@ -109,26 +102,23 @@ static struct platform_device tmu0_device = {
109 .num_resources = ARRAY_SIZE(tmu0_resources), 102 .num_resources = ARRAY_SIZE(tmu0_resources),
110}; 103};
111 104
105/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
106#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
107 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
108 defined(CONFIG_CPU_SUBTYPE_SH7751R)
109
112static struct sh_timer_config tmu1_platform_data = { 110static struct sh_timer_config tmu1_platform_data = {
113 .channel_offset = 0x10, 111 .channels_mask = 3,
114 .timer_bit = 1,
115 .clocksource_rating = 200,
116}; 112};
117 113
118static struct resource tmu1_resources[] = { 114static struct resource tmu1_resources[] = {
119 [0] = { 115 DEFINE_RES_MEM(0xfe100000, 0x20),
120 .start = 0xffd80014, 116 DEFINE_RES_IRQ(evt2irq(0xb00)),
121 .end = 0xffd8001f, 117 DEFINE_RES_IRQ(evt2irq(0xb80)),
122 .flags = IORESOURCE_MEM,
123 },
124 [1] = {
125 .start = evt2irq(0x420),
126 .flags = IORESOURCE_IRQ,
127 },
128}; 118};
129 119
130static struct platform_device tmu1_device = { 120static struct platform_device tmu1_device = {
131 .name = "sh_tmu", 121 .name = "sh-tmu",
132 .id = 1, 122 .id = 1,
133 .dev = { 123 .dev = {
134 .platform_data = &tmu1_platform_data, 124 .platform_data = &tmu1_platform_data,
@@ -137,104 +127,15 @@ static struct platform_device tmu1_device = {
137 .num_resources = ARRAY_SIZE(tmu1_resources), 127 .num_resources = ARRAY_SIZE(tmu1_resources),
138}; 128};
139 129
140static struct sh_timer_config tmu2_platform_data = {
141 .channel_offset = 0x1c,
142 .timer_bit = 2,
143};
144
145static struct resource tmu2_resources[] = {
146 [0] = {
147 .start = 0xffd80020,
148 .end = 0xffd8002f,
149 .flags = IORESOURCE_MEM,
150 },
151 [1] = {
152 .start = evt2irq(0x440),
153 .flags = IORESOURCE_IRQ,
154 },
155};
156
157static struct platform_device tmu2_device = {
158 .name = "sh_tmu",
159 .id = 2,
160 .dev = {
161 .platform_data = &tmu2_platform_data,
162 },
163 .resource = tmu2_resources,
164 .num_resources = ARRAY_SIZE(tmu2_resources),
165};
166
167/* SH7750R, SH7751 and SH7751R all have two extra timer channels */
168#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
169 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
170 defined(CONFIG_CPU_SUBTYPE_SH7751R)
171
172static struct sh_timer_config tmu3_platform_data = {
173 .channel_offset = 0x04,
174 .timer_bit = 0,
175};
176
177static struct resource tmu3_resources[] = {
178 [0] = {
179 .start = 0xfe100008,
180 .end = 0xfe100013,
181 .flags = IORESOURCE_MEM,
182 },
183 [1] = {
184 .start = evt2irq(0xb00),
185 .flags = IORESOURCE_IRQ,
186 },
187};
188
189static struct platform_device tmu3_device = {
190 .name = "sh_tmu",
191 .id = 3,
192 .dev = {
193 .platform_data = &tmu3_platform_data,
194 },
195 .resource = tmu3_resources,
196 .num_resources = ARRAY_SIZE(tmu3_resources),
197};
198
199static struct sh_timer_config tmu4_platform_data = {
200 .channel_offset = 0x10,
201 .timer_bit = 1,
202};
203
204static struct resource tmu4_resources[] = {
205 [0] = {
206 .start = 0xfe100014,
207 .end = 0xfe10001f,
208 .flags = IORESOURCE_MEM,
209 },
210 [1] = {
211 .start = evt2irq(0xb80),
212 .flags = IORESOURCE_IRQ,
213 },
214};
215
216static struct platform_device tmu4_device = {
217 .name = "sh_tmu",
218 .id = 4,
219 .dev = {
220 .platform_data = &tmu4_platform_data,
221 },
222 .resource = tmu4_resources,
223 .num_resources = ARRAY_SIZE(tmu4_resources),
224};
225
226#endif 130#endif
227 131
228static struct platform_device *sh7750_devices[] __initdata = { 132static struct platform_device *sh7750_devices[] __initdata = {
229 &rtc_device, 133 &rtc_device,
230 &tmu0_device, 134 &tmu0_device,
231 &tmu1_device,
232 &tmu2_device,
233#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 135#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
234 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 136 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
235 defined(CONFIG_CPU_SUBTYPE_SH7751R) 137 defined(CONFIG_CPU_SUBTYPE_SH7751R)
236 &tmu3_device, 138 &tmu1_device,
237 &tmu4_device,
238#endif 139#endif
239}; 140};
240 141
@@ -254,13 +155,10 @@ arch_initcall(sh7750_devices_setup);
254 155
255static struct platform_device *sh7750_early_devices[] __initdata = { 156static struct platform_device *sh7750_early_devices[] __initdata = {
256 &tmu0_device, 157 &tmu0_device,
257 &tmu1_device,
258 &tmu2_device,
259#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \ 158#if defined(CONFIG_CPU_SUBTYPE_SH7750R) || \
260 defined(CONFIG_CPU_SUBTYPE_SH7751) || \ 159 defined(CONFIG_CPU_SUBTYPE_SH7751) || \
261 defined(CONFIG_CPU_SUBTYPE_SH7751R) 160 defined(CONFIG_CPU_SUBTYPE_SH7751R)
262 &tmu3_device, 161 &tmu1_device,
263 &tmu4_device,
264#endif 162#endif
265}; 163};
266 164
diff --git a/arch/sh/kernel/cpu/sh4/setup-sh7760.c b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
index 1abd9fb4a386..973b736b3b98 100644
--- a/arch/sh/kernel/cpu/sh4/setup-sh7760.c
+++ b/arch/sh/kernel/cpu/sh4/setup-sh7760.c
@@ -227,25 +227,18 @@ static struct platform_device scif3_device = {
227}; 227};
228 228
229static struct sh_timer_config tmu0_platform_data = { 229static struct sh_timer_config tmu0_platform_data = {
230 .channel_offset = 0x04, 230 .channels_mask = 7,
231 .timer_bit = 0,
232 .clockevent_rating = 200,
233}; 231};
234 232
235static struct resource tmu0_resources[] = { 233static struct resource tmu0_resources[] = {
236 [0] = { 234 DEFINE_RES_MEM(0xffd80000, 0x30),
237 .start = 0xffd80008, 235 DEFINE_RES_IRQ(evt2irq(0x400)),
238 .end = 0xffd80013, 236 DEFINE_RES_IRQ(evt2irq(0x420)),
239 .flags = IORESOURCE_MEM, 237 DEFINE_RES_IRQ(evt2irq(0x440)),
240 },
241 [1] = {
242 .start = evt2irq(0x400),
243 .flags = IORESOURCE_IRQ,
244 },
245}; 238};
246 239
247static struct platform_device tmu0_device = { 240static struct platform_device tmu0_device = {
248 .name = "sh_tmu", 241 .name = "sh-tmu",
249 .id = 0, 242 .id = 0,
250 .dev = { 243 .dev = {
251 .platform_data = &tmu0_platform_data, 244 .platform_data = &tmu0_platform_data,
@@ -254,61 +247,6 @@ static struct platform_device tmu0_device = {
254 .num_resources = ARRAY_SIZE(tmu0_resources), 247 .num_resources = ARRAY_SIZE(tmu0_resources),
255}; 248};
256 249
257static struct sh_timer_config tmu1_platform_data = {
258 .channel_offset = 0x10,
259 .timer_bit = 1,
260 .clocksource_rating = 200,
261};
262
263static struct resource tmu1_resources[] = {
264 [0] = {
265 .start = 0xffd80014,
266 .end = 0xffd8001f,
267 .flags = IORESOURCE_MEM,
268 },
269 [1] = {
270 .start = evt2irq(0x420),
271 .flags = IORESOURCE_IRQ,
272 },
273};
274
275static struct platform_device tmu1_device = {
276 .name = "sh_tmu",
277 .id = 1,
278 .dev = {
279 .platform_data = &tmu1_platform_data,
280 },
281 .resource = tmu1_resources,
282 .num_resources = ARRAY_SIZE(tmu1_resources),
283};
284
285static struct sh_timer_config tmu2_platform_data = {
286 .channel_offset = 0x1c,
287 .timer_bit = 2,
288};
289
290static struct resource tmu2_resources[] = {
291 [0] = {
292 .start = 0xffd80020,
293 .end = 0xffd8002f,
294 .flags = IORESOURCE_MEM,
295 },
296 [1] = {
297 .start = evt2irq(0x440),
298 .flags = IORESOURCE_IRQ,
299 },
300};
301
302static struct platform_device tmu2_device = {
303 .name = "sh_tmu",
304 .id = 2,
305 .dev = {
306 .platform_data = &tmu2_platform_data,
307 },
308 .resource = tmu2_resources,
309 .num_resources = ARRAY_SIZE(tmu2_resources),
310};
311
312 250
313static struct platform_device *sh7760_devices[] __initdata = { 251static struct platform_device *sh7760_devices[] __initdata = {
314 &scif0_device, 252 &scif0_device,
@@ -316,8 +254,6 @@ static struct platform_device *sh7760_devices[] __initdata = {
316 &scif2_device, 254 &scif2_device,
317 &scif3_device, 255 &scif3_device,
318 &tmu0_device, 256 &tmu0_device,
319 &tmu1_device,
320 &tmu2_device,
321}; 257};
322 258
323static int __init sh7760_devices_setup(void) 259static int __init sh7760_devices_setup(void)
@@ -333,8 +269,6 @@ static struct platform_device *sh7760_early_devices[] __initdata = {
333 &scif2_device, 269 &scif2_device,
334 &scif3_device, 270 &scif3_device,
335 &tmu0_device, 271 &tmu0_device,
336 &tmu1_device,
337 &tmu2_device,
338}; 272};
339 273
340void __init plat_early_device_setup(void) 274void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
index 53638e231cd0..9edc06c02dcf 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
@@ -227,7 +227,7 @@ static struct clk_lookup lookups[] = {
227 CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]), 227 CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
228 CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]), 228 CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
229 CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), 229 CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]),
230 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]), 230 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),
231 CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]), 231 CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
232 CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), 232 CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
233 CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), 233 CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
index 22e485d1990b..955b9add7810 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
@@ -225,7 +225,7 @@ static struct clk_lookup lookups[] = {
225 CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]), 225 CLKDEV_CON_ID("hudi0", &mstp_clks[MSTP019]),
226 CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]), 226 CLKDEV_CON_ID("ubc0", &mstp_clks[MSTP017]),
227 CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]), 227 CLKDEV_CON_ID("tmu_fck", &mstp_clks[MSTP015]),
228 CLKDEV_CON_ID("cmt_fck", &mstp_clks[MSTP014]), 228 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[MSTP014]),
229 CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]), 229 CLKDEV_CON_ID("rwdt0", &mstp_clks[MSTP013]),
230 CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]), 230 CLKDEV_CON_ID("mfi0", &mstp_clks[MSTP011]),
231 CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]), 231 CLKDEV_CON_ID("flctl0", &mstp_clks[MSTP010]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
index c4cb740e4d10..8f07a1a38692 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
@@ -203,11 +203,9 @@ static struct clk_lookup lookups[] = {
203 CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]), 203 CLKDEV_CON_ID("uram0", &mstp_clks[HWBLK_URAM]),
204 CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]), 204 CLKDEV_CON_ID("xymem0", &mstp_clks[HWBLK_XYMEM]),
205 205
206 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU]), 206 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU]),
207 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU]),
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU]),
209 207
210 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 208 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
211 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 209 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
212 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), 210 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
213 211
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
index 37c41c7747a3..ccbcab550df2 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
@@ -236,7 +236,7 @@ static struct clk_lookup lookups[] = {
236 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]), 236 CLKDEV_CON_ID("sh0", &mstp_clks[HWBLK_SHYWAY]),
237 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), 237 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
238 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 238 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
239 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 239 CLKDEV_ICK_ID("fck", "sh-cmt-32.0", &mstp_clks[HWBLK_CMT]),
240 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 240 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
241 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), 241 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
242 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]), 242 CLKDEV_CON_ID("flctl0", &mstp_clks[HWBLK_FLCTL]),
@@ -264,12 +264,8 @@ static struct clk_lookup lookups[] = {
264 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]), 264 CLKDEV_CON_ID("veu0", &mstp_clks[HWBLK_VEU2H0]),
265 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]), 265 CLKDEV_CON_ID("vpu0", &mstp_clks[HWBLK_VPU]),
266 266
267 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), 267 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
268 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), 268 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
269 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
270 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
271 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
272 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
273 269
274 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 270 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
275 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 271 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
index 0128af3399b7..f579dd528198 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
@@ -304,17 +304,13 @@ static struct clk_lookup lookups[] = {
304 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]), 304 CLKDEV_CON_ID("hudi0", &mstp_clks[HWBLK_HUDI]),
305 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]), 305 CLKDEV_CON_ID("ubc0", &mstp_clks[HWBLK_UBC]),
306 306
307 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[HWBLK_TMU0]), 307 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[HWBLK_TMU0]),
308 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[HWBLK_TMU0]), 308 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[HWBLK_TMU1]),
309 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[HWBLK_TMU0]),
310 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[HWBLK_TMU1]),
311 309
312 CLKDEV_CON_ID("cmt_fck", &mstp_clks[HWBLK_CMT]), 310 CLKDEV_ICK_ID("fck", "sh-cmt-16.0", &mstp_clks[HWBLK_CMT]),
313 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]), 311 CLKDEV_DEV_ID("sh-wdt.0", &mstp_clks[HWBLK_RWDT]),
314 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]), 312 CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[HWBLK_DMAC1]),
315 313
316 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[HWBLK_TMU1]),
317 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[HWBLK_TMU1]),
318 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]), 314 CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[HWBLK_SCIF0]),
319 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]), 315 CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[HWBLK_SCIF1]),
320 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]), 316 CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[HWBLK_SCIF2]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
index ed9501519ab3..1fdf1ee672de 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7734.c
@@ -201,15 +201,9 @@ static struct clk_lookup lookups[] = {
201 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]), 201 CLKDEV_ICK_ID("sci_fck", "sh-sci.4", &mstp_clks[MSTP022]),
202 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]), 202 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP021]),
203 CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]), 203 CLKDEV_CON_ID("hscif", &mstp_clks[MSTP019]),
204 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP016]), 204 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP016]),
205 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP016]), 205 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP015]),
206 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP016]), 206 CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP014]),
207 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP015]),
208 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP015]),
209 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP015]),
210 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP014]),
211 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP014]),
212 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP014]),
213 CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]), 207 CLKDEV_CON_ID("ssi0", &mstp_clks[MSTP012]),
214 CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]), 208 CLKDEV_CON_ID("ssi1", &mstp_clks[MSTP011]),
215 CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]), 209 CLKDEV_CON_ID("ssi2", &mstp_clks[MSTP010]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
index 5c0e3c335161..9a28fdb36387 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7757.c
@@ -123,8 +123,8 @@ static struct clk_lookup lookups[] = {
123 CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]), 123 CLKDEV_CON_ID("riic6", &mstp_clks[MSTP000]),
124 CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]), 124 CLKDEV_CON_ID("riic7", &mstp_clks[MSTP000]),
125 125
126 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP113]), 126 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP113]),
127 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP114]), 127 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP114]),
128 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]), 128 CLKDEV_ICK_ID("sci_fck", "sh-sci.2", &mstp_clks[MSTP112]),
129 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]), 129 CLKDEV_ICK_ID("sci_fck", "sh-sci.1", &mstp_clks[MSTP111]),
130 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]), 130 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP110]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 1c83788db76a..17d0ea55a5a2 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -146,12 +146,8 @@ static struct clk_lookup lookups[] = {
146 CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]), 146 CLKDEV_CON_ID("mmcif_fck", &mstp_clks[MSTP013]),
147 CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]), 147 CLKDEV_CON_ID("flctl_fck", &mstp_clks[MSTP012]),
148 148
149 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 149 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
150 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 150 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
151 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
152 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
153 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
154 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
155 151
156 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]), 152 CLKDEV_CON_ID("siof_fck", &mstp_clks[MSTP003]),
157 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]), 153 CLKDEV_CON_ID("hspi_fck", &mstp_clks[MSTP002]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
index 8bba6f159023..bec2a83f1ba5 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
@@ -155,18 +155,10 @@ static struct clk_lookup lookups[] = {
155 CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]), 155 CLKDEV_CON_ID("i2c1_fck", &mstp_clks[MSTP015]),
156 CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]), 156 CLKDEV_CON_ID("i2c0_fck", &mstp_clks[MSTP014]),
157 157
158 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 158 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
159 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 159 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
160 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]), 160 CLKDEV_ICK_ID("fck", "sh-tmu.2", &mstp_clks[MSTP010]),
161 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]), 161 CLKDEV_ICK_ID("fck", "sh-tmu.3", &mstp_clks[MSTP011]),
162 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
163 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
164 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.6", &mstp_clks[MSTP010]),
165 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.7", &mstp_clks[MSTP010]),
166 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.8", &mstp_clks[MSTP010]),
167 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.9", &mstp_clks[MSTP011]),
168 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.10", &mstp_clks[MSTP011]),
169 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.11", &mstp_clks[MSTP011]),
170 162
171 CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]), 163 CLKDEV_CON_ID("sdif1_fck", &mstp_clks[MSTP005]),
172 CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]), 164 CLKDEV_CON_ID("sdif0_fck", &mstp_clks[MSTP004]),
diff --git a/arch/sh/kernel/cpu/sh4a/clock-shx3.c b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
index a9422dab0ce7..9a49a44f6f94 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-shx3.c
@@ -124,12 +124,8 @@ static struct clk_lookup lookups[] = {
124 CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]), 124 CLKDEV_CON_ID("fe1_fck", &mstp_clks[MSTP001]),
125 CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]), 125 CLKDEV_CON_ID("fe0_fck", &mstp_clks[MSTP000]),
126 126
127 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.0", &mstp_clks[MSTP008]), 127 CLKDEV_ICK_ID("fck", "sh-tmu.0", &mstp_clks[MSTP008]),
128 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.1", &mstp_clks[MSTP008]), 128 CLKDEV_ICK_ID("fck", "sh-tmu.1", &mstp_clks[MSTP009]),
129 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.2", &mstp_clks[MSTP008]),
130 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.3", &mstp_clks[MSTP009]),
131 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.4", &mstp_clks[MSTP009]),
132 CLKDEV_ICK_ID("tmu_fck", "sh_tmu.5", &mstp_clks[MSTP009]),
133 129
134 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]), 130 CLKDEV_CON_ID("hudi_fck", &mstp_clks[MSTP119]),
135 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]), 131 CLKDEV_CON_ID("dmac_11_6_fck", &mstp_clks[MSTP105]),
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
index 245d19254489..ceb3dedad983 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7343.c
@@ -228,26 +228,16 @@ static struct platform_device jpu_device = {
228}; 228};
229 229
230static struct sh_timer_config cmt_platform_data = { 230static struct sh_timer_config cmt_platform_data = {
231 .channel_offset = 0x60, 231 .channels_mask = 0x20,
232 .timer_bit = 5,
233 .clockevent_rating = 125,
234 .clocksource_rating = 200,
235}; 232};
236 233
237static struct resource cmt_resources[] = { 234static struct resource cmt_resources[] = {
238 [0] = { 235 DEFINE_RES_MEM(0x044a0000, 0x70),
239 .start = 0x044a0060, 236 DEFINE_RES_IRQ(evt2irq(0xf00)),
240 .end = 0x044a006b,
241 .flags = IORESOURCE_MEM,
242 },
243 [1] = {
244 .start = evt2irq(0xf00),
245 .flags = IORESOURCE_IRQ,
246 },
247}; 237};
248 238
249static struct platform_device cmt_device = { 239static struct platform_device cmt_device = {
250 .name = "sh_cmt", 240 .name = "sh-cmt-32",
251 .id = 0, 241 .id = 0,
252 .dev = { 242 .dev = {
253 .platform_data = &cmt_platform_data, 243 .platform_data = &cmt_platform_data,
@@ -257,25 +247,18 @@ static struct platform_device cmt_device = {
257}; 247};
258 248
259static struct sh_timer_config tmu0_platform_data = { 249static struct sh_timer_config tmu0_platform_data = {
260 .channel_offset = 0x04, 250 .channels_mask = 7,
261 .timer_bit = 0,
262 .clockevent_rating = 200,
263}; 251};
264 252
265static struct resource tmu0_resources[] = { 253static struct resource tmu0_resources[] = {
266 [0] = { 254 DEFINE_RES_MEM(0xffd80000, 0x2c),
267 .start = 0xffd80008, 255 DEFINE_RES_IRQ(evt2irq(0x400)),
268 .end = 0xffd80013, 256 DEFINE_RES_IRQ(evt2irq(0x420)),
269 .flags = IORESOURCE_MEM, 257 DEFINE_RES_IRQ(evt2irq(0x440)),
270 },
271 [1] = {
272 .start = evt2irq(0x400),
273 .flags = IORESOURCE_IRQ,
274 },
275}; 258};
276 259
277static struct platform_device tmu0_device = { 260static struct platform_device tmu0_device = {
278 .name = "sh_tmu", 261 .name = "sh-tmu",
279 .id = 0, 262 .id = 0,
280 .dev = { 263 .dev = {
281 .platform_data = &tmu0_platform_data, 264 .platform_data = &tmu0_platform_data,
@@ -284,61 +267,6 @@ static struct platform_device tmu0_device = {
284 .num_resources = ARRAY_SIZE(tmu0_resources), 267 .num_resources = ARRAY_SIZE(tmu0_resources),
285}; 268};
286 269
287static struct sh_timer_config tmu1_platform_data = {
288 .channel_offset = 0x10,
289 .timer_bit = 1,
290 .clocksource_rating = 200,
291};
292
293static struct resource tmu1_resources[] = {
294 [0] = {
295 .start = 0xffd80014,
296 .end = 0xffd8001f,
297 .flags = IORESOURCE_MEM,
298 },
299 [1] = {
300 .start = evt2irq(0x420),
301 .flags = IORESOURCE_IRQ,
302 },
303};
304
305static struct platform_device tmu1_device = {
306 .name = "sh_tmu",
307 .id = 1,
308 .dev = {
309 .platform_data = &tmu1_platform_data,
310 },
311 .resource = tmu1_resources,
312 .num_resources = ARRAY_SIZE(tmu1_resources),
313};
314
315static struct sh_timer_config tmu2_platform_data = {
316 .channel_offset = 0x1c,
317 .timer_bit = 2,
318};
319
320static struct resource tmu2_resources[] = {
321 [0] = {
322 .start = 0xffd80020,
323 .end = 0xffd8002b,
324 .flags = IORESOURCE_MEM,
325 },
326 [1] = {
327 .start = evt2irq(0x440),
328 .flags = IORESOURCE_IRQ,
329 },
330};
331
332static struct platform_device tmu2_device = {
333 .name = "sh_tmu",
334 .id = 2,
335 .dev = {
336 .platform_data = &tmu2_platform_data,
337 },
338 .resource = tmu2_resources,
339 .num_resources = ARRAY_SIZE(tmu2_resources),
340};
341
342static struct platform_device *sh7343_devices[] __initdata = { 270static struct platform_device *sh7343_devices[] __initdata = {
343 &scif0_device, 271 &scif0_device,
344 &scif1_device, 272 &scif1_device,
@@ -346,8 +274,6 @@ static struct platform_device *sh7343_devices[] __initdata = {
346 &scif3_device, 274 &scif3_device,
347 &cmt_device, 275 &cmt_device,
348 &tmu0_device, 276 &tmu0_device,
349 &tmu1_device,
350 &tmu2_device,
351 &iic0_device, 277 &iic0_device,
352 &iic1_device, 278 &iic1_device,
353 &vpu_device, 279 &vpu_device,
@@ -373,8 +299,6 @@ static struct platform_device *sh7343_early_devices[] __initdata = {
373 &scif3_device, 299 &scif3_device,
374 &cmt_device, 300 &cmt_device,
375 &tmu0_device, 301 &tmu0_device,
376 &tmu1_device,
377 &tmu2_device,
378}; 302};
379 303
380void __init plat_early_device_setup(void) 304void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
index 6f56cbd76b20..f75f67343139 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7366.c
@@ -176,26 +176,16 @@ static struct platform_device veu1_device = {
176}; 176};
177 177
178static struct sh_timer_config cmt_platform_data = { 178static struct sh_timer_config cmt_platform_data = {
179 .channel_offset = 0x60, 179 .channels_mask = 0x20,
180 .timer_bit = 5,
181 .clockevent_rating = 125,
182 .clocksource_rating = 200,
183}; 180};
184 181
185static struct resource cmt_resources[] = { 182static struct resource cmt_resources[] = {
186 [0] = { 183 DEFINE_RES_MEM(0x044a0000, 0x70),
187 .start = 0x044a0060, 184 DEFINE_RES_IRQ(evt2irq(0xf00)),
188 .end = 0x044a006b,
189 .flags = IORESOURCE_MEM,
190 },
191 [1] = {
192 .start = evt2irq(0xf00),
193 .flags = IORESOURCE_IRQ,
194 },
195}; 185};
196 186
197static struct platform_device cmt_device = { 187static struct platform_device cmt_device = {
198 .name = "sh_cmt", 188 .name = "sh-cmt-32",
199 .id = 0, 189 .id = 0,
200 .dev = { 190 .dev = {
201 .platform_data = &cmt_platform_data, 191 .platform_data = &cmt_platform_data,
@@ -205,25 +195,18 @@ static struct platform_device cmt_device = {
205}; 195};
206 196
207static struct sh_timer_config tmu0_platform_data = { 197static struct sh_timer_config tmu0_platform_data = {
208 .channel_offset = 0x04, 198 .channels_mask = 7,
209 .timer_bit = 0,
210 .clockevent_rating = 200,
211}; 199};
212 200
213static struct resource tmu0_resources[] = { 201static struct resource tmu0_resources[] = {
214 [0] = { 202 DEFINE_RES_MEM(0xffd80000, 0x2c),
215 .start = 0xffd80008, 203 DEFINE_RES_IRQ(evt2irq(0x400)),
216 .end = 0xffd80013, 204 DEFINE_RES_IRQ(evt2irq(0x420)),
217 .flags = IORESOURCE_MEM, 205 DEFINE_RES_IRQ(evt2irq(0x440)),
218 },
219 [1] = {
220 .start = 16,
221 .flags = IORESOURCE_IRQ,
222 },
223}; 206};
224 207
225static struct platform_device tmu0_device = { 208static struct platform_device tmu0_device = {
226 .name = "sh_tmu", 209 .name = "sh-tmu",
227 .id = 0, 210 .id = 0,
228 .dev = { 211 .dev = {
229 .platform_data = &tmu0_platform_data, 212 .platform_data = &tmu0_platform_data,
@@ -232,67 +215,10 @@ static struct platform_device tmu0_device = {
232 .num_resources = ARRAY_SIZE(tmu0_resources), 215 .num_resources = ARRAY_SIZE(tmu0_resources),
233}; 216};
234 217
235static struct sh_timer_config tmu1_platform_data = {
236 .channel_offset = 0x10,
237 .timer_bit = 1,
238 .clocksource_rating = 200,
239};
240
241static struct resource tmu1_resources[] = {
242 [0] = {
243 .start = 0xffd80014,
244 .end = 0xffd8001f,
245 .flags = IORESOURCE_MEM,
246 },
247 [1] = {
248 .start = evt2irq(0x420),
249 .flags = IORESOURCE_IRQ,
250 },
251};
252
253static struct platform_device tmu1_device = {
254 .name = "sh_tmu",
255 .id = 1,
256 .dev = {
257 .platform_data = &tmu1_platform_data,
258 },
259 .resource = tmu1_resources,
260 .num_resources = ARRAY_SIZE(tmu1_resources),
261};
262
263static struct sh_timer_config tmu2_platform_data = {
264 .channel_offset = 0x1c,
265 .timer_bit = 2,
266};
267
268static struct resource tmu2_resources[] = {
269 [0] = {
270 .start = 0xffd80020,
271 .end = 0xffd8002b,
272 .flags = IORESOURCE_MEM,
273 },
274 [1] = {
275 .start = evt2irq(0x440),
276 .flags = IORESOURCE_IRQ,
277 },
278};
279
280static struct platform_device tmu2_device = {
281 .name = "sh_tmu",
282 .id = 2,
283 .dev = {
284 .platform_data = &tmu2_platform_data,
285 },
286 .resource = tmu2_resources,
287 .num_resources = ARRAY_SIZE(tmu2_resources),
288};
289
290static struct platform_device *sh7366_devices[] __initdata = { 218static struct platform_device *sh7366_devices[] __initdata = {
291 &scif0_device, 219 &scif0_device,
292 &cmt_device, 220 &cmt_device,
293 &tmu0_device, 221 &tmu0_device,
294 &tmu1_device,
295 &tmu2_device,
296 &iic_device, 222 &iic_device,
297 &usb_host_device, 223 &usb_host_device,
298 &vpu_device, 224 &vpu_device,
@@ -315,8 +241,6 @@ static struct platform_device *sh7366_early_devices[] __initdata = {
315 &scif0_device, 241 &scif0_device,
316 &cmt_device, 242 &cmt_device,
317 &tmu0_device, 243 &tmu0_device,
318 &tmu1_device,
319 &tmu2_device,
320}; 244};
321 245
322void __init plat_early_device_setup(void) 246void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 5a94efc8d4ce..57f83a92a505 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -413,26 +413,16 @@ static struct platform_device jpu_device = {
413}; 413};
414 414
415static struct sh_timer_config cmt_platform_data = { 415static struct sh_timer_config cmt_platform_data = {
416 .channel_offset = 0x60, 416 .channels_mask = 0x20,
417 .timer_bit = 5,
418 .clockevent_rating = 125,
419 .clocksource_rating = 125,
420}; 417};
421 418
422static struct resource cmt_resources[] = { 419static struct resource cmt_resources[] = {
423 [0] = { 420 DEFINE_RES_MEM(0x044a0000, 0x70),
424 .start = 0x044a0060, 421 DEFINE_RES_IRQ(evt2irq(0xf00)),
425 .end = 0x044a006b,
426 .flags = IORESOURCE_MEM,
427 },
428 [1] = {
429 .start = evt2irq(0xf00),
430 .flags = IORESOURCE_IRQ,
431 },
432}; 422};
433 423
434static struct platform_device cmt_device = { 424static struct platform_device cmt_device = {
435 .name = "sh_cmt", 425 .name = "sh-cmt-32",
436 .id = 0, 426 .id = 0,
437 .dev = { 427 .dev = {
438 .platform_data = &cmt_platform_data, 428 .platform_data = &cmt_platform_data,
@@ -442,25 +432,18 @@ static struct platform_device cmt_device = {
442}; 432};
443 433
444static struct sh_timer_config tmu0_platform_data = { 434static struct sh_timer_config tmu0_platform_data = {
445 .channel_offset = 0x04, 435 .channels_mask = 7,
446 .timer_bit = 0,
447 .clockevent_rating = 200,
448}; 436};
449 437
450static struct resource tmu0_resources[] = { 438static struct resource tmu0_resources[] = {
451 [0] = { 439 DEFINE_RES_MEM(0xffd80000, 0x2c),
452 .start = 0xffd80008, 440 DEFINE_RES_IRQ(evt2irq(0x400)),
453 .end = 0xffd80013, 441 DEFINE_RES_IRQ(evt2irq(0x420)),
454 .flags = IORESOURCE_MEM, 442 DEFINE_RES_IRQ(evt2irq(0x440)),
455 },
456 [1] = {
457 .start = evt2irq(0x400),
458 .flags = IORESOURCE_IRQ,
459 },
460}; 443};
461 444
462static struct platform_device tmu0_device = { 445static struct platform_device tmu0_device = {
463 .name = "sh_tmu", 446 .name = "sh-tmu",
464 .id = 0, 447 .id = 0,
465 .dev = { 448 .dev = {
466 .platform_data = &tmu0_platform_data, 449 .platform_data = &tmu0_platform_data,
@@ -469,61 +452,6 @@ static struct platform_device tmu0_device = {
469 .num_resources = ARRAY_SIZE(tmu0_resources), 452 .num_resources = ARRAY_SIZE(tmu0_resources),
470}; 453};
471 454
472static struct sh_timer_config tmu1_platform_data = {
473 .channel_offset = 0x10,
474 .timer_bit = 1,
475 .clocksource_rating = 200,
476};
477
478static struct resource tmu1_resources[] = {
479 [0] = {
480 .start = 0xffd80014,
481 .end = 0xffd8001f,
482 .flags = IORESOURCE_MEM,
483 },
484 [1] = {
485 .start = evt2irq(0x420),
486 .flags = IORESOURCE_IRQ,
487 },
488};
489
490static struct platform_device tmu1_device = {
491 .name = "sh_tmu",
492 .id = 1,
493 .dev = {
494 .platform_data = &tmu1_platform_data,
495 },
496 .resource = tmu1_resources,
497 .num_resources = ARRAY_SIZE(tmu1_resources),
498};
499
500static struct sh_timer_config tmu2_platform_data = {
501 .channel_offset = 0x1c,
502 .timer_bit = 2,
503};
504
505static struct resource tmu2_resources[] = {
506 [0] = {
507 .start = 0xffd80020,
508 .end = 0xffd8002b,
509 .flags = IORESOURCE_MEM,
510 },
511 [1] = {
512 .start = 18,
513 .flags = IORESOURCE_IRQ,
514 },
515};
516
517static struct platform_device tmu2_device = {
518 .name = "sh_tmu",
519 .id = 2,
520 .dev = {
521 .platform_data = &tmu2_platform_data,
522 },
523 .resource = tmu2_resources,
524 .num_resources = ARRAY_SIZE(tmu2_resources),
525};
526
527static struct siu_platform siu_platform_data = { 455static struct siu_platform siu_platform_data = {
528 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX, 456 .dma_slave_tx_a = SHDMA_SLAVE_SIUA_TX,
529 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX, 457 .dma_slave_rx_a = SHDMA_SLAVE_SIUA_RX,
@@ -559,8 +487,6 @@ static struct platform_device *sh7722_devices[] __initdata = {
559 &scif2_device, 487 &scif2_device,
560 &cmt_device, 488 &cmt_device,
561 &tmu0_device, 489 &tmu0_device,
562 &tmu1_device,
563 &tmu2_device,
564 &rtc_device, 490 &rtc_device,
565 &usbf_device, 491 &usbf_device,
566 &iic_device, 492 &iic_device,
@@ -588,8 +514,6 @@ static struct platform_device *sh7722_early_devices[] __initdata = {
588 &scif2_device, 514 &scif2_device,
589 &cmt_device, 515 &cmt_device,
590 &tmu0_device, 516 &tmu0_device,
591 &tmu1_device,
592 &tmu2_device,
593}; 517};
594 518
595void __init plat_early_device_setup(void) 519void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
index 3c5eb0993a75..3533b56dd465 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7723.c
@@ -245,26 +245,16 @@ static struct platform_device veu1_device = {
245}; 245};
246 246
247static struct sh_timer_config cmt_platform_data = { 247static struct sh_timer_config cmt_platform_data = {
248 .channel_offset = 0x60, 248 .channels_mask = 0x20,
249 .timer_bit = 5,
250 .clockevent_rating = 125,
251 .clocksource_rating = 125,
252}; 249};
253 250
254static struct resource cmt_resources[] = { 251static struct resource cmt_resources[] = {
255 [0] = { 252 DEFINE_RES_MEM(0x044a0000, 0x70),
256 .start = 0x044a0060, 253 DEFINE_RES_IRQ(evt2irq(0xf00)),
257 .end = 0x044a006b,
258 .flags = IORESOURCE_MEM,
259 },
260 [1] = {
261 .start = evt2irq(0xf00),
262 .flags = IORESOURCE_IRQ,
263 },
264}; 254};
265 255
266static struct platform_device cmt_device = { 256static struct platform_device cmt_device = {
267 .name = "sh_cmt", 257 .name = "sh-cmt-32",
268 .id = 0, 258 .id = 0,
269 .dev = { 259 .dev = {
270 .platform_data = &cmt_platform_data, 260 .platform_data = &cmt_platform_data,
@@ -274,25 +264,18 @@ static struct platform_device cmt_device = {
274}; 264};
275 265
276static struct sh_timer_config tmu0_platform_data = { 266static struct sh_timer_config tmu0_platform_data = {
277 .channel_offset = 0x04, 267 .channels_mask = 7,
278 .timer_bit = 0,
279 .clockevent_rating = 200,
280}; 268};
281 269
282static struct resource tmu0_resources[] = { 270static struct resource tmu0_resources[] = {
283 [0] = { 271 DEFINE_RES_MEM(0xffd80000, 0x2c),
284 .start = 0xffd80008, 272 DEFINE_RES_IRQ(evt2irq(0x400)),
285 .end = 0xffd80013, 273 DEFINE_RES_IRQ(evt2irq(0x420)),
286 .flags = IORESOURCE_MEM, 274 DEFINE_RES_IRQ(evt2irq(0x440)),
287 },
288 [1] = {
289 .start = evt2irq(0x400),
290 .flags = IORESOURCE_IRQ,
291 },
292}; 275};
293 276
294static struct platform_device tmu0_device = { 277static struct platform_device tmu0_device = {
295 .name = "sh_tmu", 278 .name = "sh-tmu",
296 .id = 0, 279 .id = 0,
297 .dev = { 280 .dev = {
298 .platform_data = &tmu0_platform_data, 281 .platform_data = &tmu0_platform_data,
@@ -302,25 +285,18 @@ static struct platform_device tmu0_device = {
302}; 285};
303 286
304static struct sh_timer_config tmu1_platform_data = { 287static struct sh_timer_config tmu1_platform_data = {
305 .channel_offset = 0x10, 288 .channels_mask = 7,
306 .timer_bit = 1,
307 .clocksource_rating = 200,
308}; 289};
309 290
310static struct resource tmu1_resources[] = { 291static struct resource tmu1_resources[] = {
311 [0] = { 292 DEFINE_RES_MEM(0xffd90000, 0x2c),
312 .start = 0xffd80014, 293 DEFINE_RES_IRQ(evt2irq(0x920)),
313 .end = 0xffd8001f, 294 DEFINE_RES_IRQ(evt2irq(0x940)),
314 .flags = IORESOURCE_MEM, 295 DEFINE_RES_IRQ(evt2irq(0x960)),
315 },
316 [1] = {
317 .start = evt2irq(0x420),
318 .flags = IORESOURCE_IRQ,
319 },
320}; 296};
321 297
322static struct platform_device tmu1_device = { 298static struct platform_device tmu1_device = {
323 .name = "sh_tmu", 299 .name = "sh-tmu",
324 .id = 1, 300 .id = 1,
325 .dev = { 301 .dev = {
326 .platform_data = &tmu1_platform_data, 302 .platform_data = &tmu1_platform_data,
@@ -329,114 +305,6 @@ static struct platform_device tmu1_device = {
329 .num_resources = ARRAY_SIZE(tmu1_resources), 305 .num_resources = ARRAY_SIZE(tmu1_resources),
330}; 306};
331 307
332static struct sh_timer_config tmu2_platform_data = {
333 .channel_offset = 0x1c,
334 .timer_bit = 2,
335};
336
337static struct resource tmu2_resources[] = {
338 [0] = {
339 .start = 0xffd80020,
340 .end = 0xffd8002b,
341 .flags = IORESOURCE_MEM,
342 },
343 [1] = {
344 .start = evt2irq(0x440),
345 .flags = IORESOURCE_IRQ,
346 },
347};
348
349static struct platform_device tmu2_device = {
350 .name = "sh_tmu",
351 .id = 2,
352 .dev = {
353 .platform_data = &tmu2_platform_data,
354 },
355 .resource = tmu2_resources,
356 .num_resources = ARRAY_SIZE(tmu2_resources),
357};
358
359static struct sh_timer_config tmu3_platform_data = {
360 .channel_offset = 0x04,
361 .timer_bit = 0,
362};
363
364static struct resource tmu3_resources[] = {
365 [0] = {
366 .start = 0xffd90008,
367 .end = 0xffd90013,
368 .flags = IORESOURCE_MEM,
369 },
370 [1] = {
371 .start = evt2irq(0x920),
372 .flags = IORESOURCE_IRQ,
373 },
374};
375
376static struct platform_device tmu3_device = {
377 .name = "sh_tmu",
378 .id = 3,
379 .dev = {
380 .platform_data = &tmu3_platform_data,
381 },
382 .resource = tmu3_resources,
383 .num_resources = ARRAY_SIZE(tmu3_resources),
384};
385
386static struct sh_timer_config tmu4_platform_data = {
387 .channel_offset = 0x10,
388 .timer_bit = 1,
389};
390
391static struct resource tmu4_resources[] = {
392 [0] = {
393 .start = 0xffd90014,
394 .end = 0xffd9001f,
395 .flags = IORESOURCE_MEM,
396 },
397 [1] = {
398 .start = evt2irq(0x940),
399 .flags = IORESOURCE_IRQ,
400 },
401};
402
403static struct platform_device tmu4_device = {
404 .name = "sh_tmu",
405 .id = 4,
406 .dev = {
407 .platform_data = &tmu4_platform_data,
408 },
409 .resource = tmu4_resources,
410 .num_resources = ARRAY_SIZE(tmu4_resources),
411};
412
413static struct sh_timer_config tmu5_platform_data = {
414 .channel_offset = 0x1c,
415 .timer_bit = 2,
416};
417
418static struct resource tmu5_resources[] = {
419 [0] = {
420 .start = 0xffd90020,
421 .end = 0xffd9002b,
422 .flags = IORESOURCE_MEM,
423 },
424 [1] = {
425 .start = evt2irq(0x920),
426 .flags = IORESOURCE_IRQ,
427 },
428};
429
430static struct platform_device tmu5_device = {
431 .name = "sh_tmu",
432 .id = 5,
433 .dev = {
434 .platform_data = &tmu5_platform_data,
435 },
436 .resource = tmu5_resources,
437 .num_resources = ARRAY_SIZE(tmu5_resources),
438};
439
440static struct resource rtc_resources[] = { 308static struct resource rtc_resources[] = {
441 [0] = { 309 [0] = {
442 .start = 0xa465fec0, 310 .start = 0xa465fec0,
@@ -527,10 +395,6 @@ static struct platform_device *sh7723_devices[] __initdata = {
527 &cmt_device, 395 &cmt_device,
528 &tmu0_device, 396 &tmu0_device,
529 &tmu1_device, 397 &tmu1_device,
530 &tmu2_device,
531 &tmu3_device,
532 &tmu4_device,
533 &tmu5_device,
534 &rtc_device, 398 &rtc_device,
535 &iic_device, 399 &iic_device,
536 &sh7723_usb_host_device, 400 &sh7723_usb_host_device,
@@ -560,10 +424,6 @@ static struct platform_device *sh7723_early_devices[] __initdata = {
560 &cmt_device, 424 &cmt_device,
561 &tmu0_device, 425 &tmu0_device,
562 &tmu1_device, 426 &tmu1_device,
563 &tmu2_device,
564 &tmu3_device,
565 &tmu4_device,
566 &tmu5_device,
567}; 427};
568 428
569void __init plat_early_device_setup(void) 429void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index 60ebbc6842ff..b9e84b1d3aa7 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -648,26 +648,16 @@ static struct platform_device beu1_device = {
648}; 648};
649 649
650static struct sh_timer_config cmt_platform_data = { 650static struct sh_timer_config cmt_platform_data = {
651 .channel_offset = 0x60, 651 .channels_mask = 0x20,
652 .timer_bit = 5,
653 .clockevent_rating = 125,
654 .clocksource_rating = 200,
655}; 652};
656 653
657static struct resource cmt_resources[] = { 654static struct resource cmt_resources[] = {
658 [0] = { 655 DEFINE_RES_MEM(0x044a0000, 0x70),
659 .start = 0x044a0060, 656 DEFINE_RES_IRQ(evt2irq(0xf00)),
660 .end = 0x044a006b,
661 .flags = IORESOURCE_MEM,
662 },
663 [1] = {
664 .start = evt2irq(0xf00),
665 .flags = IORESOURCE_IRQ,
666 },
667}; 657};
668 658
669static struct platform_device cmt_device = { 659static struct platform_device cmt_device = {
670 .name = "sh_cmt", 660 .name = "sh-cmt-32",
671 .id = 0, 661 .id = 0,
672 .dev = { 662 .dev = {
673 .platform_data = &cmt_platform_data, 663 .platform_data = &cmt_platform_data,
@@ -677,25 +667,18 @@ static struct platform_device cmt_device = {
677}; 667};
678 668
679static struct sh_timer_config tmu0_platform_data = { 669static struct sh_timer_config tmu0_platform_data = {
680 .channel_offset = 0x04, 670 .channels_mask = 7,
681 .timer_bit = 0,
682 .clockevent_rating = 200,
683}; 671};
684 672
685static struct resource tmu0_resources[] = { 673static struct resource tmu0_resources[] = {
686 [0] = { 674 DEFINE_RES_MEM(0xffd80000, 0x2c),
687 .start = 0xffd80008, 675 DEFINE_RES_IRQ(evt2irq(0x400)),
688 .end = 0xffd80013, 676 DEFINE_RES_IRQ(evt2irq(0x420)),
689 .flags = IORESOURCE_MEM, 677 DEFINE_RES_IRQ(evt2irq(0x440)),
690 },
691 [1] = {
692 .start = evt2irq(0x400),
693 .flags = IORESOURCE_IRQ,
694 },
695}; 678};
696 679
697static struct platform_device tmu0_device = { 680static struct platform_device tmu0_device = {
698 .name = "sh_tmu", 681 .name = "sh-tmu",
699 .id = 0, 682 .id = 0,
700 .dev = { 683 .dev = {
701 .platform_data = &tmu0_platform_data, 684 .platform_data = &tmu0_platform_data,
@@ -705,25 +688,18 @@ static struct platform_device tmu0_device = {
705}; 688};
706 689
707static struct sh_timer_config tmu1_platform_data = { 690static struct sh_timer_config tmu1_platform_data = {
708 .channel_offset = 0x10, 691 .channels_mask = 7,
709 .timer_bit = 1,
710 .clocksource_rating = 200,
711}; 692};
712 693
713static struct resource tmu1_resources[] = { 694static struct resource tmu1_resources[] = {
714 [0] = { 695 DEFINE_RES_MEM(0xffd90000, 0x2c),
715 .start = 0xffd80014, 696 DEFINE_RES_IRQ(evt2irq(0x920)),
716 .end = 0xffd8001f, 697 DEFINE_RES_IRQ(evt2irq(0x940)),
717 .flags = IORESOURCE_MEM, 698 DEFINE_RES_IRQ(evt2irq(0x960)),
718 },
719 [1] = {
720 .start = evt2irq(0x420),
721 .flags = IORESOURCE_IRQ,
722 },
723}; 699};
724 700
725static struct platform_device tmu1_device = { 701static struct platform_device tmu1_device = {
726 .name = "sh_tmu", 702 .name = "sh-tmu",
727 .id = 1, 703 .id = 1,
728 .dev = { 704 .dev = {
729 .platform_data = &tmu1_platform_data, 705 .platform_data = &tmu1_platform_data,
@@ -732,115 +708,6 @@ static struct platform_device tmu1_device = {
732 .num_resources = ARRAY_SIZE(tmu1_resources), 708 .num_resources = ARRAY_SIZE(tmu1_resources),
733}; 709};
734 710
735static struct sh_timer_config tmu2_platform_data = {
736 .channel_offset = 0x1c,
737 .timer_bit = 2,
738};
739
740static struct resource tmu2_resources[] = {
741 [0] = {
742 .start = 0xffd80020,
743 .end = 0xffd8002b,
744 .flags = IORESOURCE_MEM,
745 },
746 [1] = {
747 .start = evt2irq(0x440),
748 .flags = IORESOURCE_IRQ,
749 },
750};
751
752static struct platform_device tmu2_device = {
753 .name = "sh_tmu",
754 .id = 2,
755 .dev = {
756 .platform_data = &tmu2_platform_data,
757 },
758 .resource = tmu2_resources,
759 .num_resources = ARRAY_SIZE(tmu2_resources),
760};
761
762
763static struct sh_timer_config tmu3_platform_data = {
764 .channel_offset = 0x04,
765 .timer_bit = 0,
766};
767
768static struct resource tmu3_resources[] = {
769 [0] = {
770 .start = 0xffd90008,
771 .end = 0xffd90013,
772 .flags = IORESOURCE_MEM,
773 },
774 [1] = {
775 .start = evt2irq(0x920),
776 .flags = IORESOURCE_IRQ,
777 },
778};
779
780static struct platform_device tmu3_device = {
781 .name = "sh_tmu",
782 .id = 3,
783 .dev = {
784 .platform_data = &tmu3_platform_data,
785 },
786 .resource = tmu3_resources,
787 .num_resources = ARRAY_SIZE(tmu3_resources),
788};
789
790static struct sh_timer_config tmu4_platform_data = {
791 .channel_offset = 0x10,
792 .timer_bit = 1,
793};
794
795static struct resource tmu4_resources[] = {
796 [0] = {
797 .start = 0xffd90014,
798 .end = 0xffd9001f,
799 .flags = IORESOURCE_MEM,
800 },
801 [1] = {
802 .start = evt2irq(0x940),
803 .flags = IORESOURCE_IRQ,
804 },
805};
806
807static struct platform_device tmu4_device = {
808 .name = "sh_tmu",
809 .id = 4,
810 .dev = {
811 .platform_data = &tmu4_platform_data,
812 },
813 .resource = tmu4_resources,
814 .num_resources = ARRAY_SIZE(tmu4_resources),
815};
816
817static struct sh_timer_config tmu5_platform_data = {
818 .channel_offset = 0x1c,
819 .timer_bit = 2,
820};
821
822static struct resource tmu5_resources[] = {
823 [0] = {
824 .start = 0xffd90020,
825 .end = 0xffd9002b,
826 .flags = IORESOURCE_MEM,
827 },
828 [1] = {
829 .start = evt2irq(0x920),
830 .flags = IORESOURCE_IRQ,
831 },
832};
833
834static struct platform_device tmu5_device = {
835 .name = "sh_tmu",
836 .id = 5,
837 .dev = {
838 .platform_data = &tmu5_platform_data,
839 },
840 .resource = tmu5_resources,
841 .num_resources = ARRAY_SIZE(tmu5_resources),
842};
843
844/* JPU */ 711/* JPU */
845static struct uio_info jpu_platform_data = { 712static struct uio_info jpu_platform_data = {
846 .name = "JPU", 713 .name = "JPU",
@@ -938,10 +805,6 @@ static struct platform_device *sh7724_devices[] __initdata = {
938 &cmt_device, 805 &cmt_device,
939 &tmu0_device, 806 &tmu0_device,
940 &tmu1_device, 807 &tmu1_device,
941 &tmu2_device,
942 &tmu3_device,
943 &tmu4_device,
944 &tmu5_device,
945 &dma0_device, 808 &dma0_device,
946 &dma1_device, 809 &dma1_device,
947 &rtc_device, 810 &rtc_device,
@@ -981,10 +844,6 @@ static struct platform_device *sh7724_early_devices[] __initdata = {
981 &cmt_device, 844 &cmt_device,
982 &tmu0_device, 845 &tmu0_device,
983 &tmu1_device, 846 &tmu1_device,
984 &tmu2_device,
985 &tmu3_device,
986 &tmu4_device,
987 &tmu5_device,
988}; 847};
989 848
990void __init plat_early_device_setup(void) 849void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
index dad4ed1b2f94..f617bcb734df 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7734.c
@@ -200,25 +200,18 @@ static struct platform_device i2c0_device = {
200 200
201/* TMU */ 201/* TMU */
202static struct sh_timer_config tmu0_platform_data = { 202static struct sh_timer_config tmu0_platform_data = {
203 .channel_offset = 0x04, 203 .channels_mask = 7,
204 .timer_bit = 0,
205 .clockevent_rating = 200,
206}; 204};
207 205
208static struct resource tmu0_resources[] = { 206static struct resource tmu0_resources[] = {
209 [0] = { 207 DEFINE_RES_MEM(0xffd80000, 0x30),
210 .start = 0xFFD80008, 208 DEFINE_RES_IRQ(evt2irq(0x400)),
211 .end = 0xFFD80014 - 1, 209 DEFINE_RES_IRQ(evt2irq(0x420)),
212 .flags = IORESOURCE_MEM, 210 DEFINE_RES_IRQ(evt2irq(0x440)),
213 },
214 [1] = {
215 .start = evt2irq(0x400),
216 .flags = IORESOURCE_IRQ,
217 },
218}; 211};
219 212
220static struct platform_device tmu0_device = { 213static struct platform_device tmu0_device = {
221 .name = "sh_tmu", 214 .name = "sh-tmu",
222 .id = 0, 215 .id = 0,
223 .dev = { 216 .dev = {
224 .platform_data = &tmu0_platform_data, 217 .platform_data = &tmu0_platform_data,
@@ -228,26 +221,19 @@ static struct platform_device tmu0_device = {
228}; 221};
229 222
230static struct sh_timer_config tmu1_platform_data = { 223static struct sh_timer_config tmu1_platform_data = {
231 .channel_offset = 0x10, 224 .channels_mask = 7,
232 .timer_bit = 1,
233 .clocksource_rating = 200,
234}; 225};
235 226
236static struct resource tmu1_resources[] = { 227static struct resource tmu1_resources[] = {
237 [0] = { 228 DEFINE_RES_MEM(0xffd81000, 0x30),
238 .start = 0xFFD80014, 229 DEFINE_RES_IRQ(evt2irq(0x480)),
239 .end = 0xFFD80020 - 1, 230 DEFINE_RES_IRQ(evt2irq(0x4a0)),
240 .flags = IORESOURCE_MEM, 231 DEFINE_RES_IRQ(evt2irq(0x4c0)),
241 },
242 [1] = {
243 .start = evt2irq(0x420),
244 .flags = IORESOURCE_IRQ,
245 },
246}; 232};
247 233
248static struct platform_device tmu1_device = { 234static struct platform_device tmu1_device = {
249 .name = "sh_tmu", 235 .name = "sh-tmu",
250 .id = 1, 236 .id = 1,
251 .dev = { 237 .dev = {
252 .platform_data = &tmu1_platform_data, 238 .platform_data = &tmu1_platform_data,
253 }, 239 },
@@ -256,25 +242,19 @@ static struct platform_device tmu1_device = {
256}; 242};
257 243
258static struct sh_timer_config tmu2_platform_data = { 244static struct sh_timer_config tmu2_platform_data = {
259 .channel_offset = 0x1c, 245 .channels_mask = 7,
260 .timer_bit = 2,
261}; 246};
262 247
263static struct resource tmu2_resources[] = { 248static struct resource tmu2_resources[] = {
264 [0] = { 249 DEFINE_RES_MEM(0xffd82000, 0x30),
265 .start = 0xFFD80020, 250 DEFINE_RES_IRQ(evt2irq(0x500)),
266 .end = 0xFFD80030 - 1, 251 DEFINE_RES_IRQ(evt2irq(0x520)),
267 .flags = IORESOURCE_MEM, 252 DEFINE_RES_IRQ(evt2irq(0x540)),
268 },
269 [1] = {
270 .start = evt2irq(0x440),
271 .flags = IORESOURCE_IRQ,
272 },
273}; 253};
274 254
275static struct platform_device tmu2_device = { 255static struct platform_device tmu2_device = {
276 .name = "sh_tmu", 256 .name = "sh-tmu",
277 .id = 2, 257 .id = 2,
278 .dev = { 258 .dev = {
279 .platform_data = &tmu2_platform_data, 259 .platform_data = &tmu2_platform_data,
280 }, 260 },
@@ -282,169 +262,6 @@ static struct platform_device tmu2_device = {
282 .num_resources = ARRAY_SIZE(tmu2_resources), 262 .num_resources = ARRAY_SIZE(tmu2_resources),
283}; 263};
284 264
285
286static struct sh_timer_config tmu3_platform_data = {
287 .channel_offset = 0x04,
288 .timer_bit = 0,
289};
290
291static struct resource tmu3_resources[] = {
292 [0] = {
293 .start = 0xFFD81008,
294 .end = 0xFFD81014 - 1,
295 .flags = IORESOURCE_MEM,
296 },
297 [1] = {
298 .start = evt2irq(0x480),
299 .flags = IORESOURCE_IRQ,
300 },
301};
302
303static struct platform_device tmu3_device = {
304 .name = "sh_tmu",
305 .id = 3,
306 .dev = {
307 .platform_data = &tmu3_platform_data,
308 },
309 .resource = tmu3_resources,
310 .num_resources = ARRAY_SIZE(tmu3_resources),
311};
312
313static struct sh_timer_config tmu4_platform_data = {
314 .channel_offset = 0x10,
315 .timer_bit = 1,
316};
317
318static struct resource tmu4_resources[] = {
319 [0] = {
320 .start = 0xFFD81014,
321 .end = 0xFFD81020 - 1,
322 .flags = IORESOURCE_MEM,
323 },
324 [1] = {
325 .start = evt2irq(0x4A0),
326 .flags = IORESOURCE_IRQ,
327 },
328};
329
330static struct platform_device tmu4_device = {
331 .name = "sh_tmu",
332 .id = 4,
333 .dev = {
334 .platform_data = &tmu4_platform_data,
335 },
336 .resource = tmu4_resources,
337 .num_resources = ARRAY_SIZE(tmu4_resources),
338};
339
340static struct sh_timer_config tmu5_platform_data = {
341 .channel_offset = 0x1c,
342 .timer_bit = 2,
343};
344
345static struct resource tmu5_resources[] = {
346 [0] = {
347 .start = 0xFFD81020,
348 .end = 0xFFD81030 - 1,
349 .flags = IORESOURCE_MEM,
350 },
351 [1] = {
352 .start = evt2irq(0x4C0),
353 .flags = IORESOURCE_IRQ,
354 },
355};
356
357static struct platform_device tmu5_device = {
358 .name = "sh_tmu",
359 .id = 5,
360 .dev = {
361 .platform_data = &tmu5_platform_data,
362 },
363 .resource = tmu5_resources,
364 .num_resources = ARRAY_SIZE(tmu5_resources),
365};
366
367static struct sh_timer_config tmu6_platform_data = {
368 .channel_offset = 0x4,
369 .timer_bit = 0,
370};
371
372static struct resource tmu6_resources[] = {
373 [0] = {
374 .start = 0xFFD82008,
375 .end = 0xFFD82014 - 1,
376 .flags = IORESOURCE_MEM,
377 },
378 [1] = {
379 .start = evt2irq(0x500),
380 .flags = IORESOURCE_IRQ,
381 },
382};
383
384static struct platform_device tmu6_device = {
385 .name = "sh_tmu",
386 .id = 6,
387 .dev = {
388 .platform_data = &tmu6_platform_data,
389 },
390 .resource = tmu6_resources,
391 .num_resources = ARRAY_SIZE(tmu6_resources),
392};
393
394static struct sh_timer_config tmu7_platform_data = {
395 .channel_offset = 0x10,
396 .timer_bit = 1,
397};
398
399static struct resource tmu7_resources[] = {
400 [0] = {
401 .start = 0xFFD82014,
402 .end = 0xFFD82020 - 1,
403 .flags = IORESOURCE_MEM,
404 },
405 [1] = {
406 .start = evt2irq(0x520),
407 .flags = IORESOURCE_IRQ,
408 },
409};
410
411static struct platform_device tmu7_device = {
412 .name = "sh_tmu",
413 .id = 7,
414 .dev = {
415 .platform_data = &tmu7_platform_data,
416 },
417 .resource = tmu7_resources,
418 .num_resources = ARRAY_SIZE(tmu7_resources),
419};
420
421static struct sh_timer_config tmu8_platform_data = {
422 .channel_offset = 0x1c,
423 .timer_bit = 2,
424};
425
426static struct resource tmu8_resources[] = {
427 [0] = {
428 .start = 0xFFD82020,
429 .end = 0xFFD82030 - 1,
430 .flags = IORESOURCE_MEM,
431 },
432 [1] = {
433 .start = evt2irq(0x540),
434 .flags = IORESOURCE_IRQ,
435 },
436};
437
438static struct platform_device tmu8_device = {
439 .name = "sh_tmu",
440 .id = 8,
441 .dev = {
442 .platform_data = &tmu8_platform_data,
443 },
444 .resource = tmu8_resources,
445 .num_resources = ARRAY_SIZE(tmu8_resources),
446};
447
448static struct platform_device *sh7734_devices[] __initdata = { 265static struct platform_device *sh7734_devices[] __initdata = {
449 &scif0_device, 266 &scif0_device,
450 &scif1_device, 267 &scif1_device,
@@ -455,12 +272,6 @@ static struct platform_device *sh7734_devices[] __initdata = {
455 &tmu0_device, 272 &tmu0_device,
456 &tmu1_device, 273 &tmu1_device,
457 &tmu2_device, 274 &tmu2_device,
458 &tmu3_device,
459 &tmu4_device,
460 &tmu5_device,
461 &tmu6_device,
462 &tmu7_device,
463 &tmu8_device,
464 &rtc_device, 275 &rtc_device,
465}; 276};
466 277
@@ -474,12 +285,6 @@ static struct platform_device *sh7734_early_devices[] __initdata = {
474 &tmu0_device, 285 &tmu0_device,
475 &tmu1_device, 286 &tmu1_device,
476 &tmu2_device, 287 &tmu2_device,
477 &tmu3_device,
478 &tmu4_device,
479 &tmu5_device,
480 &tmu6_device,
481 &tmu7_device,
482 &tmu8_device,
483}; 288};
484 289
485void __init plat_early_device_setup(void) 290void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index e43e5db53913..7b24ec4b409a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -87,25 +87,17 @@ static struct platform_device scif4_device = {
87}; 87};
88 88
89static struct sh_timer_config tmu0_platform_data = { 89static struct sh_timer_config tmu0_platform_data = {
90 .channel_offset = 0x04, 90 .channels_mask = 3,
91 .timer_bit = 0,
92 .clockevent_rating = 200,
93}; 91};
94 92
95static struct resource tmu0_resources[] = { 93static struct resource tmu0_resources[] = {
96 [0] = { 94 DEFINE_RES_MEM(0xfe430000, 0x20),
97 .start = 0xfe430008, 95 DEFINE_RES_IRQ(evt2irq(0x580)),
98 .end = 0xfe430013, 96 DEFINE_RES_IRQ(evt2irq(0x5a0)),
99 .flags = IORESOURCE_MEM,
100 },
101 [1] = {
102 .start = evt2irq(0x580),
103 .flags = IORESOURCE_IRQ,
104 },
105}; 97};
106 98
107static struct platform_device tmu0_device = { 99static struct platform_device tmu0_device = {
108 .name = "sh_tmu", 100 .name = "sh-tmu",
109 .id = 0, 101 .id = 0,
110 .dev = { 102 .dev = {
111 .platform_data = &tmu0_platform_data, 103 .platform_data = &tmu0_platform_data,
@@ -114,34 +106,6 @@ static struct platform_device tmu0_device = {
114 .num_resources = ARRAY_SIZE(tmu0_resources), 106 .num_resources = ARRAY_SIZE(tmu0_resources),
115}; 107};
116 108
117static struct sh_timer_config tmu1_platform_data = {
118 .channel_offset = 0x10,
119 .timer_bit = 1,
120 .clocksource_rating = 200,
121};
122
123static struct resource tmu1_resources[] = {
124 [0] = {
125 .start = 0xfe430014,
126 .end = 0xfe43001f,
127 .flags = IORESOURCE_MEM,
128 },
129 [1] = {
130 .start = evt2irq(0x5a0),
131 .flags = IORESOURCE_IRQ,
132 },
133};
134
135static struct platform_device tmu1_device = {
136 .name = "sh_tmu",
137 .id = 1,
138 .dev = {
139 .platform_data = &tmu1_platform_data,
140 },
141 .resource = tmu1_resources,
142 .num_resources = ARRAY_SIZE(tmu1_resources),
143};
144
145static struct resource spi0_resources[] = { 109static struct resource spi0_resources[] = {
146 [0] = { 110 [0] = {
147 .start = 0xfe002000, 111 .start = 0xfe002000,
@@ -782,7 +746,6 @@ static struct platform_device *sh7757_devices[] __initdata = {
782 &scif3_device, 746 &scif3_device,
783 &scif4_device, 747 &scif4_device,
784 &tmu0_device, 748 &tmu0_device,
785 &tmu1_device,
786 &dma0_device, 749 &dma0_device,
787 &dma1_device, 750 &dma1_device,
788 &dma2_device, 751 &dma2_device,
@@ -806,7 +769,6 @@ static struct platform_device *sh7757_early_devices[] __initdata = {
806 &scif3_device, 769 &scif3_device,
807 &scif4_device, 770 &scif4_device,
808 &tmu0_device, 771 &tmu0_device,
809 &tmu1_device,
810}; 772};
811 773
812void __init plat_early_device_setup(void) 774void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
index 5eebbd7f4c21..5a47d670ddec 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7763.c
@@ -158,25 +158,18 @@ static struct platform_device usbf_device = {
158}; 158};
159 159
160static struct sh_timer_config tmu0_platform_data = { 160static struct sh_timer_config tmu0_platform_data = {
161 .channel_offset = 0x04, 161 .channels_mask = 7,
162 .timer_bit = 0,
163 .clockevent_rating = 200,
164}; 162};
165 163
166static struct resource tmu0_resources[] = { 164static struct resource tmu0_resources[] = {
167 [0] = { 165 DEFINE_RES_MEM(0xffd80000, 0x30),
168 .start = 0xffd80008, 166 DEFINE_RES_IRQ(evt2irq(0x580)),
169 .end = 0xffd80013, 167 DEFINE_RES_IRQ(evt2irq(0x5a0)),
170 .flags = IORESOURCE_MEM, 168 DEFINE_RES_IRQ(evt2irq(0x5c0)),
171 },
172 [1] = {
173 .start = evt2irq(0x580),
174 .flags = IORESOURCE_IRQ,
175 },
176}; 169};
177 170
178static struct platform_device tmu0_device = { 171static struct platform_device tmu0_device = {
179 .name = "sh_tmu", 172 .name = "sh-tmu",
180 .id = 0, 173 .id = 0,
181 .dev = { 174 .dev = {
182 .platform_data = &tmu0_platform_data, 175 .platform_data = &tmu0_platform_data,
@@ -186,25 +179,18 @@ static struct platform_device tmu0_device = {
186}; 179};
187 180
188static struct sh_timer_config tmu1_platform_data = { 181static struct sh_timer_config tmu1_platform_data = {
189 .channel_offset = 0x10, 182 .channels_mask = 7,
190 .timer_bit = 1,
191 .clocksource_rating = 200,
192}; 183};
193 184
194static struct resource tmu1_resources[] = { 185static struct resource tmu1_resources[] = {
195 [0] = { 186 DEFINE_RES_MEM(0xffd88000, 0x2c),
196 .start = 0xffd80014, 187 DEFINE_RES_IRQ(evt2irq(0xe00)),
197 .end = 0xffd8001f, 188 DEFINE_RES_IRQ(evt2irq(0xe20)),
198 .flags = IORESOURCE_MEM, 189 DEFINE_RES_IRQ(evt2irq(0xe40)),
199 },
200 [1] = {
201 .start = evt2irq(0x5a0),
202 .flags = IORESOURCE_IRQ,
203 },
204}; 190};
205 191
206static struct platform_device tmu1_device = { 192static struct platform_device tmu1_device = {
207 .name = "sh_tmu", 193 .name = "sh-tmu",
208 .id = 1, 194 .id = 1,
209 .dev = { 195 .dev = {
210 .platform_data = &tmu1_platform_data, 196 .platform_data = &tmu1_platform_data,
@@ -213,124 +199,12 @@ static struct platform_device tmu1_device = {
213 .num_resources = ARRAY_SIZE(tmu1_resources), 199 .num_resources = ARRAY_SIZE(tmu1_resources),
214}; 200};
215 201
216static struct sh_timer_config tmu2_platform_data = {
217 .channel_offset = 0x1c,
218 .timer_bit = 2,
219};
220
221static struct resource tmu2_resources[] = {
222 [0] = {
223 .start = 0xffd80020,
224 .end = 0xffd8002f,
225 .flags = IORESOURCE_MEM,
226 },
227 [1] = {
228 .start = evt2irq(0x5c0),
229 .flags = IORESOURCE_IRQ,
230 },
231};
232
233static struct platform_device tmu2_device = {
234 .name = "sh_tmu",
235 .id = 2,
236 .dev = {
237 .platform_data = &tmu2_platform_data,
238 },
239 .resource = tmu2_resources,
240 .num_resources = ARRAY_SIZE(tmu2_resources),
241};
242
243static struct sh_timer_config tmu3_platform_data = {
244 .channel_offset = 0x04,
245 .timer_bit = 0,
246};
247
248static struct resource tmu3_resources[] = {
249 [0] = {
250 .start = 0xffd88008,
251 .end = 0xffd88013,
252 .flags = IORESOURCE_MEM,
253 },
254 [1] = {
255 .start = evt2irq(0xe00),
256 .flags = IORESOURCE_IRQ,
257 },
258};
259
260static struct platform_device tmu3_device = {
261 .name = "sh_tmu",
262 .id = 3,
263 .dev = {
264 .platform_data = &tmu3_platform_data,
265 },
266 .resource = tmu3_resources,
267 .num_resources = ARRAY_SIZE(tmu3_resources),
268};
269
270static struct sh_timer_config tmu4_platform_data = {
271 .channel_offset = 0x10,
272 .timer_bit = 1,
273};
274
275static struct resource tmu4_resources[] = {
276 [0] = {
277 .start = 0xffd88014,
278 .end = 0xffd8801f,
279 .flags = IORESOURCE_MEM,
280 },
281 [1] = {
282 .start = evt2irq(0xe20),
283 .flags = IORESOURCE_IRQ,
284 },
285};
286
287static struct platform_device tmu4_device = {
288 .name = "sh_tmu",
289 .id = 4,
290 .dev = {
291 .platform_data = &tmu4_platform_data,
292 },
293 .resource = tmu4_resources,
294 .num_resources = ARRAY_SIZE(tmu4_resources),
295};
296
297static struct sh_timer_config tmu5_platform_data = {
298 .channel_offset = 0x1c,
299 .timer_bit = 2,
300};
301
302static struct resource tmu5_resources[] = {
303 [0] = {
304 .start = 0xffd88020,
305 .end = 0xffd8802b,
306 .flags = IORESOURCE_MEM,
307 },
308 [1] = {
309 .start = evt2irq(0xe40),
310 .flags = IORESOURCE_IRQ,
311 },
312};
313
314static struct platform_device tmu5_device = {
315 .name = "sh_tmu",
316 .id = 5,
317 .dev = {
318 .platform_data = &tmu5_platform_data,
319 },
320 .resource = tmu5_resources,
321 .num_resources = ARRAY_SIZE(tmu5_resources),
322};
323
324static struct platform_device *sh7763_devices[] __initdata = { 202static struct platform_device *sh7763_devices[] __initdata = {
325 &scif0_device, 203 &scif0_device,
326 &scif1_device, 204 &scif1_device,
327 &scif2_device, 205 &scif2_device,
328 &tmu0_device, 206 &tmu0_device,
329 &tmu1_device, 207 &tmu1_device,
330 &tmu2_device,
331 &tmu3_device,
332 &tmu4_device,
333 &tmu5_device,
334 &rtc_device, 208 &rtc_device,
335 &usb_ohci_device, 209 &usb_ohci_device,
336 &usbf_device, 210 &usbf_device,
@@ -349,10 +223,6 @@ static struct platform_device *sh7763_early_devices[] __initdata = {
349 &scif2_device, 223 &scif2_device,
350 &tmu0_device, 224 &tmu0_device,
351 &tmu1_device, 225 &tmu1_device,
352 &tmu2_device,
353 &tmu3_device,
354 &tmu4_device,
355 &tmu5_device,
356}; 226};
357 227
358void __init plat_early_device_setup(void) 228void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
index e1ba8cb74e5a..e9b532a76c37 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7770.c
@@ -226,25 +226,18 @@ static struct platform_device scif9_device = {
226}; 226};
227 227
228static struct sh_timer_config tmu0_platform_data = { 228static struct sh_timer_config tmu0_platform_data = {
229 .channel_offset = 0x04, 229 .channels_mask = 7,
230 .timer_bit = 0,
231 .clockevent_rating = 200,
232}; 230};
233 231
234static struct resource tmu0_resources[] = { 232static struct resource tmu0_resources[] = {
235 [0] = { 233 DEFINE_RES_MEM(0xffd80000, 0x30),
236 .start = 0xffd80008, 234 DEFINE_RES_IRQ(evt2irq(0x400)),
237 .end = 0xffd80013, 235 DEFINE_RES_IRQ(evt2irq(0x420)),
238 .flags = IORESOURCE_MEM, 236 DEFINE_RES_IRQ(evt2irq(0x440)),
239 },
240 [1] = {
241 .start = evt2irq(0x400),
242 .flags = IORESOURCE_IRQ,
243 },
244}; 237};
245 238
246static struct platform_device tmu0_device = { 239static struct platform_device tmu0_device = {
247 .name = "sh_tmu", 240 .name = "sh-tmu",
248 .id = 0, 241 .id = 0,
249 .dev = { 242 .dev = {
250 .platform_data = &tmu0_platform_data, 243 .platform_data = &tmu0_platform_data,
@@ -254,25 +247,18 @@ static struct platform_device tmu0_device = {
254}; 247};
255 248
256static struct sh_timer_config tmu1_platform_data = { 249static struct sh_timer_config tmu1_platform_data = {
257 .channel_offset = 0x10, 250 .channels_mask = 7,
258 .timer_bit = 1,
259 .clocksource_rating = 200,
260}; 251};
261 252
262static struct resource tmu1_resources[] = { 253static struct resource tmu1_resources[] = {
263 [0] = { 254 DEFINE_RES_MEM(0xffd81000, 0x30),
264 .start = 0xffd80014, 255 DEFINE_RES_IRQ(evt2irq(0x460)),
265 .end = 0xffd8001f, 256 DEFINE_RES_IRQ(evt2irq(0x480)),
266 .flags = IORESOURCE_MEM, 257 DEFINE_RES_IRQ(evt2irq(0x4a0)),
267 },
268 [1] = {
269 .start = evt2irq(0x420),
270 .flags = IORESOURCE_IRQ,
271 },
272}; 258};
273 259
274static struct platform_device tmu1_device = { 260static struct platform_device tmu1_device = {
275 .name = "sh_tmu", 261 .name = "sh-tmu",
276 .id = 1, 262 .id = 1,
277 .dev = { 263 .dev = {
278 .platform_data = &tmu1_platform_data, 264 .platform_data = &tmu1_platform_data,
@@ -282,24 +268,18 @@ static struct platform_device tmu1_device = {
282}; 268};
283 269
284static struct sh_timer_config tmu2_platform_data = { 270static struct sh_timer_config tmu2_platform_data = {
285 .channel_offset = 0x1c, 271 .channels_mask = 7,
286 .timer_bit = 2,
287}; 272};
288 273
289static struct resource tmu2_resources[] = { 274static struct resource tmu2_resources[] = {
290 [0] = { 275 DEFINE_RES_MEM(0xffd82000, 0x2c),
291 .start = 0xffd80020, 276 DEFINE_RES_IRQ(evt2irq(0x4c0)),
292 .end = 0xffd8002f, 277 DEFINE_RES_IRQ(evt2irq(0x4e0)),
293 .flags = IORESOURCE_MEM, 278 DEFINE_RES_IRQ(evt2irq(0x500)),
294 },
295 [1] = {
296 .start = evt2irq(0x440),
297 .flags = IORESOURCE_IRQ,
298 },
299}; 279};
300 280
301static struct platform_device tmu2_device = { 281static struct platform_device tmu2_device = {
302 .name = "sh_tmu", 282 .name = "sh-tmu",
303 .id = 2, 283 .id = 2,
304 .dev = { 284 .dev = {
305 .platform_data = &tmu2_platform_data, 285 .platform_data = &tmu2_platform_data,
@@ -308,168 +288,6 @@ static struct platform_device tmu2_device = {
308 .num_resources = ARRAY_SIZE(tmu2_resources), 288 .num_resources = ARRAY_SIZE(tmu2_resources),
309}; 289};
310 290
311static struct sh_timer_config tmu3_platform_data = {
312 .channel_offset = 0x04,
313 .timer_bit = 0,
314};
315
316static struct resource tmu3_resources[] = {
317 [0] = {
318 .start = 0xffd81008,
319 .end = 0xffd81013,
320 .flags = IORESOURCE_MEM,
321 },
322 [1] = {
323 .start = evt2irq(0x460),
324 .flags = IORESOURCE_IRQ,
325 },
326};
327
328static struct platform_device tmu3_device = {
329 .name = "sh_tmu",
330 .id = 3,
331 .dev = {
332 .platform_data = &tmu3_platform_data,
333 },
334 .resource = tmu3_resources,
335 .num_resources = ARRAY_SIZE(tmu3_resources),
336};
337
338static struct sh_timer_config tmu4_platform_data = {
339 .channel_offset = 0x10,
340 .timer_bit = 1,
341};
342
343static struct resource tmu4_resources[] = {
344 [0] = {
345 .start = 0xffd81014,
346 .end = 0xffd8101f,
347 .flags = IORESOURCE_MEM,
348 },
349 [1] = {
350 .start = evt2irq(0x480),
351 .flags = IORESOURCE_IRQ,
352 },
353};
354
355static struct platform_device tmu4_device = {
356 .name = "sh_tmu",
357 .id = 4,
358 .dev = {
359 .platform_data = &tmu4_platform_data,
360 },
361 .resource = tmu4_resources,
362 .num_resources = ARRAY_SIZE(tmu4_resources),
363};
364
365static struct sh_timer_config tmu5_platform_data = {
366 .channel_offset = 0x1c,
367 .timer_bit = 2,
368};
369
370static struct resource tmu5_resources[] = {
371 [0] = {
372 .start = 0xffd81020,
373 .end = 0xffd8102f,
374 .flags = IORESOURCE_MEM,
375 },
376 [1] = {
377 .start = evt2irq(0x4a0),
378 .flags = IORESOURCE_IRQ,
379 },
380};
381
382static struct platform_device tmu5_device = {
383 .name = "sh_tmu",
384 .id = 5,
385 .dev = {
386 .platform_data = &tmu5_platform_data,
387 },
388 .resource = tmu5_resources,
389 .num_resources = ARRAY_SIZE(tmu5_resources),
390};
391
392static struct sh_timer_config tmu6_platform_data = {
393 .channel_offset = 0x04,
394 .timer_bit = 0,
395};
396
397static struct resource tmu6_resources[] = {
398 [0] = {
399 .start = 0xffd82008,
400 .end = 0xffd82013,
401 .flags = IORESOURCE_MEM,
402 },
403 [1] = {
404 .start = evt2irq(0x4c0),
405 .flags = IORESOURCE_IRQ,
406 },
407};
408
409static struct platform_device tmu6_device = {
410 .name = "sh_tmu",
411 .id = 6,
412 .dev = {
413 .platform_data = &tmu6_platform_data,
414 },
415 .resource = tmu6_resources,
416 .num_resources = ARRAY_SIZE(tmu6_resources),
417};
418
419static struct sh_timer_config tmu7_platform_data = {
420 .channel_offset = 0x10,
421 .timer_bit = 1,
422};
423
424static struct resource tmu7_resources[] = {
425 [0] = {
426 .start = 0xffd82014,
427 .end = 0xffd8201f,
428 .flags = IORESOURCE_MEM,
429 },
430 [1] = {
431 .start = evt2irq(0x4e0),
432 .flags = IORESOURCE_IRQ,
433 },
434};
435
436static struct platform_device tmu7_device = {
437 .name = "sh_tmu",
438 .id = 7,
439 .dev = {
440 .platform_data = &tmu7_platform_data,
441 },
442 .resource = tmu7_resources,
443 .num_resources = ARRAY_SIZE(tmu7_resources),
444};
445
446static struct sh_timer_config tmu8_platform_data = {
447 .channel_offset = 0x1c,
448 .timer_bit = 2,
449};
450
451static struct resource tmu8_resources[] = {
452 [0] = {
453 .start = 0xffd82020,
454 .end = 0xffd8202b,
455 .flags = IORESOURCE_MEM,
456 },
457 [1] = {
458 .start = evt2irq(0x500),
459 .flags = IORESOURCE_IRQ,
460 },
461};
462
463static struct platform_device tmu8_device = {
464 .name = "sh_tmu",
465 .id = 8,
466 .dev = {
467 .platform_data = &tmu8_platform_data,
468 },
469 .resource = tmu8_resources,
470 .num_resources = ARRAY_SIZE(tmu8_resources),
471};
472
473static struct platform_device *sh7770_devices[] __initdata = { 291static struct platform_device *sh7770_devices[] __initdata = {
474 &scif0_device, 292 &scif0_device,
475 &scif1_device, 293 &scif1_device,
@@ -484,12 +302,6 @@ static struct platform_device *sh7770_devices[] __initdata = {
484 &tmu0_device, 302 &tmu0_device,
485 &tmu1_device, 303 &tmu1_device,
486 &tmu2_device, 304 &tmu2_device,
487 &tmu3_device,
488 &tmu4_device,
489 &tmu5_device,
490 &tmu6_device,
491 &tmu7_device,
492 &tmu8_device,
493}; 305};
494 306
495static int __init sh7770_devices_setup(void) 307static int __init sh7770_devices_setup(void)
@@ -513,12 +325,6 @@ static struct platform_device *sh7770_early_devices[] __initdata = {
513 &tmu0_device, 325 &tmu0_device,
514 &tmu1_device, 326 &tmu1_device,
515 &tmu2_device, 327 &tmu2_device,
516 &tmu3_device,
517 &tmu4_device,
518 &tmu5_device,
519 &tmu6_device,
520 &tmu7_device,
521 &tmu8_device,
522}; 328};
523 329
524void __init plat_early_device_setup(void) 330void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index 668e54bafa86..3ee7dd9b3a65 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -62,25 +62,18 @@ static struct platform_device scif1_device = {
62}; 62};
63 63
64static struct sh_timer_config tmu0_platform_data = { 64static struct sh_timer_config tmu0_platform_data = {
65 .channel_offset = 0x04, 65 .channels_mask = 7,
66 .timer_bit = 0,
67 .clockevent_rating = 200,
68}; 66};
69 67
70static struct resource tmu0_resources[] = { 68static struct resource tmu0_resources[] = {
71 [0] = { 69 DEFINE_RES_MEM(0xffd80000, 0x30),
72 .start = 0xffd80008, 70 DEFINE_RES_IRQ(evt2irq(0x580)),
73 .end = 0xffd80013, 71 DEFINE_RES_IRQ(evt2irq(0x5a0)),
74 .flags = IORESOURCE_MEM, 72 DEFINE_RES_IRQ(evt2irq(0x5c0)),
75 },
76 [1] = {
77 .start = evt2irq(0x580),
78 .flags = IORESOURCE_IRQ,
79 },
80}; 73};
81 74
82static struct platform_device tmu0_device = { 75static struct platform_device tmu0_device = {
83 .name = "sh_tmu", 76 .name = "sh-tmu",
84 .id = 0, 77 .id = 0,
85 .dev = { 78 .dev = {
86 .platform_data = &tmu0_platform_data, 79 .platform_data = &tmu0_platform_data,
@@ -90,25 +83,18 @@ static struct platform_device tmu0_device = {
90}; 83};
91 84
92static struct sh_timer_config tmu1_platform_data = { 85static struct sh_timer_config tmu1_platform_data = {
93 .channel_offset = 0x10, 86 .channels_mask = 7,
94 .timer_bit = 1,
95 .clocksource_rating = 200,
96}; 87};
97 88
98static struct resource tmu1_resources[] = { 89static struct resource tmu1_resources[] = {
99 [0] = { 90 DEFINE_RES_MEM(0xffdc0000, 0x2c),
100 .start = 0xffd80014, 91 DEFINE_RES_IRQ(evt2irq(0xe00)),
101 .end = 0xffd8001f, 92 DEFINE_RES_IRQ(evt2irq(0xe20)),
102 .flags = IORESOURCE_MEM, 93 DEFINE_RES_IRQ(evt2irq(0xe40)),
103 },
104 [1] = {
105 .start = evt2irq(0x5a0),
106 .flags = IORESOURCE_IRQ,
107 },
108}; 94};
109 95
110static struct platform_device tmu1_device = { 96static struct platform_device tmu1_device = {
111 .name = "sh_tmu", 97 .name = "sh-tmu",
112 .id = 1, 98 .id = 1,
113 .dev = { 99 .dev = {
114 .platform_data = &tmu1_platform_data, 100 .platform_data = &tmu1_platform_data,
@@ -117,114 +103,6 @@ static struct platform_device tmu1_device = {
117 .num_resources = ARRAY_SIZE(tmu1_resources), 103 .num_resources = ARRAY_SIZE(tmu1_resources),
118}; 104};
119 105
120static struct sh_timer_config tmu2_platform_data = {
121 .channel_offset = 0x1c,
122 .timer_bit = 2,
123};
124
125static struct resource tmu2_resources[] = {
126 [0] = {
127 .start = 0xffd80020,
128 .end = 0xffd8002f,
129 .flags = IORESOURCE_MEM,
130 },
131 [1] = {
132 .start = evt2irq(0x5c0),
133 .flags = IORESOURCE_IRQ,
134 },
135};
136
137static struct platform_device tmu2_device = {
138 .name = "sh_tmu",
139 .id = 2,
140 .dev = {
141 .platform_data = &tmu2_platform_data,
142 },
143 .resource = tmu2_resources,
144 .num_resources = ARRAY_SIZE(tmu2_resources),
145};
146
147static struct sh_timer_config tmu3_platform_data = {
148 .channel_offset = 0x04,
149 .timer_bit = 0,
150};
151
152static struct resource tmu3_resources[] = {
153 [0] = {
154 .start = 0xffdc0008,
155 .end = 0xffdc0013,
156 .flags = IORESOURCE_MEM,
157 },
158 [1] = {
159 .start = evt2irq(0xe00),
160 .flags = IORESOURCE_IRQ,
161 },
162};
163
164static struct platform_device tmu3_device = {
165 .name = "sh_tmu",
166 .id = 3,
167 .dev = {
168 .platform_data = &tmu3_platform_data,
169 },
170 .resource = tmu3_resources,
171 .num_resources = ARRAY_SIZE(tmu3_resources),
172};
173
174static struct sh_timer_config tmu4_platform_data = {
175 .channel_offset = 0x10,
176 .timer_bit = 1,
177};
178
179static struct resource tmu4_resources[] = {
180 [0] = {
181 .start = 0xffdc0014,
182 .end = 0xffdc001f,
183 .flags = IORESOURCE_MEM,
184 },
185 [1] = {
186 .start = evt2irq(0xe20),
187 .flags = IORESOURCE_IRQ,
188 },
189};
190
191static struct platform_device tmu4_device = {
192 .name = "sh_tmu",
193 .id = 4,
194 .dev = {
195 .platform_data = &tmu4_platform_data,
196 },
197 .resource = tmu4_resources,
198 .num_resources = ARRAY_SIZE(tmu4_resources),
199};
200
201static struct sh_timer_config tmu5_platform_data = {
202 .channel_offset = 0x1c,
203 .timer_bit = 2,
204};
205
206static struct resource tmu5_resources[] = {
207 [0] = {
208 .start = 0xffdc0020,
209 .end = 0xffdc002b,
210 .flags = IORESOURCE_MEM,
211 },
212 [1] = {
213 .start = evt2irq(0xe40),
214 .flags = IORESOURCE_IRQ,
215 },
216};
217
218static struct platform_device tmu5_device = {
219 .name = "sh_tmu",
220 .id = 5,
221 .dev = {
222 .platform_data = &tmu5_platform_data,
223 },
224 .resource = tmu5_resources,
225 .num_resources = ARRAY_SIZE(tmu5_resources),
226};
227
228static struct resource rtc_resources[] = { 106static struct resource rtc_resources[] = {
229 [0] = { 107 [0] = {
230 .start = 0xffe80000, 108 .start = 0xffe80000,
@@ -386,10 +264,6 @@ static struct platform_device *sh7780_devices[] __initdata = {
386 &scif1_device, 264 &scif1_device,
387 &tmu0_device, 265 &tmu0_device,
388 &tmu1_device, 266 &tmu1_device,
389 &tmu2_device,
390 &tmu3_device,
391 &tmu4_device,
392 &tmu5_device,
393 &rtc_device, 267 &rtc_device,
394 &dma0_device, 268 &dma0_device,
395 &dma1_device, 269 &dma1_device,
@@ -407,10 +281,6 @@ static struct platform_device *sh7780_early_devices[] __initdata = {
407 &scif1_device, 281 &scif1_device,
408 &tmu0_device, 282 &tmu0_device,
409 &tmu1_device, 283 &tmu1_device,
410 &tmu2_device,
411 &tmu3_device,
412 &tmu4_device,
413 &tmu5_device,
414}; 284};
415 285
416void __init plat_early_device_setup(void) 286void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index 4aa679140209..c72d5a5d0995 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -152,25 +152,18 @@ static struct platform_device scif5_device = {
152}; 152};
153 153
154static struct sh_timer_config tmu0_platform_data = { 154static struct sh_timer_config tmu0_platform_data = {
155 .channel_offset = 0x04, 155 .channels_mask = 7,
156 .timer_bit = 0,
157 .clockevent_rating = 200,
158}; 156};
159 157
160static struct resource tmu0_resources[] = { 158static struct resource tmu0_resources[] = {
161 [0] = { 159 DEFINE_RES_MEM(0xffd80000, 0x30),
162 .start = 0xffd80008, 160 DEFINE_RES_IRQ(evt2irq(0x580)),
163 .end = 0xffd80013, 161 DEFINE_RES_IRQ(evt2irq(0x5a0)),
164 .flags = IORESOURCE_MEM, 162 DEFINE_RES_IRQ(evt2irq(0x5c0)),
165 },
166 [1] = {
167 .start = evt2irq(0x580),
168 .flags = IORESOURCE_IRQ,
169 },
170}; 163};
171 164
172static struct platform_device tmu0_device = { 165static struct platform_device tmu0_device = {
173 .name = "sh_tmu", 166 .name = "sh-tmu",
174 .id = 0, 167 .id = 0,
175 .dev = { 168 .dev = {
176 .platform_data = &tmu0_platform_data, 169 .platform_data = &tmu0_platform_data,
@@ -180,25 +173,18 @@ static struct platform_device tmu0_device = {
180}; 173};
181 174
182static struct sh_timer_config tmu1_platform_data = { 175static struct sh_timer_config tmu1_platform_data = {
183 .channel_offset = 0x10, 176 .channels_mask = 7,
184 .timer_bit = 1,
185 .clocksource_rating = 200,
186}; 177};
187 178
188static struct resource tmu1_resources[] = { 179static struct resource tmu1_resources[] = {
189 [0] = { 180 DEFINE_RES_MEM(0xffdc0000, 0x2c),
190 .start = 0xffd80014, 181 DEFINE_RES_IRQ(evt2irq(0xe00)),
191 .end = 0xffd8001f, 182 DEFINE_RES_IRQ(evt2irq(0xe20)),
192 .flags = IORESOURCE_MEM, 183 DEFINE_RES_IRQ(evt2irq(0xe40)),
193 },
194 [1] = {
195 .start = evt2irq(0x5a0),
196 .flags = IORESOURCE_IRQ,
197 },
198}; 184};
199 185
200static struct platform_device tmu1_device = { 186static struct platform_device tmu1_device = {
201 .name = "sh_tmu", 187 .name = "sh-tmu",
202 .id = 1, 188 .id = 1,
203 .dev = { 189 .dev = {
204 .platform_data = &tmu1_platform_data, 190 .platform_data = &tmu1_platform_data,
@@ -207,114 +193,6 @@ static struct platform_device tmu1_device = {
207 .num_resources = ARRAY_SIZE(tmu1_resources), 193 .num_resources = ARRAY_SIZE(tmu1_resources),
208}; 194};
209 195
210static struct sh_timer_config tmu2_platform_data = {
211 .channel_offset = 0x1c,
212 .timer_bit = 2,
213};
214
215static struct resource tmu2_resources[] = {
216 [0] = {
217 .start = 0xffd80020,
218 .end = 0xffd8002f,
219 .flags = IORESOURCE_MEM,
220 },
221 [1] = {
222 .start = evt2irq(0x5c0),
223 .flags = IORESOURCE_IRQ,
224 },
225};
226
227static struct platform_device tmu2_device = {
228 .name = "sh_tmu",
229 .id = 2,
230 .dev = {
231 .platform_data = &tmu2_platform_data,
232 },
233 .resource = tmu2_resources,
234 .num_resources = ARRAY_SIZE(tmu2_resources),
235};
236
237static struct sh_timer_config tmu3_platform_data = {
238 .channel_offset = 0x04,
239 .timer_bit = 0,
240};
241
242static struct resource tmu3_resources[] = {
243 [0] = {
244 .start = 0xffdc0008,
245 .end = 0xffdc0013,
246 .flags = IORESOURCE_MEM,
247 },
248 [1] = {
249 .start = evt2irq(0xe00),
250 .flags = IORESOURCE_IRQ,
251 },
252};
253
254static struct platform_device tmu3_device = {
255 .name = "sh_tmu",
256 .id = 3,
257 .dev = {
258 .platform_data = &tmu3_platform_data,
259 },
260 .resource = tmu3_resources,
261 .num_resources = ARRAY_SIZE(tmu3_resources),
262};
263
264static struct sh_timer_config tmu4_platform_data = {
265 .channel_offset = 0x10,
266 .timer_bit = 1,
267};
268
269static struct resource tmu4_resources[] = {
270 [0] = {
271 .start = 0xffdc0014,
272 .end = 0xffdc001f,
273 .flags = IORESOURCE_MEM,
274 },
275 [1] = {
276 .start = evt2irq(0xe20),
277 .flags = IORESOURCE_IRQ,
278 },
279};
280
281static struct platform_device tmu4_device = {
282 .name = "sh_tmu",
283 .id = 4,
284 .dev = {
285 .platform_data = &tmu4_platform_data,
286 },
287 .resource = tmu4_resources,
288 .num_resources = ARRAY_SIZE(tmu4_resources),
289};
290
291static struct sh_timer_config tmu5_platform_data = {
292 .channel_offset = 0x1c,
293 .timer_bit = 2,
294};
295
296static struct resource tmu5_resources[] = {
297 [0] = {
298 .start = 0xffdc0020,
299 .end = 0xffdc002b,
300 .flags = IORESOURCE_MEM,
301 },
302 [1] = {
303 .start = evt2irq(0xe40),
304 .flags = IORESOURCE_IRQ,
305 },
306};
307
308static struct platform_device tmu5_device = {
309 .name = "sh_tmu",
310 .id = 5,
311 .dev = {
312 .platform_data = &tmu5_platform_data,
313 },
314 .resource = tmu5_resources,
315 .num_resources = ARRAY_SIZE(tmu5_resources),
316};
317
318/* DMA */ 196/* DMA */
319static const struct sh_dmae_channel sh7785_dmae0_channels[] = { 197static const struct sh_dmae_channel sh7785_dmae0_channels[] = {
320 { 198 {
@@ -460,10 +338,6 @@ static struct platform_device *sh7785_devices[] __initdata = {
460 &scif5_device, 338 &scif5_device,
461 &tmu0_device, 339 &tmu0_device,
462 &tmu1_device, 340 &tmu1_device,
463 &tmu2_device,
464 &tmu3_device,
465 &tmu4_device,
466 &tmu5_device,
467 &dma0_device, 341 &dma0_device,
468 &dma1_device, 342 &dma1_device,
469}; 343};
@@ -484,10 +358,6 @@ static struct platform_device *sh7785_early_devices[] __initdata = {
484 &scif5_device, 358 &scif5_device,
485 &tmu0_device, 359 &tmu0_device,
486 &tmu1_device, 360 &tmu1_device,
487 &tmu2_device,
488 &tmu3_device,
489 &tmu4_device,
490 &tmu5_device,
491}; 361};
492 362
493void __init plat_early_device_setup(void) 363void __init plat_early_device_setup(void)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index 5d619a551a3b..479e79bdd3d0 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -175,25 +175,18 @@ static struct platform_device scif5_device = {
175}; 175};
176 176
177static struct sh_timer_config tmu0_platform_data = { 177static struct sh_timer_config tmu0_platform_data = {
178 .channel_offset = 0x04, 178 .channels_mask = 7,
179 .timer_bit = 0,
180 .clockevent_rating = 200,
181}; 179};
182 180
183static struct resource tmu0_resources[] = { 181static struct resource tmu0_resources[] = {
184 [0] = { 182 DEFINE_RES_MEM(0xffd80000, 0x30),
185 .start = 0xffd80008, 183 DEFINE_RES_IRQ(evt2irq(0x400)),
186 .end = 0xffd80013, 184 DEFINE_RES_IRQ(evt2irq(0x420)),
187 .flags = IORESOURCE_MEM, 185 DEFINE_RES_IRQ(evt2irq(0x440)),
188 },
189 [1] = {
190 .start = evt2irq(0x400),
191 .flags = IORESOURCE_IRQ,
192 },
193}; 186};
194 187
195static struct platform_device tmu0_device = { 188static struct platform_device tmu0_device = {
196 .name = "sh_tmu", 189 .name = "sh-tmu",
197 .id = 0, 190 .id = 0,
198 .dev = { 191 .dev = {
199 .platform_data = &tmu0_platform_data, 192 .platform_data = &tmu0_platform_data,
@@ -203,25 +196,18 @@ static struct platform_device tmu0_device = {
203}; 196};
204 197
205static struct sh_timer_config tmu1_platform_data = { 198static struct sh_timer_config tmu1_platform_data = {
206 .channel_offset = 0x10, 199 .channels_mask = 7,
207 .timer_bit = 1,
208 .clocksource_rating = 200,
209}; 200};
210 201
211static struct resource tmu1_resources[] = { 202static struct resource tmu1_resources[] = {
212 [0] = { 203 DEFINE_RES_MEM(0xffda0000, 0x2c),
213 .start = 0xffd80014, 204 DEFINE_RES_IRQ(evt2irq(0x480)),
214 .end = 0xffd8001f, 205 DEFINE_RES_IRQ(evt2irq(0x4a0)),
215 .flags = IORESOURCE_MEM, 206 DEFINE_RES_IRQ(evt2irq(0x4c0)),
216 },
217 [1] = {
218 .start = evt2irq(0x420),
219 .flags = IORESOURCE_IRQ,
220 },
221}; 207};
222 208
223static struct platform_device tmu1_device = { 209static struct platform_device tmu1_device = {
224 .name = "sh_tmu", 210 .name = "sh-tmu",
225 .id = 1, 211 .id = 1,
226 .dev = { 212 .dev = {
227 .platform_data = &tmu1_platform_data, 213 .platform_data = &tmu1_platform_data,
@@ -231,24 +217,18 @@ static struct platform_device tmu1_device = {
231}; 217};
232 218
233static struct sh_timer_config tmu2_platform_data = { 219static struct sh_timer_config tmu2_platform_data = {
234 .channel_offset = 0x1c, 220 .channels_mask = 7,
235 .timer_bit = 2,
236}; 221};
237 222
238static struct resource tmu2_resources[] = { 223static struct resource tmu2_resources[] = {
239 [0] = { 224 DEFINE_RES_MEM(0xffdc0000, 0x2c),
240 .start = 0xffd80020, 225 DEFINE_RES_IRQ(evt2irq(0x7a0)),
241 .end = 0xffd8002f, 226 DEFINE_RES_IRQ(evt2irq(0x7a0)),
242 .flags = IORESOURCE_MEM, 227 DEFINE_RES_IRQ(evt2irq(0x7a0)),
243 },
244 [1] = {
245 .start = evt2irq(0x440),
246 .flags = IORESOURCE_IRQ,
247 },
248}; 228};
249 229
250static struct platform_device tmu2_device = { 230static struct platform_device tmu2_device = {
251 .name = "sh_tmu", 231 .name = "sh-tmu",
252 .id = 2, 232 .id = 2,
253 .dev = { 233 .dev = {
254 .platform_data = &tmu2_platform_data, 234 .platform_data = &tmu2_platform_data,
@@ -258,24 +238,18 @@ static struct platform_device tmu2_device = {
258}; 238};
259 239
260static struct sh_timer_config tmu3_platform_data = { 240static struct sh_timer_config tmu3_platform_data = {
261 .channel_offset = 0x04, 241 .channels_mask = 7,
262 .timer_bit = 0,
263}; 242};
264 243
265static struct resource tmu3_resources[] = { 244static struct resource tmu3_resources[] = {
266 [0] = { 245 DEFINE_RES_MEM(0xffde0000, 0x2c),
267 .start = 0xffda0008, 246 DEFINE_RES_IRQ(evt2irq(0x7c0)),
268 .end = 0xffda0013, 247 DEFINE_RES_IRQ(evt2irq(0x7c0)),
269 .flags = IORESOURCE_MEM, 248 DEFINE_RES_IRQ(evt2irq(0x7c0)),
270 },
271 [1] = {
272 .start = evt2irq(0x480),
273 .flags = IORESOURCE_IRQ,
274 },
275}; 249};
276 250
277static struct platform_device tmu3_device = { 251static struct platform_device tmu3_device = {
278 .name = "sh_tmu", 252 .name = "sh-tmu",
279 .id = 3, 253 .id = 3,
280 .dev = { 254 .dev = {
281 .platform_data = &tmu3_platform_data, 255 .platform_data = &tmu3_platform_data,
@@ -284,222 +258,6 @@ static struct platform_device tmu3_device = {
284 .num_resources = ARRAY_SIZE(tmu3_resources), 258 .num_resources = ARRAY_SIZE(tmu3_resources),
285}; 259};
286 260
287static struct sh_timer_config tmu4_platform_data = {
288 .channel_offset = 0x10,
289 .timer_bit = 1,
290};
291
292static struct resource tmu4_resources[] = {
293 [0] = {
294 .start = 0xffda0014,
295 .end = 0xffda001f,
296 .flags = IORESOURCE_MEM,
297 },
298 [1] = {
299 .start = evt2irq(0x4a0),
300 .flags = IORESOURCE_IRQ,
301 },
302};
303
304static struct platform_device tmu4_device = {
305 .name = "sh_tmu",
306 .id = 4,
307 .dev = {
308 .platform_data = &tmu4_platform_data,
309 },
310 .resource = tmu4_resources,
311 .num_resources = ARRAY_SIZE(tmu4_resources),
312};
313
314static struct sh_timer_config tmu5_platform_data = {
315 .channel_offset = 0x1c,
316 .timer_bit = 2,
317};
318
319static struct resource tmu5_resources[] = {
320 [0] = {
321 .start = 0xffda0020,
322 .end = 0xffda002b,
323 .flags = IORESOURCE_MEM,
324 },
325 [1] = {
326 .start = evt2irq(0x4c0),
327 .flags = IORESOURCE_IRQ,
328 },
329};
330
331static struct platform_device tmu5_device = {
332 .name = "sh_tmu",
333 .id = 5,
334 .dev = {
335 .platform_data = &tmu5_platform_data,
336 },
337 .resource = tmu5_resources,
338 .num_resources = ARRAY_SIZE(tmu5_resources),
339};
340
341static struct sh_timer_config tmu6_platform_data = {
342 .channel_offset = 0x04,
343 .timer_bit = 0,
344};
345
346static struct resource tmu6_resources[] = {
347 [0] = {
348 .start = 0xffdc0008,
349 .end = 0xffdc0013,
350 .flags = IORESOURCE_MEM,
351 },
352 [1] = {
353 .start = evt2irq(0x7a0),
354 .flags = IORESOURCE_IRQ,
355 },
356};
357
358static struct platform_device tmu6_device = {
359 .name = "sh_tmu",
360 .id = 6,
361 .dev = {
362 .platform_data = &tmu6_platform_data,
363 },
364 .resource = tmu6_resources,
365 .num_resources = ARRAY_SIZE(tmu6_resources),
366};
367
368static struct sh_timer_config tmu7_platform_data = {
369 .channel_offset = 0x10,
370 .timer_bit = 1,
371};
372
373static struct resource tmu7_resources[] = {
374 [0] = {
375 .start = 0xffdc0014,
376 .end = 0xffdc001f,
377 .flags = IORESOURCE_MEM,
378 },
379 [1] = {
380 .start = evt2irq(0x7a0),
381 .flags = IORESOURCE_IRQ,
382 },
383};
384
385static struct platform_device tmu7_device = {
386 .name = "sh_tmu",
387 .id = 7,
388 .dev = {
389 .platform_data = &tmu7_platform_data,
390 },
391 .resource = tmu7_resources,
392 .num_resources = ARRAY_SIZE(tmu7_resources),
393};
394
395static struct sh_timer_config tmu8_platform_data = {
396 .channel_offset = 0x1c,
397 .timer_bit = 2,
398};
399
400static struct resource tmu8_resources[] = {
401 [0] = {
402 .start = 0xffdc0020,
403 .end = 0xffdc002b,
404 .flags = IORESOURCE_MEM,
405 },
406 [1] = {
407 .start = evt2irq(0x7a0),
408 .flags = IORESOURCE_IRQ,
409 },
410};
411
412static struct platform_device tmu8_device = {
413 .name = "sh_tmu",
414 .id = 8,
415 .dev = {
416 .platform_data = &tmu8_platform_data,
417 },
418 .resource = tmu8_resources,
419 .num_resources = ARRAY_SIZE(tmu8_resources),
420};
421
422static struct sh_timer_config tmu9_platform_data = {
423 .channel_offset = 0x04,
424 .timer_bit = 0,
425};
426
427static struct resource tmu9_resources[] = {
428 [0] = {
429 .start = 0xffde0008,
430 .end = 0xffde0013,
431 .flags = IORESOURCE_MEM,
432 },
433 [1] = {
434 .start = evt2irq(0x7c0),
435 .flags = IORESOURCE_IRQ,
436 },
437};
438
439static struct platform_device tmu9_device = {
440 .name = "sh_tmu",
441 .id = 9,
442 .dev = {
443 .platform_data = &tmu9_platform_data,
444 },
445 .resource = tmu9_resources,
446 .num_resources = ARRAY_SIZE(tmu9_resources),
447};
448
449static struct sh_timer_config tmu10_platform_data = {
450 .channel_offset = 0x10,
451 .timer_bit = 1,
452};
453
454static struct resource tmu10_resources[] = {
455 [0] = {
456 .start = 0xffde0014,
457 .end = 0xffde001f,
458 .flags = IORESOURCE_MEM,
459 },
460 [1] = {
461 .start = evt2irq(0x7c0),
462 .flags = IORESOURCE_IRQ,
463 },
464};
465
466static struct platform_device tmu10_device = {
467 .name = "sh_tmu",
468 .id = 10,
469 .dev = {
470 .platform_data = &tmu10_platform_data,
471 },
472 .resource = tmu10_resources,
473 .num_resources = ARRAY_SIZE(tmu10_resources),
474};
475
476static struct sh_timer_config tmu11_platform_data = {
477 .channel_offset = 0x1c,
478 .timer_bit = 2,
479};
480
481static struct resource tmu11_resources[] = {
482 [0] = {
483 .start = 0xffde0020,
484 .end = 0xffde002b,
485 .flags = IORESOURCE_MEM,
486 },
487 [1] = {
488 .start = evt2irq(0x7c0),
489 .flags = IORESOURCE_IRQ,
490 },
491};
492
493static struct platform_device tmu11_device = {
494 .name = "sh_tmu",
495 .id = 11,
496 .dev = {
497 .platform_data = &tmu11_platform_data,
498 },
499 .resource = tmu11_resources,
500 .num_resources = ARRAY_SIZE(tmu11_resources),
501};
502
503static const struct sh_dmae_channel dmac0_channels[] = { 261static const struct sh_dmae_channel dmac0_channels[] = {
504 { 262 {
505 .offset = 0, 263 .offset = 0,
@@ -641,15 +399,6 @@ static struct platform_device *sh7786_early_devices[] __initdata = {
641 &tmu0_device, 399 &tmu0_device,
642 &tmu1_device, 400 &tmu1_device,
643 &tmu2_device, 401 &tmu2_device,
644 &tmu3_device,
645 &tmu4_device,
646 &tmu5_device,
647 &tmu6_device,
648 &tmu7_device,
649 &tmu8_device,
650 &tmu9_device,
651 &tmu10_device,
652 &tmu11_device,
653}; 402};
654 403
655static struct platform_device *sh7786_devices[] __initdata = { 404static struct platform_device *sh7786_devices[] __initdata = {
diff --git a/arch/sh/kernel/cpu/sh4a/setup-shx3.c b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
index 0856bcbb1da0..a78c5feb4e3b 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-shx3.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-shx3.c
@@ -100,25 +100,18 @@ static struct platform_device scif2_device = {
100}; 100};
101 101
102static struct sh_timer_config tmu0_platform_data = { 102static struct sh_timer_config tmu0_platform_data = {
103 .channel_offset = 0x04, 103 .channels_mask = 7,
104 .timer_bit = 0,
105 .clockevent_rating = 200,
106}; 104};
107 105
108static struct resource tmu0_resources[] = { 106static struct resource tmu0_resources[] = {
109 [0] = { 107 DEFINE_RES_MEM(0xffc10000, 0x30),
110 .start = 0xffc10008, 108 DEFINE_RES_IRQ(evt2irq(0x400)),
111 .end = 0xffc10013, 109 DEFINE_RES_IRQ(evt2irq(0x420)),
112 .flags = IORESOURCE_MEM, 110 DEFINE_RES_IRQ(evt2irq(0x440)),
113 },
114 [1] = {
115 .start = evt2irq(0x400),
116 .flags = IORESOURCE_IRQ,
117 },
118}; 111};
119 112
120static struct platform_device tmu0_device = { 113static struct platform_device tmu0_device = {
121 .name = "sh_tmu", 114 .name = "sh-tmu",
122 .id = 0, 115 .id = 0,
123 .dev = { 116 .dev = {
124 .platform_data = &tmu0_platform_data, 117 .platform_data = &tmu0_platform_data,
@@ -128,25 +121,18 @@ static struct platform_device tmu0_device = {
128}; 121};
129 122
130static struct sh_timer_config tmu1_platform_data = { 123static struct sh_timer_config tmu1_platform_data = {
131 .channel_offset = 0x10, 124 .channels_mask = 7,
132 .timer_bit = 1,
133 .clocksource_rating = 200,
134}; 125};
135 126
136static struct resource tmu1_resources[] = { 127static struct resource tmu1_resources[] = {
137 [0] = { 128 DEFINE_RES_MEM(0xffc20000, 0x2c),
138 .start = 0xffc10014, 129 DEFINE_RES_IRQ(evt2irq(0x460)),
139 .end = 0xffc1001f, 130 DEFINE_RES_IRQ(evt2irq(0x480)),
140 .flags = IORESOURCE_MEM, 131 DEFINE_RES_IRQ(evt2irq(0x4a0)),
141 },
142 [1] = {
143 .start = evt2irq(0x420),
144 .flags = IORESOURCE_IRQ,
145 },
146}; 132};
147 133
148static struct platform_device tmu1_device = { 134static struct platform_device tmu1_device = {
149 .name = "sh_tmu", 135 .name = "sh-tmu",
150 .id = 1, 136 .id = 1,
151 .dev = { 137 .dev = {
152 .platform_data = &tmu1_platform_data, 138 .platform_data = &tmu1_platform_data,
@@ -155,124 +141,12 @@ static struct platform_device tmu1_device = {
155 .num_resources = ARRAY_SIZE(tmu1_resources), 141 .num_resources = ARRAY_SIZE(tmu1_resources),
156}; 142};
157 143
158static struct sh_timer_config tmu2_platform_data = {
159 .channel_offset = 0x1c,
160 .timer_bit = 2,
161};
162
163static struct resource tmu2_resources[] = {
164 [0] = {
165 .start = 0xffc10020,
166 .end = 0xffc1002f,
167 .flags = IORESOURCE_MEM,
168 },
169 [1] = {
170 .start = evt2irq(0x440),
171 .flags = IORESOURCE_IRQ,
172 },
173};
174
175static struct platform_device tmu2_device = {
176 .name = "sh_tmu",
177 .id = 2,
178 .dev = {
179 .platform_data = &tmu2_platform_data,
180 },
181 .resource = tmu2_resources,
182 .num_resources = ARRAY_SIZE(tmu2_resources),
183};
184
185static struct sh_timer_config tmu3_platform_data = {
186 .channel_offset = 0x04,
187 .timer_bit = 0,
188};
189
190static struct resource tmu3_resources[] = {
191 [0] = {
192 .start = 0xffc20008,
193 .end = 0xffc20013,
194 .flags = IORESOURCE_MEM,
195 },
196 [1] = {
197 .start = evt2irq(0x460),
198 .flags = IORESOURCE_IRQ,
199 },
200};
201
202static struct platform_device tmu3_device = {
203 .name = "sh_tmu",
204 .id = 3,
205 .dev = {
206 .platform_data = &tmu3_platform_data,
207 },
208 .resource = tmu3_resources,
209 .num_resources = ARRAY_SIZE(tmu3_resources),
210};
211
212static struct sh_timer_config tmu4_platform_data = {
213 .channel_offset = 0x10,
214 .timer_bit = 1,
215};
216
217static struct resource tmu4_resources[] = {
218 [0] = {
219 .start = 0xffc20014,
220 .end = 0xffc2001f,
221 .flags = IORESOURCE_MEM,
222 },
223 [1] = {
224 .start = evt2irq(0x480),
225 .flags = IORESOURCE_IRQ,
226 },
227};
228
229static struct platform_device tmu4_device = {
230 .name = "sh_tmu",
231 .id = 4,
232 .dev = {
233 .platform_data = &tmu4_platform_data,
234 },
235 .resource = tmu4_resources,
236 .num_resources = ARRAY_SIZE(tmu4_resources),
237};
238
239static struct sh_timer_config tmu5_platform_data = {
240 .channel_offset = 0x1c,
241 .timer_bit = 2,
242};
243
244static struct resource tmu5_resources[] = {
245 [0] = {
246 .start = 0xffc20020,
247 .end = 0xffc2002b,
248 .flags = IORESOURCE_MEM,
249 },
250 [1] = {
251 .start = evt2irq(0x4a0),
252 .flags = IORESOURCE_IRQ,
253 },
254};
255
256static struct platform_device tmu5_device = {
257 .name = "sh_tmu",
258 .id = 5,
259 .dev = {
260 .platform_data = &tmu5_platform_data,
261 },
262 .resource = tmu5_resources,
263 .num_resources = ARRAY_SIZE(tmu5_resources),
264};
265
266static struct platform_device *shx3_early_devices[] __initdata = { 144static struct platform_device *shx3_early_devices[] __initdata = {
267 &scif0_device, 145 &scif0_device,
268 &scif1_device, 146 &scif1_device,
269 &scif2_device, 147 &scif2_device,
270 &tmu0_device, 148 &tmu0_device,
271 &tmu1_device, 149 &tmu1_device,
272 &tmu2_device,
273 &tmu3_device,
274 &tmu4_device,
275 &tmu5_device,
276}; 150};
277 151
278static int __init shx3_devices_setup(void) 152static int __init shx3_devices_setup(void)
diff --git a/arch/sh/kernel/cpu/sh5/setup-sh5.c b/arch/sh/kernel/cpu/sh5/setup-sh5.c
index 14d68213d16b..1bf0b2cf6652 100644
--- a/arch/sh/kernel/cpu/sh5/setup-sh5.c
+++ b/arch/sh/kernel/cpu/sh5/setup-sh5.c
@@ -71,30 +71,20 @@ static struct platform_device rtc_device = {
71 71
72#define TMU_BLOCK_OFF 0x01020000 72#define TMU_BLOCK_OFF 0x01020000
73#define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF 73#define TMU_BASE PHYS_PERIPHERAL_BLOCK + TMU_BLOCK_OFF
74#define TMU0_BASE (TMU_BASE + 0x8 + (0xc * 0x0))
75#define TMU1_BASE (TMU_BASE + 0x8 + (0xc * 0x1))
76#define TMU2_BASE (TMU_BASE + 0x8 + (0xc * 0x2))
77 74
78static struct sh_timer_config tmu0_platform_data = { 75static struct sh_timer_config tmu0_platform_data = {
79 .channel_offset = 0x04, 76 .channels_mask = 7,
80 .timer_bit = 0,
81 .clockevent_rating = 200,
82}; 77};
83 78
84static struct resource tmu0_resources[] = { 79static struct resource tmu0_resources[] = {
85 [0] = { 80 DEFINE_RES_MEM(TMU_BASE, 0x30),
86 .start = TMU0_BASE, 81 DEFINE_RES_IRQ(IRQ_TUNI0),
87 .end = TMU0_BASE + 0xc - 1, 82 DEFINE_RES_IRQ(IRQ_TUNI1),
88 .flags = IORESOURCE_MEM, 83 DEFINE_RES_IRQ(IRQ_TUNI2),
89 },
90 [1] = {
91 .start = IRQ_TUNI0,
92 .flags = IORESOURCE_IRQ,
93 },
94}; 84};
95 85
96static struct platform_device tmu0_device = { 86static struct platform_device tmu0_device = {
97 .name = "sh_tmu", 87 .name = "sh-tmu",
98 .id = 0, 88 .id = 0,
99 .dev = { 89 .dev = {
100 .platform_data = &tmu0_platform_data, 90 .platform_data = &tmu0_platform_data,
@@ -103,66 +93,9 @@ static struct platform_device tmu0_device = {
103 .num_resources = ARRAY_SIZE(tmu0_resources), 93 .num_resources = ARRAY_SIZE(tmu0_resources),
104}; 94};
105 95
106static struct sh_timer_config tmu1_platform_data = {
107 .channel_offset = 0x10,
108 .timer_bit = 1,
109 .clocksource_rating = 200,
110};
111
112static struct resource tmu1_resources[] = {
113 [0] = {
114 .start = TMU1_BASE,
115 .end = TMU1_BASE + 0xc - 1,
116 .flags = IORESOURCE_MEM,
117 },
118 [1] = {
119 .start = IRQ_TUNI1,
120 .flags = IORESOURCE_IRQ,
121 },
122};
123
124static struct platform_device tmu1_device = {
125 .name = "sh_tmu",
126 .id = 1,
127 .dev = {
128 .platform_data = &tmu1_platform_data,
129 },
130 .resource = tmu1_resources,
131 .num_resources = ARRAY_SIZE(tmu1_resources),
132};
133
134static struct sh_timer_config tmu2_platform_data = {
135 .channel_offset = 0x1c,
136 .timer_bit = 2,
137};
138
139static struct resource tmu2_resources[] = {
140 [0] = {
141 .start = TMU2_BASE,
142 .end = TMU2_BASE + 0xc - 1,
143 .flags = IORESOURCE_MEM,
144 },
145 [1] = {
146 .start = IRQ_TUNI2,
147 .flags = IORESOURCE_IRQ,
148 },
149};
150
151static struct platform_device tmu2_device = {
152 .name = "sh_tmu",
153 .id = 2,
154 .dev = {
155 .platform_data = &tmu2_platform_data,
156 },
157 .resource = tmu2_resources,
158 .num_resources = ARRAY_SIZE(tmu2_resources),
159};
160
161static struct platform_device *sh5_early_devices[] __initdata = { 96static struct platform_device *sh5_early_devices[] __initdata = {
162 &scif0_device, 97 &scif0_device,
163 &tmu0_device, 98 &tmu0_device,
164 &tmu1_device,
165 &tmu2_device,
166}; 99};
167 100
168static struct platform_device *sh5_devices[] __initdata = { 101static struct platform_device *sh5_devices[] __initdata = {