aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 19:21:41 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-06-02 19:21:41 -0400
commitc67d9ce1668735a22762251e96b3fd31bb289867 (patch)
tree168fe6316912a5bd684267e9bcc158bb7906b134 /arch/arm/mach-shmobile
parent825f4e0271b0de3f7f31d963dcdaa0056fe9b73a (diff)
parent03a2ec647be0394b2b94b7a6a8af2310ad704c72 (diff)
Merge tag 'boards-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc into next
Pull ARM SoC board support updates from Olof Johansson: "The bulk of this branch is updates for Renesas Shmobile. They are still doing some enablement for classic boards first, and then come up with DT bindings when they've had a chance to learn more about the hardware. Not necessarily a bad way to go about it, and they're looking at moving some of the temporary board code resulting from it to drivers/staging instead to avoid the churn here. As a result of the shmobile clock cleanups, we end up merging quite a bit of SH code here as well. We ended up merging it here instead of in the cleanup branch due to the other board changes depending on it" * tag 'boards-for-3.16' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (130 commits) ARM: davinci: remove checks for CONFIG_USB_MUSB_PERIPHERAL ARM: add drivers for Colibri T30 to multi_v7_defconfig ARM: shmobile: Remove Genmai reference DTS ARM: shmobile: Let Genmai multiplatform boot with Genmai DTB ARM: shmobile: Sync Genmai DTS with Genmai reference DTS ARM: shmobile: genmai-reference: Remove legacy clock support ARM: shmobile: Remove non-multiplatform Genmai reference support ARM: configs: enable XHCI mvebu support in multi_v7_defconfig ARM: OMAP: replace checks for CONFIG_USB_GADGET_OMAP ARM: OMAP: AM3517EVM: remove check for CONFIG_PANEL_SHARP_LQ043T1DG01 ARM: OMAP: SX1: remove check for CONFIG_SX1_OLD_FLASH ARM: OMAP: remove some dead code ARM: OMAP: omap3stalker: remove two Kconfig macros ARM: tegra: tegra_defconfig updates ARM: shmobile: r7s72100: use workaround for non DT-clocks ARM: shmobile: Add forward declaration of struct clk to silence warning ARM: shmobile: r7s72100: remove SPI DT clocks from legacy clock support ARM: shmobile: r7s72100: add spi clocks to dtsi ARM: shmobile: r7s72100: remove I2C DT clocks from legacy clock support ARM: shmobile: r7s72100: add i2c clocks to dtsi ...
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/Kconfig11
-rw-r--r--arch/arm/mach-shmobile/Makefile1
-rw-r--r--arch/arm/mach-shmobile/Makefile.boot1
-rw-r--r--arch/arm/mach-shmobile/board-armadillo800eva.c7
-rw-r--r--arch/arm/mach-shmobile/board-bockw.c63
-rw-r--r--arch/arm/mach-shmobile/board-genmai-reference.c18
-rw-r--r--arch/arm/mach-shmobile/board-genmai.c44
-rw-r--r--arch/arm/mach-shmobile/board-koelsch-reference.c71
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c2
-rw-r--r--arch/arm/mach-shmobile/board-lager-reference.c69
-rw-r--r--arch/arm/mach-shmobile/board-lager.c29
-rw-r--r--arch/arm/mach-shmobile/clock-r7s72100.c11
-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/include/mach/clock.h1
-rw-r--r--arch/arm/mach-shmobile/setup-r7s72100.c69
-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.c25
-rw-r--r--arch/arm/mach-shmobile/setup-r8a7791.c25
-rw-r--r--arch/arm/mach-shmobile/setup-sh7372.c89
-rw-r--r--arch/arm/mach-shmobile/setup-sh73a0.c92
30 files changed, 316 insertions, 594 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index 49d90ca62e87..dbd954e61aa7 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -228,17 +228,6 @@ config MACH_GENMAI
228 depends on ARCH_R7S72100 228 depends on ARCH_R7S72100
229 select USE_OF 229 select USE_OF
230 230
231config MACH_GENMAI_REFERENCE
232 bool "Genmai board - Reference Device Tree Implementation"
233 depends on ARCH_R7S72100
234 select USE_OF
235 ---help---
236 Use reference implementation of Genmai board support
237 which makes use of device tree at the expense
238 of not supporting a number of devices.
239
240 This is intended to aid developers
241
242config MACH_MARZEN 231config MACH_MARZEN
243 bool "MARZEN board" 232 bool "MARZEN board"
244 depends on ARCH_R8A7779 233 depends on ARCH_R8A7779
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile
index 9c5cd8c53a85..38d5fe825e93 100644
--- a/arch/arm/mach-shmobile/Makefile
+++ b/arch/arm/mach-shmobile/Makefile
@@ -66,7 +66,6 @@ obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o
66obj-$(CONFIG_MACH_BOCKW) += board-bockw.o 66obj-$(CONFIG_MACH_BOCKW) += board-bockw.o
67obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o 67obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o
68obj-$(CONFIG_MACH_GENMAI) += board-genmai.o 68obj-$(CONFIG_MACH_GENMAI) += board-genmai.o
69obj-$(CONFIG_MACH_GENMAI_REFERENCE) += board-genmai-reference.o
70obj-$(CONFIG_MACH_MARZEN) += board-marzen.o 69obj-$(CONFIG_MACH_MARZEN) += board-marzen.o
71obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o 70obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o
72obj-$(CONFIG_MACH_LAGER) += board-lager.o 71obj-$(CONFIG_MACH_LAGER) += board-lager.o
diff --git a/arch/arm/mach-shmobile/Makefile.boot b/arch/arm/mach-shmobile/Makefile.boot
index 99455ecafa05..918fccffa1b6 100644
--- a/arch/arm/mach-shmobile/Makefile.boot
+++ b/arch/arm/mach-shmobile/Makefile.boot
@@ -7,7 +7,6 @@ loadaddr-$(CONFIG_MACH_ARMADILLO800EVA_REFERENCE) += 0x40008000
7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 7loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000
8loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 8loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000
9loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000 9loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000
10loadaddr-$(CONFIG_MACH_GENMAI_REFERENCE) += 0x08008000
11loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000 10loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000
12loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 11loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000
13loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 12loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c
index da4163ff31a2..bc2cf7a89534 100644
--- a/arch/arm/mach-shmobile/board-armadillo800eva.c
+++ b/arch/arm/mach-shmobile/board-armadillo800eva.c
@@ -1300,11 +1300,6 @@ static void __init eva_earlytimer_init(void)
1300 eva_clock_init(); 1300 eva_clock_init();
1301} 1301}
1302 1302
1303static void __init eva_add_early_devices(void)
1304{
1305 r8a7740_add_early_devices();
1306}
1307
1308#define RESCNT2 IOMEM(0xe6188020) 1303#define RESCNT2 IOMEM(0xe6188020)
1309static void eva_restart(enum reboot_mode mode, const char *cmd) 1304static void eva_restart(enum reboot_mode mode, const char *cmd)
1310{ 1305{
@@ -1319,7 +1314,7 @@ static const char *eva_boards_compat_dt[] __initdata = {
1319 1314
1320DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") 1315DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva")
1321 .map_io = r8a7740_map_io, 1316 .map_io = r8a7740_map_io,
1322 .init_early = eva_add_early_devices, 1317 .init_early = r8a7740_add_early_devices,
1323 .init_irq = r8a7740_init_irq_of, 1318 .init_irq = r8a7740_init_irq_of,
1324 .init_machine = eva_init, 1319 .init_machine = eva_init,
1325 .init_late = shmobile_init_late, 1320 .init_late = shmobile_init_late,
diff --git a/arch/arm/mach-shmobile/board-bockw.c b/arch/arm/mach-shmobile/board-bockw.c
index b4122f8cb8d9..f444be2f241e 100644
--- a/arch/arm/mach-shmobile/board-bockw.c
+++ b/arch/arm/mach-shmobile/board-bockw.c
@@ -345,24 +345,39 @@ static struct rsnd_ssi_platform_info rsnd_ssi[] = {
345 RSND_SSI_UNUSED, /* SSI 0 */ 345 RSND_SSI_UNUSED, /* SSI 0 */
346 RSND_SSI_UNUSED, /* SSI 1 */ 346 RSND_SSI_UNUSED, /* SSI 1 */
347 RSND_SSI_UNUSED, /* SSI 2 */ 347 RSND_SSI_UNUSED, /* SSI 2 */
348 RSND_SSI_SET(1, HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), RSND_SSI_PLAY), 348 RSND_SSI(HPBDMA_SLAVE_HPBIF3_TX, gic_iid(0x85), 0),
349 RSND_SSI_SET(2, HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE), 349 RSND_SSI(HPBDMA_SLAVE_HPBIF4_RX, gic_iid(0x85), RSND_SSI_CLK_PIN_SHARE),
350 RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), RSND_SSI_PLAY), 350 RSND_SSI(HPBDMA_SLAVE_HPBIF5_TX, gic_iid(0x86), 0),
351 RSND_SSI_SET(0, HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0), 351 RSND_SSI(HPBDMA_SLAVE_HPBIF6_RX, gic_iid(0x86), 0),
352 RSND_SSI_SET(3, HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), RSND_SSI_PLAY), 352 RSND_SSI(HPBDMA_SLAVE_HPBIF7_TX, gic_iid(0x86), 0),
353 RSND_SSI_SET(4, HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE), 353 RSND_SSI(HPBDMA_SLAVE_HPBIF8_RX, gic_iid(0x86), RSND_SSI_CLK_PIN_SHARE),
354}; 354};
355 355
356static struct rsnd_scu_platform_info rsnd_scu[9] = { 356static struct rsnd_src_platform_info rsnd_src[9] = {
357 { .flags = 0, }, /* SRU 0 */ 357 RSND_SRC_UNUSED, /* SRU 0 */
358 { .flags = 0, }, /* SRU 1 */ 358 RSND_SRC_UNUSED, /* SRU 1 */
359 { .flags = 0, }, /* SRU 2 */ 359 RSND_SRC_UNUSED, /* SRU 2 */
360 { .flags = RSND_SCU_USE_HPBIF, }, 360 RSND_SRC(0, 0),
361 { .flags = RSND_SCU_USE_HPBIF, }, 361 RSND_SRC(0, 0),
362 { .flags = RSND_SCU_USE_HPBIF, }, 362 RSND_SRC(0, 0),
363 { .flags = RSND_SCU_USE_HPBIF, }, 363 RSND_SRC(0, 0),
364 { .flags = RSND_SCU_USE_HPBIF, }, 364 RSND_SRC(0, 0),
365 { .flags = RSND_SCU_USE_HPBIF, }, 365 RSND_SRC(0, 0),
366};
367
368static struct rsnd_dai_platform_info rsnd_dai[] = {
369 {
370 .playback = { .ssi = &rsnd_ssi[5], .src = &rsnd_src[5] },
371 .capture = { .ssi = &rsnd_ssi[6], .src = &rsnd_src[6] },
372 }, {
373 .playback = { .ssi = &rsnd_ssi[3], .src = &rsnd_src[3] },
374 }, {
375 .capture = { .ssi = &rsnd_ssi[4], .src = &rsnd_src[4] },
376 }, {
377 .playback = { .ssi = &rsnd_ssi[7], .src = &rsnd_src[7] },
378 }, {
379 .capture = { .ssi = &rsnd_ssi[8], .src = &rsnd_src[8] },
380 },
366}; 381};
367 382
368enum { 383enum {
@@ -437,8 +452,10 @@ static struct rcar_snd_info rsnd_info = {
437 .flags = RSND_GEN1, 452 .flags = RSND_GEN1,
438 .ssi_info = rsnd_ssi, 453 .ssi_info = rsnd_ssi,
439 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi), 454 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
440 .scu_info = rsnd_scu, 455 .src_info = rsnd_src,
441 .scu_info_nr = ARRAY_SIZE(rsnd_scu), 456 .src_info_nr = ARRAY_SIZE(rsnd_src),
457 .dai_info = rsnd_dai,
458 .dai_info_nr = ARRAY_SIZE(rsnd_dai),
442 .start = rsnd_start, 459 .start = rsnd_start,
443 .stop = rsnd_stop, 460 .stop = rsnd_stop,
444}; 461};
@@ -591,6 +608,7 @@ static void __init bockw_init(void)
591{ 608{
592 void __iomem *base; 609 void __iomem *base;
593 struct clk *clk; 610 struct clk *clk;
611 struct platform_device *pdev;
594 int i; 612 int i;
595 613
596 r8a7778_clock_init(); 614 r8a7778_clock_init();
@@ -673,9 +691,6 @@ static void __init bockw_init(void)
673 } 691 }
674 692
675 /* for Audio */ 693 /* for Audio */
676 clk = clk_get(NULL, "audio_clk_b");
677 clk_set_rate(clk, 24576000);
678 clk_put(clk);
679 rsnd_codec_power(5, 1); /* enable ak4642 */ 694 rsnd_codec_power(5, 1); /* enable ak4642 */
680 695
681 platform_device_register_simple( 696 platform_device_register_simple(
@@ -684,11 +699,15 @@ static void __init bockw_init(void)
684 platform_device_register_simple( 699 platform_device_register_simple(
685 "ak4554-adc-dac", 1, NULL, 0); 700 "ak4554-adc-dac", 1, NULL, 0);
686 701
687 platform_device_register_resndata( 702 pdev = platform_device_register_resndata(
688 &platform_bus, "rcar_sound", -1, 703 &platform_bus, "rcar_sound", -1,
689 rsnd_resources, ARRAY_SIZE(rsnd_resources), 704 rsnd_resources, ARRAY_SIZE(rsnd_resources),
690 &rsnd_info, sizeof(rsnd_info)); 705 &rsnd_info, sizeof(rsnd_info));
691 706
707 clk = clk_get(&pdev->dev, "clk_b");
708 clk_set_rate(clk, 24576000);
709 clk_put(clk);
710
692 for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) { 711 for (i = 0; i < ARRAY_SIZE(rsnd_card_info); i++) {
693 struct platform_device_info cardinfo = { 712 struct platform_device_info cardinfo = {
694 .parent = &platform_bus, 713 .parent = &platform_bus,
diff --git a/arch/arm/mach-shmobile/board-genmai-reference.c b/arch/arm/mach-shmobile/board-genmai-reference.c
index 7630c1053e32..2ff6ad6e608e 100644
--- a/arch/arm/mach-shmobile/board-genmai-reference.c
+++ b/arch/arm/mach-shmobile/board-genmai-reference.c
@@ -18,27 +18,31 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clk-provider.h>
22#include <linux/kernel.h> 21#include <linux/kernel.h>
23#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <mach/clock.h>
24#include <mach/common.h> 24#include <mach/common.h>
25#include <mach/r7s72100.h> 25#include <mach/r7s72100.h>
26#include <asm/mach-types.h> 26#include <asm/mach-types.h>
27#include <asm/mach/arch.h> 27#include <asm/mach/arch.h>
28 28
29/*
30 * This is a really crude hack to provide clkdev support to platform
31 * devices until they get moved to DT.
32 */
33static const struct clk_name clk_names[] = {
34 { "mtu2", "fck", "sh-mtu2" },
35};
36
29static void __init genmai_add_standard_devices(void) 37static void __init genmai_add_standard_devices(void)
30{ 38{
31#ifdef CONFIG_COMMON_CLK 39 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), true);
32 of_clk_init(NULL);
33#else
34 r7s72100_clock_init();
35#endif
36 r7s72100_add_dt_devices(); 40 r7s72100_add_dt_devices();
37 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 41 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
38} 42}
39 43
40static const char * const genmai_boards_compat_dt[] __initconst = { 44static const char * const genmai_boards_compat_dt[] __initconst = {
41 "renesas,genmai-reference", 45 "renesas,genmai",
42 NULL, 46 NULL,
43}; 47};
44 48
diff --git a/arch/arm/mach-shmobile/board-genmai.c b/arch/arm/mach-shmobile/board-genmai.c
index 6c328d63b819..c94201ee8596 100644
--- a/arch/arm/mach-shmobile/board-genmai.c
+++ b/arch/arm/mach-shmobile/board-genmai.c
@@ -21,6 +21,7 @@
21 21
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/platform_device.h> 23#include <linux/platform_device.h>
24#include <linux/serial_sci.h>
24#include <linux/sh_eth.h> 25#include <linux/sh_eth.h>
25#include <linux/spi/rspi.h> 26#include <linux/spi/rspi.h>
26#include <linux/spi/spi.h> 27#include <linux/spi/spi.h>
@@ -89,6 +90,40 @@ static const struct spi_board_info spi_info[] __initconst = {
89 }, 90 },
90}; 91};
91 92
93/* SCIF */
94#define R7S72100_SCIF(index, baseaddr, irq) \
95static const struct plat_sci_port scif##index##_platform_data = { \
96 .type = PORT_SCIF, \
97 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE, \
98 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
99 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | \
100 SCSCR_REIE, \
101}; \
102 \
103static struct resource scif##index##_resources[] = { \
104 DEFINE_RES_MEM(baseaddr, 0x100), \
105 DEFINE_RES_IRQ(irq + 1), \
106 DEFINE_RES_IRQ(irq + 2), \
107 DEFINE_RES_IRQ(irq + 3), \
108 DEFINE_RES_IRQ(irq), \
109} \
110
111R7S72100_SCIF(0, 0xe8007000, gic_iid(221));
112R7S72100_SCIF(1, 0xe8007800, gic_iid(225));
113R7S72100_SCIF(2, 0xe8008000, gic_iid(229));
114R7S72100_SCIF(3, 0xe8008800, gic_iid(233));
115R7S72100_SCIF(4, 0xe8009000, gic_iid(237));
116R7S72100_SCIF(5, 0xe8009800, gic_iid(241));
117R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
118R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
119
120#define r7s72100_register_scif(index) \
121 platform_device_register_resndata(&platform_bus, "sh-sci", index, \
122 scif##index##_resources, \
123 ARRAY_SIZE(scif##index##_resources), \
124 &scif##index##_platform_data, \
125 sizeof(scif##index##_platform_data))
126
92static void __init genmai_add_standard_devices(void) 127static void __init genmai_add_standard_devices(void)
93{ 128{
94 r7s72100_clock_init(); 129 r7s72100_clock_init();
@@ -102,6 +137,15 @@ static void __init genmai_add_standard_devices(void)
102 r7s72100_register_rspi(3); 137 r7s72100_register_rspi(3);
103 r7s72100_register_rspi(4); 138 r7s72100_register_rspi(4);
104 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info)); 139 spi_register_board_info(spi_info, ARRAY_SIZE(spi_info));
140
141 r7s72100_register_scif(0);
142 r7s72100_register_scif(1);
143 r7s72100_register_scif(2);
144 r7s72100_register_scif(3);
145 r7s72100_register_scif(4);
146 r7s72100_register_scif(5);
147 r7s72100_register_scif(6);
148 r7s72100_register_scif(7);
105} 149}
106 150
107static const char * const genmai_boards_compat_dt[] __initconst = { 151static const char * const genmai_boards_compat_dt[] __initconst = {
diff --git a/arch/arm/mach-shmobile/board-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c
index ff33d9c4b658..d322a162b4b0 100644
--- a/arch/arm/mach-shmobile/board-koelsch-reference.c
+++ b/arch/arm/mach-shmobile/board-koelsch-reference.c
@@ -19,12 +19,11 @@
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */ 20 */
21 21
22#include <linux/clk.h>
23#include <linux/clkdev.h>
24#include <linux/dma-mapping.h> 22#include <linux/dma-mapping.h>
25#include <linux/kernel.h> 23#include <linux/kernel.h>
26#include <linux/of_platform.h> 24#include <linux/of_platform.h>
27#include <linux/platform_data/rcar-du.h> 25#include <linux/platform_data/rcar-du.h>
26#include <mach/clock.h>
28#include <mach/common.h> 27#include <mach/common.h>
29#include <mach/irqs.h> 28#include <mach/irqs.h>
30#include <mach/rcar-gen2.h> 29#include <mach/rcar-gen2.h>
@@ -82,49 +81,35 @@ static void __init koelsch_add_du_device(void)
82 platform_device_register_full(&info); 81 platform_device_register_full(&info);
83} 82}
84 83
85static void __init koelsch_add_standard_devices(void) 84/*
86{ 85 * This is a really crude hack to provide clkdev support to platform
87 /* 86 * devices until they get moved to DT.
88 * This is a really crude hack to provide clkdev support to the CMT and 87 */
89 * DU devices until they get moved to DT. 88static const struct clk_name clk_names[] __initconst = {
90 */ 89 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
91 static const struct clk_name { 90 { "du0", "du.0", "rcar-du-r8a7791" },
92 const char *clk; 91 { "du1", "du.1", "rcar-du-r8a7791" },
93 const char *con_id; 92 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
94 const char *dev_id; 93};
95 } clk_names[] = {
96 { "cmt0", NULL, "sh_cmt.0" },
97 { "scifa0", NULL, "sh-sci.0" },
98 { "scifa1", NULL, "sh-sci.1" },
99 { "scifb0", NULL, "sh-sci.2" },
100 { "scifb1", NULL, "sh-sci.3" },
101 { "scifb2", NULL, "sh-sci.4" },
102 { "scifa2", NULL, "sh-sci.5" },
103 { "scif0", NULL, "sh-sci.6" },
104 { "scif1", NULL, "sh-sci.7" },
105 { "scif2", NULL, "sh-sci.8" },
106 { "scif3", NULL, "sh-sci.9" },
107 { "scif4", NULL, "sh-sci.10" },
108 { "scif5", NULL, "sh-sci.11" },
109 { "scifa3", NULL, "sh-sci.12" },
110 { "scifa4", NULL, "sh-sci.13" },
111 { "scifa5", NULL, "sh-sci.14" },
112 { "du0", "du.0", "rcar-du-r8a7791" },
113 { "du1", "du.1", "rcar-du-r8a7791" },
114 { "lvds0", "lvds.0", "rcar-du-r8a7791" },
115 };
116 struct clk *clk;
117 unsigned int i;
118 94
119 for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { 95/*
120 clk = clk_get(NULL, clk_names[i].clk); 96 * This is a really crude hack to work around core platform clock issues
121 if (!IS_ERR(clk)) { 97 */
122 clk_register_clkdev(clk, clk_names[i].con_id, 98static const struct clk_name clk_enables[] __initconst = {
123 clk_names[i].dev_id); 99 { "ether", NULL, "ee700000.ethernet" },
124 clk_put(clk); 100 { "i2c2", NULL, "e6530000.i2c" },
125 } 101 { "msiof0", NULL, "e6e20000.spi" },
126 } 102 { "qspi_mod", NULL, "e6b10000.spi" },
103 { "sdhi0", NULL, "ee100000.sd" },
104 { "sdhi1", NULL, "ee140000.sd" },
105 { "sdhi2", NULL, "ee160000.sd" },
106 { "thermal", NULL, "e61f0000.thermal" },
107};
127 108
109static void __init koelsch_add_standard_devices(void)
110{
111 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
112 shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true);
128 r8a7791_add_dt_devices(); 113 r8a7791_add_dt_devices();
129 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 114 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
130 115
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index 3cd8008d09dd..c6c68892caa3 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -216,7 +216,7 @@ static const struct spi_board_info spi_info[] __initconst = {
216 { 216 {
217 .modalias = "m25p80", 217 .modalias = "m25p80",
218 .platform_data = &spi_flash_data, 218 .platform_data = &spi_flash_data,
219 .mode = SPI_MODE_0, 219 .mode = SPI_MODE_0 | SPI_TX_QUAD | SPI_RX_QUAD,
220 .max_speed_hz = 30000000, 220 .max_speed_hz = 30000000,
221 .bus_num = 0, 221 .bus_num = 0,
222 .chip_select = 0, 222 .chip_select = 0,
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c
index 440aac36d693..749832e3f33c 100644
--- a/arch/arm/mach-shmobile/board-lager-reference.c
+++ b/arch/arm/mach-shmobile/board-lager-reference.c
@@ -18,12 +18,11 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/clk.h>
22#include <linux/clkdev.h>
23#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
24#include <linux/init.h> 22#include <linux/init.h>
25#include <linux/of_platform.h> 23#include <linux/of_platform.h>
26#include <linux/platform_data/rcar-du.h> 24#include <linux/platform_data/rcar-du.h>
25#include <mach/clock.h>
27#include <mach/common.h> 26#include <mach/common.h>
28#include <mach/irqs.h> 27#include <mach/irqs.h>
29#include <mach/rcar-gen2.h> 28#include <mach/rcar-gen2.h>
@@ -86,46 +85,36 @@ static void __init lager_add_du_device(void)
86 platform_device_register_full(&info); 85 platform_device_register_full(&info);
87} 86}
88 87
89static void __init lager_add_standard_devices(void) 88/*
90{ 89 * This is a really crude hack to provide clkdev support to platform
91 /* 90 * devices until they get moved to DT.
92 * This is a really crude hack to provide clkdev support to platform 91 */
93 * devices until they get moved to DT. 92static const struct clk_name clk_names[] __initconst = {
94 */ 93 { "cmt0", "fck", "sh-cmt-48-gen2.0" },
95 static const struct clk_name { 94 { "du0", "du.0", "rcar-du-r8a7790" },
96 const char *clk; 95 { "du1", "du.1", "rcar-du-r8a7790" },
97 const char *con_id; 96 { "du2", "du.2", "rcar-du-r8a7790" },
98 const char *dev_id; 97 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
99 } clk_names[] = { 98 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
100 { "cmt0", NULL, "sh_cmt.0" }, 99};
101 { "scifa0", NULL, "sh-sci.0" },
102 { "scifa1", NULL, "sh-sci.1" },
103 { "scifb0", NULL, "sh-sci.2" },
104 { "scifb1", NULL, "sh-sci.3" },
105 { "scifb2", NULL, "sh-sci.4" },
106 { "scifa2", NULL, "sh-sci.5" },
107 { "scif0", NULL, "sh-sci.6" },
108 { "scif1", NULL, "sh-sci.7" },
109 { "hscif0", NULL, "sh-sci.8" },
110 { "hscif1", NULL, "sh-sci.9" },
111 { "du0", "du.0", "rcar-du-r8a7790" },
112 { "du1", "du.1", "rcar-du-r8a7790" },
113 { "du2", "du.2", "rcar-du-r8a7790" },
114 { "lvds0", "lvds.0", "rcar-du-r8a7790" },
115 { "lvds1", "lvds.1", "rcar-du-r8a7790" },
116 };
117 struct clk *clk;
118 unsigned int i;
119 100
120 for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { 101/*
121 clk = clk_get(NULL, clk_names[i].clk); 102 * This is a really crude hack to work around core platform clock issues
122 if (!IS_ERR(clk)) { 103 */
123 clk_register_clkdev(clk, clk_names[i].con_id, 104static const struct clk_name clk_enables[] __initconst = {
124 clk_names[i].dev_id); 105 { "ether", NULL, "ee700000.ethernet" },
125 clk_put(clk); 106 { "msiof1", NULL, "e6e10000.spi" },
126 } 107 { "mmcif1", NULL, "ee220000.mmc" },
127 } 108 { "qspi_mod", NULL, "e6b10000.spi" },
109 { "sdhi0", NULL, "ee100000.sd" },
110 { "sdhi2", NULL, "ee140000.sd" },
111 { "thermal", NULL, "e61f0000.thermal" },
112};
128 113
114static void __init lager_add_standard_devices(void)
115{
116 shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false);
117 shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true);
129 r8a7790_add_dt_devices(); 118 r8a7790_add_dt_devices();
130 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); 119 of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL);
131 120
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 18c7e0311aa6..f8b1e05463cc 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -325,12 +325,12 @@ static const struct rspi_plat_data qspi_pdata __initconst = {
325 325
326static const struct spi_board_info spi_info[] __initconst = { 326static const struct spi_board_info spi_info[] __initconst = {
327 { 327 {
328 .modalias = "m25p80", 328 .modalias = "m25p80",
329 .platform_data = &spi_flash_data, 329 .platform_data = &spi_flash_data,
330 .mode = SPI_MODE_0, 330 .mode = SPI_MODE_0 | SPI_TX_QUAD | SPI_RX_QUAD,
331 .max_speed_hz = 30000000, 331 .max_speed_hz = 30000000,
332 .bus_num = 0, 332 .bus_num = 0,
333 .chip_select = 0, 333 .chip_select = 0,
334 }, 334 },
335}; 335};
336 336
@@ -567,20 +567,27 @@ static struct resource rsnd_resources[] __initdata = {
567}; 567};
568 568
569static struct rsnd_ssi_platform_info rsnd_ssi[] = { 569static struct rsnd_ssi_platform_info rsnd_ssi[] = {
570 RSND_SSI_SET(0, 0, gic_spi(370), RSND_SSI_PLAY), 570 RSND_SSI(0, gic_spi(370), 0),
571 RSND_SSI_SET(0, 0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE), 571 RSND_SSI(0, gic_spi(371), RSND_SSI_CLK_PIN_SHARE),
572}; 572};
573 573
574static struct rsnd_scu_platform_info rsnd_scu[2] = { 574static struct rsnd_src_platform_info rsnd_src[2] = {
575 /* no member at this point */ 575 /* no member at this point */
576}; 576};
577 577
578static struct rsnd_dai_platform_info rsnd_dai = {
579 .playback = { .ssi = &rsnd_ssi[0], },
580 .capture = { .ssi = &rsnd_ssi[1], },
581};
582
578static struct rcar_snd_info rsnd_info = { 583static struct rcar_snd_info rsnd_info = {
579 .flags = RSND_GEN2, 584 .flags = RSND_GEN2,
580 .ssi_info = rsnd_ssi, 585 .ssi_info = rsnd_ssi,
581 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi), 586 .ssi_info_nr = ARRAY_SIZE(rsnd_ssi),
582 .scu_info = rsnd_scu, 587 .src_info = rsnd_src,
583 .scu_info_nr = ARRAY_SIZE(rsnd_scu), 588 .src_info_nr = ARRAY_SIZE(rsnd_src),
589 .dai_info = &rsnd_dai,
590 .dai_info_nr = 1,
584}; 591};
585 592
586static struct asoc_simple_card_info rsnd_card_info = { 593static struct asoc_simple_card_info rsnd_card_info = {
diff --git a/arch/arm/mach-shmobile/clock-r7s72100.c b/arch/arm/mach-shmobile/clock-r7s72100.c
index bee0073c9b64..df187484de5d 100644
--- a/arch/arm/mach-shmobile/clock-r7s72100.c
+++ b/arch/arm/mach-shmobile/clock-r7s72100.c
@@ -194,17 +194,7 @@ static struct clk_lookup lookups[] = {
194 CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]), 194 CLKDEV_DEV_ID("rspi-rz.2", &mstp_clks[MSTP105]),
195 CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]), 195 CLKDEV_DEV_ID("rspi-rz.3", &mstp_clks[MSTP104]),
196 CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]), 196 CLKDEV_DEV_ID("rspi-rz.4", &mstp_clks[MSTP103]),
197 CLKDEV_DEV_ID("e800c800.spi", &mstp_clks[MSTP107]),
198 CLKDEV_DEV_ID("e800d000.spi", &mstp_clks[MSTP106]),
199 CLKDEV_DEV_ID("e800d800.spi", &mstp_clks[MSTP105]),
200 CLKDEV_DEV_ID("e800e000.spi", &mstp_clks[MSTP104]),
201 CLKDEV_DEV_ID("e800e800.spi", &mstp_clks[MSTP103]),
202 CLKDEV_DEV_ID("fcfee000.i2c", &mstp_clks[MSTP97]),
203 CLKDEV_DEV_ID("fcfee400.i2c", &mstp_clks[MSTP96]),
204 CLKDEV_DEV_ID("fcfee800.i2c", &mstp_clks[MSTP95]),
205 CLKDEV_DEV_ID("fcfeec00.i2c", &mstp_clks[MSTP94]),
206 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]), 197 CLKDEV_DEV_ID("r7s72100-ether", &mstp_clks[MSTP74]),
207 CLKDEV_CON_ID("mtu2_fck", &mstp_clks[MSTP33]),
208 198
209 /* ICK */ 199 /* ICK */
210 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]), 200 CLKDEV_ICK_ID("sci_fck", "sh-sci.0", &mstp_clks[MSTP47]),
@@ -215,6 +205,7 @@ static struct clk_lookup lookups[] = {
215 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]), 205 CLKDEV_ICK_ID("sci_fck", "sh-sci.5", &mstp_clks[MSTP42]),
216 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]), 206 CLKDEV_ICK_ID("sci_fck", "sh-sci.6", &mstp_clks[MSTP41]),
217 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]), 207 CLKDEV_ICK_ID("sci_fck", "sh-sci.7", &mstp_clks[MSTP40]),
208 CLKDEV_ICK_ID("fck", "sh-mtu2", &mstp_clks[MSTP33]),
218}; 209};
219 210
220void __init r7s72100_clock_init(void) 211void __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 433ec674ead1..50931e3c97c7 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/include/mach/clock.h b/arch/arm/mach-shmobile/include/mach/clock.h
index 9a93cf924b9c..31b6417463e6 100644
--- a/arch/arm/mach-shmobile/include/mach/clock.h
+++ b/arch/arm/mach-shmobile/include/mach/clock.h
@@ -16,6 +16,7 @@ void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks,
16#else /* CONFIG_COMMON_CLK */ 16#else /* CONFIG_COMMON_CLK */
17/* legacy clock implementation */ 17/* legacy clock implementation */
18 18
19struct clk;
19unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk); 20unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
20extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops; 21extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
21 22
diff --git a/arch/arm/mach-shmobile/setup-r7s72100.c b/arch/arm/mach-shmobile/setup-r7s72100.c
index 9c0b3a9d5f7a..412e179429cd 100644
--- a/arch/arm/mach-shmobile/setup-r7s72100.c
+++ b/arch/arm/mach-shmobile/setup-r7s72100.c
@@ -21,77 +21,26 @@
21#include <linux/irq.h> 21#include <linux/irq.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/of_platform.h> 23#include <linux/of_platform.h>
24#include <linux/serial_sci.h>
25#include <linux/sh_timer.h> 24#include <linux/sh_timer.h>
26#include <mach/common.h> 25#include <mach/common.h>
27#include <mach/irqs.h> 26#include <mach/irqs.h>
28#include <mach/r7s72100.h> 27#include <mach/r7s72100.h>
29#include <asm/mach/arch.h> 28#include <asm/mach/arch.h>
30 29
31#define R7S72100_SCIF(index, baseaddr, irq) \ 30static struct resource mtu2_resources[] __initdata = {
32static const struct plat_sci_port scif##index##_platform_data = { \ 31 DEFINE_RES_MEM(0xfcff0000, 0x400),
33 .type = PORT_SCIF, \ 32 DEFINE_RES_IRQ_NAMED(gic_iid(139), "tgi0a"),
34 .regtype = SCIx_SH2_SCIF_FIFODATA_REGTYPE, \
35 .flags = UPF_BOOT_AUTOCONF | UPF_IOREMAP, \
36 .scscr = SCSCR_RIE | SCSCR_TIE | SCSCR_RE | SCSCR_TE | \
37 SCSCR_REIE, \
38}; \
39 \
40static struct resource scif##index##_resources[] = { \
41 DEFINE_RES_MEM(baseaddr, 0x100), \
42 DEFINE_RES_IRQ(irq + 1), \
43 DEFINE_RES_IRQ(irq + 2), \
44 DEFINE_RES_IRQ(irq + 3), \
45 DEFINE_RES_IRQ(irq), \
46} \
47
48R7S72100_SCIF(0, 0xe8007000, gic_iid(221));
49R7S72100_SCIF(1, 0xe8007800, gic_iid(225));
50R7S72100_SCIF(2, 0xe8008000, gic_iid(229));
51R7S72100_SCIF(3, 0xe8008800, gic_iid(233));
52R7S72100_SCIF(4, 0xe8009000, gic_iid(237));
53R7S72100_SCIF(5, 0xe8009800, gic_iid(241));
54R7S72100_SCIF(6, 0xe800a000, gic_iid(245));
55R7S72100_SCIF(7, 0xe800a800, gic_iid(249));
56
57#define r7s72100_register_scif(index) \
58 platform_device_register_resndata(&platform_bus, "sh-sci", index, \
59 scif##index##_resources, \
60 ARRAY_SIZE(scif##index##_resources), \
61 &scif##index##_platform_data, \
62 sizeof(scif##index##_platform_data))
63
64
65static struct sh_timer_config mtu2_0_platform_data __initdata = {
66 .name = "MTU2_0",
67 .timer_bit = 0,
68 .channel_offset = -0x80,
69 .clockevent_rating = 200,
70};
71
72static struct resource mtu2_0_resources[] __initdata = {
73 DEFINE_RES_MEM(0xfcff0300, 0x27),
74 DEFINE_RES_IRQ(gic_iid(139)), /* MTU2 TGI0A */
75}; 33};
76 34
77#define r7s72100_register_mtu2(idx) \ 35#define r7s72100_register_mtu2() \
78 platform_device_register_resndata(&platform_bus, "sh_mtu2", \ 36 platform_device_register_resndata(&platform_bus, "sh-mtu2", \
79 idx, mtu2_##idx##_resources, \ 37 -1, mtu2_resources, \
80 ARRAY_SIZE(mtu2_##idx##_resources), \ 38 ARRAY_SIZE(mtu2_resources), \
81 &mtu2_##idx##_platform_data, \ 39 NULL, 0)
82 sizeof(struct sh_timer_config))
83 40
84void __init r7s72100_add_dt_devices(void) 41void __init r7s72100_add_dt_devices(void)
85{ 42{
86 r7s72100_register_scif(0); 43 r7s72100_register_mtu2();
87 r7s72100_register_scif(1);
88 r7s72100_register_scif(2);
89 r7s72100_register_scif(3);
90 r7s72100_register_scif(4);
91 r7s72100_register_scif(5);
92 r7s72100_register_scif(6);
93 r7s72100_register_scif(7);
94 r7s72100_register_mtu2(0);
95} 44}
96 45
97void __init r7s72100_init_early(void) 46void __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 2dfd198fb635..35dec233301e 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 a901d9ef53f6..6bd08b127fa4 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -263,20 +263,17 @@ static const struct resource thermal_resources[] __initconst = {
263 thermal_resources, \ 263 thermal_resources, \
264 ARRAY_SIZE(thermal_resources)) 264 ARRAY_SIZE(thermal_resources))
265 265
266static const struct sh_timer_config cmt00_platform_data __initconst = { 266static struct sh_timer_config cmt0_platform_data = {
267 .name = "CMT00", 267 .channels_mask = 0x60,
268 .timer_bit = 0,
269 .clockevent_rating = 80,
270}; 268};
271 269
272static const struct resource cmt00_resources[] __initconst = { 270static struct resource cmt0_resources[] = {
273 DEFINE_RES_MEM(0xffca0510, 0x0c), 271 DEFINE_RES_MEM(0xffca0000, 0x1004),
274 DEFINE_RES_MEM(0xffca0500, 0x04), 272 DEFINE_RES_IRQ(gic_spi(142)),
275 DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */
276}; 273};
277 274
278#define r8a7790_register_cmt(idx) \ 275#define r8a7790_register_cmt(idx) \
279 platform_device_register_resndata(&platform_bus, "sh_cmt", \ 276 platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \
280 idx, cmt##idx##_resources, \ 277 idx, cmt##idx##_resources, \
281 ARRAY_SIZE(cmt##idx##_resources), \ 278 ARRAY_SIZE(cmt##idx##_resources), \
282 &cmt##idx##_platform_data, \ 279 &cmt##idx##_platform_data, \
@@ -284,6 +281,11 @@ static const struct resource cmt00_resources[] __initconst = {
284 281
285void __init r8a7790_add_dt_devices(void) 282void __init r8a7790_add_dt_devices(void)
286{ 283{
284 r8a7790_register_cmt(0);
285}
286
287void __init r8a7790_add_standard_devices(void)
288{
287 r8a7790_register_scif(0); 289 r8a7790_register_scif(0);
288 r8a7790_register_scif(1); 290 r8a7790_register_scif(1);
289 r8a7790_register_scif(2); 291 r8a7790_register_scif(2);
@@ -294,11 +296,6 @@ void __init r8a7790_add_dt_devices(void)
294 r8a7790_register_scif(7); 296 r8a7790_register_scif(7);
295 r8a7790_register_scif(8); 297 r8a7790_register_scif(8);
296 r8a7790_register_scif(9); 298 r8a7790_register_scif(9);
297 r8a7790_register_cmt(00);
298}
299
300void __init r8a7790_add_standard_devices(void)
301{
302 r8a7790_add_dt_devices(); 299 r8a7790_add_dt_devices();
303 r8a7790_register_irqc(0); 300 r8a7790_register_irqc(0);
304 r8a7790_register_thermal(); 301 r8a7790_register_thermal();
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c
index 949580ae150a..04a96ddb3224 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, \
@@ -185,6 +182,11 @@ static const struct resource thermal_resources[] __initconst = {
185 182
186void __init r8a7791_add_dt_devices(void) 183void __init r8a7791_add_dt_devices(void)
187{ 184{
185 r8a7791_register_cmt(0);
186}
187
188void __init r8a7791_add_standard_devices(void)
189{
188 r8a7791_register_scif(0); 190 r8a7791_register_scif(0);
189 r8a7791_register_scif(1); 191 r8a7791_register_scif(1);
190 r8a7791_register_scif(2); 192 r8a7791_register_scif(2);
@@ -200,11 +202,6 @@ void __init r8a7791_add_dt_devices(void)
200 r8a7791_register_scif(12); 202 r8a7791_register_scif(12);
201 r8a7791_register_scif(13); 203 r8a7791_register_scif(13);
202 r8a7791_register_scif(14); 204 r8a7791_register_scif(14);
203 r8a7791_register_cmt(00);
204}
205
206void __init r8a7791_add_standard_devices(void)
207{
208 r8a7791_add_dt_devices(); 205 r8a7791_add_dt_devices();
209 r8a7791_register_irqc(0); 206 r8a7791_register_irqc(0);
210 r8a7791_register_thermal(); 207 r8a7791_register_thermal();
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c
index f8176b051be4..2a8b9f2a2f54 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