diff options
Diffstat (limited to 'arch/arm/mach-shmobile')
45 files changed, 500 insertions, 1003 deletions
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig index 0f92ba8e7884..dbd954e61aa7 100644 --- a/arch/arm/mach-shmobile/Kconfig +++ b/arch/arm/mach-shmobile/Kconfig | |||
@@ -8,7 +8,6 @@ config ARCH_SHMOBILE_MULTI | |||
8 | select HAVE_ARM_SCU if SMP | 8 | select HAVE_ARM_SCU if SMP |
9 | select HAVE_ARM_TWD if SMP | 9 | select HAVE_ARM_TWD if SMP |
10 | select ARM_GIC | 10 | select ARM_GIC |
11 | select MIGHT_HAVE_PCI | ||
12 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | 11 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE |
13 | select NO_IOPORT_MAP | 12 | select NO_IOPORT_MAP |
14 | select PINCTRL | 13 | select PINCTRL |
@@ -108,6 +107,7 @@ config ARCH_R8A7778 | |||
108 | select SH_CLK_CPG | 107 | select SH_CLK_CPG |
109 | select ARM_GIC | 108 | select ARM_GIC |
110 | select SYS_SUPPORTS_SH_TMU | 109 | select SYS_SUPPORTS_SH_TMU |
110 | select RENESAS_INTC_IRQPIN | ||
111 | 111 | ||
112 | config ARCH_R8A7779 | 112 | config ARCH_R8A7779 |
113 | bool "R-Car H1 (R8A77790)" | 113 | bool "R-Car H1 (R8A77790)" |
@@ -140,16 +140,6 @@ config ARCH_R8A7791 | |||
140 | select SYS_SUPPORTS_SH_CMT | 140 | select SYS_SUPPORTS_SH_CMT |
141 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE | 141 | select ARCH_DMA_ADDR_T_64BIT if ARM_LPAE |
142 | 142 | ||
143 | config ARCH_EMEV2 | ||
144 | bool "Emma Mobile EV2" | ||
145 | select ARCH_WANT_OPTIONAL_GPIOLIB | ||
146 | select ARM_GIC | ||
147 | select CPU_V7 | ||
148 | select MIGHT_HAVE_PCI | ||
149 | select USE_OF | ||
150 | select AUTO_ZRELADDR | ||
151 | select SYS_SUPPORTS_EM_STI | ||
152 | |||
153 | config ARCH_R7S72100 | 143 | config ARCH_R7S72100 |
154 | bool "RZ/A1H (R7S72100)" | 144 | bool "RZ/A1H (R7S72100)" |
155 | select ARCH_WANT_OPTIONAL_GPIOLIB | 145 | select ARCH_WANT_OPTIONAL_GPIOLIB |
@@ -205,8 +195,8 @@ config MACH_ARMADILLO800EVA_REFERENCE | |||
205 | select SND_SOC_WM8978 if SND_SIMPLE_CARD | 195 | select SND_SOC_WM8978 if SND_SIMPLE_CARD |
206 | select USE_OF | 196 | select USE_OF |
207 | ---help--- | 197 | ---help--- |
208 | Use reference implementation of Aramdillo800 EVA board support | 198 | Use reference implementation of Armadillo800 EVA board support |
209 | which makes a greater use of device tree at the expense | 199 | which makes greater use of device tree at the expense |
210 | of not supporting a number of devices. | 200 | of not supporting a number of devices. |
211 | 201 | ||
212 | This is intended to aid developers | 202 | This is intended to aid developers |
@@ -216,7 +206,6 @@ config MACH_BOCKW | |||
216 | depends on ARCH_R8A7778 | 206 | depends on ARCH_R8A7778 |
217 | select ARCH_REQUIRE_GPIOLIB | 207 | select ARCH_REQUIRE_GPIOLIB |
218 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | 208 | select REGULATOR_FIXED_VOLTAGE if REGULATOR |
219 | select RENESAS_INTC_IRQPIN | ||
220 | select SND_SOC_AK4554 if SND_SIMPLE_CARD | 209 | select SND_SOC_AK4554 if SND_SIMPLE_CARD |
221 | select SND_SOC_AK4642 if SND_SIMPLE_CARD | 210 | select SND_SOC_AK4642 if SND_SIMPLE_CARD |
222 | select USE_OF | 211 | select USE_OF |
@@ -225,7 +214,6 @@ config MACH_BOCKW_REFERENCE | |||
225 | bool "BOCK-W - Reference Device Tree Implementation" | 214 | bool "BOCK-W - Reference Device Tree Implementation" |
226 | depends on ARCH_R8A7778 | 215 | depends on ARCH_R8A7778 |
227 | select ARCH_REQUIRE_GPIOLIB | 216 | select ARCH_REQUIRE_GPIOLIB |
228 | select RENESAS_INTC_IRQPIN | ||
229 | select REGULATOR_FIXED_VOLTAGE if REGULATOR | 217 | select REGULATOR_FIXED_VOLTAGE if REGULATOR |
230 | select USE_OF | 218 | select USE_OF |
231 | ---help--- | 219 | ---help--- |
@@ -240,17 +228,6 @@ config MACH_GENMAI | |||
240 | depends on ARCH_R7S72100 | 228 | depends on ARCH_R7S72100 |
241 | select USE_OF | 229 | select USE_OF |
242 | 230 | ||
243 | config MACH_GENMAI_REFERENCE | ||
244 | bool "Genmai board - Reference Device Tree Implementation" | ||
245 | depends on ARCH_R7S72100 | ||
246 | select USE_OF | ||
247 | ---help--- | ||
248 | Use reference implementation of Genmai board support | ||
249 | which makes use of device tree at the expense | ||
250 | of not supporting a number of devices. | ||
251 | |||
252 | This is intended to aid developers | ||
253 | |||
254 | config MACH_MARZEN | 231 | config MACH_MARZEN |
255 | bool "MARZEN board" | 232 | bool "MARZEN board" |
256 | depends on ARCH_R8A7779 | 233 | depends on ARCH_R8A7779 |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 4caffc912a81..38d5fe825e93 100644 --- a/arch/arm/mach-shmobile/Makefile +++ b/arch/arm/mach-shmobile/Makefile | |||
@@ -21,8 +21,8 @@ obj-$(CONFIG_ARCH_EMEV2) += setup-emev2.o | |||
21 | obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o | 21 | obj-$(CONFIG_ARCH_R7S72100) += setup-r7s72100.o |
22 | 22 | ||
23 | # Clock objects | 23 | # Clock objects |
24 | ifndef CONFIG_COMMON_CLK | ||
25 | obj-y += clock.o | 24 | obj-y += clock.o |
25 | ifndef CONFIG_COMMON_CLK | ||
26 | obj-$(CONFIG_ARCH_SH7372) += clock-sh7372.o | 26 | obj-$(CONFIG_ARCH_SH7372) += clock-sh7372.o |
27 | obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o | 27 | obj-$(CONFIG_ARCH_SH73A0) += clock-sh73a0.o |
28 | obj-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o | 28 | obj-$(CONFIG_ARCH_R8A73A4) += clock-r8a73a4.o |
@@ -31,7 +31,6 @@ obj-$(CONFIG_ARCH_R8A7778) += clock-r8a7778.o | |||
31 | obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o | 31 | obj-$(CONFIG_ARCH_R8A7779) += clock-r8a7779.o |
32 | obj-$(CONFIG_ARCH_R8A7790) += clock-r8a7790.o | 32 | obj-$(CONFIG_ARCH_R8A7790) += clock-r8a7790.o |
33 | obj-$(CONFIG_ARCH_R8A7791) += clock-r8a7791.o | 33 | obj-$(CONFIG_ARCH_R8A7791) += clock-r8a7791.o |
34 | obj-$(CONFIG_ARCH_EMEV2) += clock-emev2.o | ||
35 | obj-$(CONFIG_ARCH_R7S72100) += clock-r7s72100.o | 34 | obj-$(CONFIG_ARCH_R7S72100) += clock-r7s72100.o |
36 | endif | 35 | endif |
37 | 36 | ||
@@ -67,7 +66,6 @@ obj-$(CONFIG_MACH_MACKEREL) += board-mackerel.o | |||
67 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o | 66 | obj-$(CONFIG_MACH_BOCKW) += board-bockw.o |
68 | obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o | 67 | obj-$(CONFIG_MACH_BOCKW_REFERENCE) += board-bockw-reference.o |
69 | obj-$(CONFIG_MACH_GENMAI) += board-genmai.o | 68 | obj-$(CONFIG_MACH_GENMAI) += board-genmai.o |
70 | obj-$(CONFIG_MACH_GENMAI_REFERENCE) += board-genmai-reference.o | ||
71 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o | 69 | obj-$(CONFIG_MACH_MARZEN) += board-marzen.o |
72 | obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o | 70 | obj-$(CONFIG_MACH_MARZEN_REFERENCE) += board-marzen-reference.o |
73 | obj-$(CONFIG_MACH_LAGER) += board-lager.o | 71 | obj-$(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 | |||
7 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 | 7 | loadaddr-$(CONFIG_MACH_BOCKW) += 0x60008000 |
8 | loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 | 8 | loadaddr-$(CONFIG_MACH_BOCKW_REFERENCE) += 0x60008000 |
9 | loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000 | 9 | loadaddr-$(CONFIG_MACH_GENMAI) += 0x08008000 |
10 | loadaddr-$(CONFIG_MACH_GENMAI_REFERENCE) += 0x08008000 | ||
11 | loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000 | 10 | loadaddr-$(CONFIG_MACH_KOELSCH) += 0x40008000 |
12 | loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 | 11 | loadaddr-$(CONFIG_MACH_KZM9G) += 0x41008000 |
13 | loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 | 12 | loadaddr-$(CONFIG_MACH_KZM9G_REFERENCE) += 0x41008000 |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c index 57d1a78367b6..f660fbb96e0b 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva-reference.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva-reference.c | |||
@@ -164,8 +164,8 @@ static void __init eva_init(void) | |||
164 | r8a7740_meram_workaround(); | 164 | r8a7740_meram_workaround(); |
165 | 165 | ||
166 | #ifdef CONFIG_CACHE_L2X0 | 166 | #ifdef CONFIG_CACHE_L2X0 |
167 | /* Early BRESP enable, Shared attribute override enable, 32K*8way */ | 167 | /* Shared attribute override enable, 32K*8way */ |
168 | l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff); | 168 | l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff); |
169 | #endif | 169 | #endif |
170 | 170 | ||
171 | r8a7740_add_standard_devices_dt(); | 171 | r8a7740_add_standard_devices_dt(); |
@@ -187,7 +187,7 @@ static const char *eva_boards_compat_dt[] __initdata = { | |||
187 | 187 | ||
188 | DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference") | 188 | DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference") |
189 | .map_io = r8a7740_map_io, | 189 | .map_io = r8a7740_map_io, |
190 | .init_early = r8a7740_init_delay, | 190 | .init_early = shmobile_init_delay, |
191 | .init_irq = r8a7740_init_irq_of, | 191 | .init_irq = r8a7740_init_irq_of, |
192 | .init_machine = eva_init, | 192 | .init_machine = eva_init, |
193 | .init_late = shmobile_init_late, | 193 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/board-armadillo800eva.c b/arch/arm/mach-shmobile/board-armadillo800eva.c index 486063db2a2f..01f81100c330 100644 --- a/arch/arm/mach-shmobile/board-armadillo800eva.c +++ b/arch/arm/mach-shmobile/board-armadillo800eva.c | |||
@@ -1017,7 +1017,7 @@ static struct asoc_simple_card_info fsi2_hdmi_info = { | |||
1017 | .platform = "sh_fsi2", | 1017 | .platform = "sh_fsi2", |
1018 | .cpu_dai = { | 1018 | .cpu_dai = { |
1019 | .name = "fsib-dai", | 1019 | .name = "fsib-dai", |
1020 | .fmt = SND_SOC_DAIFMT_CBM_CFM, | 1020 | .fmt = SND_SOC_DAIFMT_CBS_CFS, |
1021 | }, | 1021 | }, |
1022 | .codec_dai = { | 1022 | .codec_dai = { |
1023 | .name = "sh_mobile_hdmi-hifi", | 1023 | .name = "sh_mobile_hdmi-hifi", |
@@ -1271,8 +1271,8 @@ static void __init eva_init(void) | |||
1271 | 1271 | ||
1272 | 1272 | ||
1273 | #ifdef CONFIG_CACHE_L2X0 | 1273 | #ifdef CONFIG_CACHE_L2X0 |
1274 | /* Early BRESP enable, Shared attribute override enable, 32K*8way */ | 1274 | /* Shared attribute override enable, 32K*8way */ |
1275 | l2x0_init(IOMEM(0xf0002000), 0x40440000, 0x82000fff); | 1275 | l2x0_init(IOMEM(0xf0002000), 0x00400000, 0xc20f0fff); |
1276 | #endif | 1276 | #endif |
1277 | 1277 | ||
1278 | i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); | 1278 | i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); |
@@ -1300,11 +1300,6 @@ static void __init eva_earlytimer_init(void) | |||
1300 | eva_clock_init(); | 1300 | eva_clock_init(); |
1301 | } | 1301 | } |
1302 | 1302 | ||
1303 | static 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) |
1309 | static void eva_restart(enum reboot_mode mode, const char *cmd) | 1304 | static 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 | ||
1320 | DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva") | 1315 | DT_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 | ||
356 | static struct rsnd_scu_platform_info rsnd_scu[9] = { | 356 | static 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 | |||
368 | static 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 | ||
368 | enum { | 383 | enum { |
@@ -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 | */ | ||
33 | static const struct clk_name clk_names[] = { | ||
34 | { "mtu2", "fck", "sh-mtu2" }, | ||
35 | }; | ||
36 | |||
29 | static void __init genmai_add_standard_devices(void) | 37 | static 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 | ||
40 | static const char * const genmai_boards_compat_dt[] __initconst = { | 44 | static 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) \ | ||
95 | static 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 | \ | ||
103 | static 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 | |||
111 | R7S72100_SCIF(0, 0xe8007000, gic_iid(221)); | ||
112 | R7S72100_SCIF(1, 0xe8007800, gic_iid(225)); | ||
113 | R7S72100_SCIF(2, 0xe8008000, gic_iid(229)); | ||
114 | R7S72100_SCIF(3, 0xe8008800, gic_iid(233)); | ||
115 | R7S72100_SCIF(4, 0xe8009000, gic_iid(237)); | ||
116 | R7S72100_SCIF(5, 0xe8009800, gic_iid(241)); | ||
117 | R7S72100_SCIF(6, 0xe800a000, gic_iid(245)); | ||
118 | R7S72100_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 | |||
92 | static void __init genmai_add_standard_devices(void) | 127 | static 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 | ||
107 | static const char * const genmai_boards_compat_dt[] __initconst = { | 151 | static 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 a3fd30242bd8..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 | ||
85 | static 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. | 88 | static 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, | 98 | static 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 | ||
109 | static 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 | ||
@@ -139,7 +124,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = { | |||
139 | 124 | ||
140 | DT_MACHINE_START(KOELSCH_DT, "koelsch") | 125 | DT_MACHINE_START(KOELSCH_DT, "koelsch") |
141 | .smp = smp_ops(r8a7791_smp_ops), | 126 | .smp = smp_ops(r8a7791_smp_ops), |
142 | .init_early = r8a7791_init_early, | 127 | .init_early = shmobile_init_delay, |
143 | .init_time = rcar_gen2_timer_init, | 128 | .init_time = rcar_gen2_timer_init, |
144 | .init_machine = koelsch_add_standard_devices, | 129 | .init_machine = koelsch_add_standard_devices, |
145 | .init_late = shmobile_init_late, | 130 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 5a034ff405d0..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, |
@@ -522,7 +522,7 @@ static const char * const koelsch_boards_compat_dt[] __initconst = { | |||
522 | 522 | ||
523 | DT_MACHINE_START(KOELSCH_DT, "koelsch") | 523 | DT_MACHINE_START(KOELSCH_DT, "koelsch") |
524 | .smp = smp_ops(r8a7791_smp_ops), | 524 | .smp = smp_ops(r8a7791_smp_ops), |
525 | .init_early = r8a7791_init_early, | 525 | .init_early = shmobile_init_delay, |
526 | .init_time = rcar_gen2_timer_init, | 526 | .init_time = rcar_gen2_timer_init, |
527 | .init_machine = koelsch_init, | 527 | .init_machine = koelsch_init, |
528 | .init_late = shmobile_init_late, | 528 | .init_late = shmobile_init_late, |
diff --git a/arch/arm/mach-shmobile/board-kzm9g-reference.c b/arch/arm/mach-shmobile/board-kzm9g-reference.c index 598e32488410..a735a1d80c28 100644 --- a/arch/arm/mach-shmobile/board-kzm9g-reference.c +++ b/arch/arm/mach-shmobile/board-kzm9g-reference.c | |||
@@ -36,8 +36,8 @@ static void __init kzm_init(void) | |||
36 | sh73a0_add_standard_devices_dt(); | 36 | sh73a0_add_standard_devices_dt(); |
37 | 37 | ||
38 | #ifdef CONFIG_CACHE_L2X0 | 38 | #ifdef CONFIG_CACHE_L2X0 |
39 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ | 39 | /* Shared attribute override enable, 64K*8way */ |
40 | l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); | 40 | l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); |
41 | #endif | 41 | #endif |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c index 03dc3ac84502..f94ec8ca42c1 100644 --- a/arch/arm/mach-shmobile/board-kzm9g.c +++ b/arch/arm/mach-shmobile/board-kzm9g.c | |||
@@ -876,8 +876,8 @@ static void __init kzm_init(void) | |||
876 | gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */ | 876 | gpio_request_one(223, GPIOF_IN, NULL); /* IRQ8 */ |
877 | 877 | ||
878 | #ifdef CONFIG_CACHE_L2X0 | 878 | #ifdef CONFIG_CACHE_L2X0 |
879 | /* Early BRESP enable, Shared attribute override enable, 64K*8way */ | 879 | /* Shared attribute override enable, 64K*8way */ |
880 | l2x0_init(IOMEM(0xf0100000), 0x40460000, 0x82000fff); | 880 | l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); |
881 | #endif | 881 | #endif |
882 | 882 | ||
883 | i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); | 883 | i2c_register_board_info(0, i2c0_devices, ARRAY_SIZE(i2c0_devices)); |
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 | ||
89 | static 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. | 92 | static 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, | 104 | static 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 | ||
114 | static 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 | ||
326 | static const struct spi_board_info spi_info[] __initconst = { | 326 | static 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 | ||
569 | static struct rsnd_ssi_platform_info rsnd_ssi[] = { | 569 | static 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 | ||
574 | static struct rsnd_scu_platform_info rsnd_scu[2] = { | 574 | static struct rsnd_src_platform_info rsnd_src[2] = { |
575 | /* no member at this point */ | 575 | /* no member at this point */ |
576 | }; | 576 | }; |
577 | 577 | ||
578 | static struct rsnd_dai_platform_info rsnd_dai = { | ||
579 | .playback = { .ssi = &rsnd_ssi[0], }, | ||
580 | .capture = { .ssi = &rsnd_ssi[1], }, | ||
581 | }; | ||
582 | |||
578 | static struct rcar_snd_info rsnd_info = { | 583 | static 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 | ||
586 | static struct asoc_simple_card_info rsnd_card_info = { | 593 | static struct asoc_simple_card_info rsnd_card_info = { |
diff --git a/arch/arm/mach-shmobile/clock-emev2.c b/arch/arm/mach-shmobile/clock-emev2.c deleted file mode 100644 index 5ac13ba71d54..000000000000 --- a/arch/arm/mach-shmobile/clock-emev2.c +++ /dev/null | |||
@@ -1,231 +0,0 @@ | |||
1 | /* | ||
2 | * Emma Mobile EV2 clock framework support | ||
3 | * | ||
4 | * Copyright (C) 2012 Magnus Damm | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; version 2 of the License. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
18 | */ | ||
19 | #include <linux/init.h> | ||
20 | #include <linux/kernel.h> | ||
21 | #include <linux/io.h> | ||
22 | #include <linux/sh_clk.h> | ||
23 | #include <linux/clkdev.h> | ||
24 | #include <mach/common.h> | ||
25 | |||
26 | #define EMEV2_SMU_BASE 0xe0110000 | ||
27 | |||
28 | /* EMEV2 SMU registers */ | ||
29 | #define USIAU0_RSTCTRL 0x094 | ||
30 | #define USIBU1_RSTCTRL 0x0ac | ||
31 | #define USIBU2_RSTCTRL 0x0b0 | ||
32 | #define USIBU3_RSTCTRL 0x0b4 | ||
33 | #define STI_RSTCTRL 0x124 | ||
34 | #define USIAU0GCLKCTRL 0x4a0 | ||
35 | #define USIBU1GCLKCTRL 0x4b8 | ||
36 | #define USIBU2GCLKCTRL 0x4bc | ||
37 | #define USIBU3GCLKCTRL 0x04c0 | ||
38 | #define STIGCLKCTRL 0x528 | ||
39 | #define USIAU0SCLKDIV 0x61c | ||
40 | #define USIB2SCLKDIV 0x65c | ||
41 | #define USIB3SCLKDIV 0x660 | ||
42 | #define STI_CLKSEL 0x688 | ||
43 | |||
44 | /* not pretty, but hey */ | ||
45 | static void __iomem *smu_base; | ||
46 | |||
47 | static void emev2_smu_write(unsigned long value, int offs) | ||
48 | { | ||
49 | BUG_ON(!smu_base || (offs >= PAGE_SIZE)); | ||
50 | iowrite32(value, smu_base + offs); | ||
51 | } | ||
52 | |||
53 | static struct clk_mapping smu_mapping = { | ||
54 | .phys = EMEV2_SMU_BASE, | ||
55 | .len = PAGE_SIZE, | ||
56 | }; | ||
57 | |||
58 | /* Fixed 32 KHz root clock from C32K pin */ | ||
59 | static struct clk c32k_clk = { | ||
60 | .rate = 32768, | ||
61 | .mapping = &smu_mapping, | ||
62 | }; | ||
63 | |||
64 | /* PLL3 multiplies C32K with 7000 */ | ||
65 | static unsigned long pll3_recalc(struct clk *clk) | ||
66 | { | ||
67 | return clk->parent->rate * 7000; | ||
68 | } | ||
69 | |||
70 | static struct sh_clk_ops pll3_clk_ops = { | ||
71 | .recalc = pll3_recalc, | ||
72 | }; | ||
73 | |||
74 | static struct clk pll3_clk = { | ||
75 | .ops = &pll3_clk_ops, | ||
76 | .parent = &c32k_clk, | ||
77 | }; | ||
78 | |||
79 | static struct clk *main_clks[] = { | ||
80 | &c32k_clk, | ||
81 | &pll3_clk, | ||
82 | }; | ||
83 | |||
84 | enum { SCLKDIV_USIAU0, SCLKDIV_USIBU2, SCLKDIV_USIBU1, SCLKDIV_USIBU3, | ||
85 | SCLKDIV_NR }; | ||
86 | |||
87 | #define SCLKDIV(_reg, _shift) \ | ||
88 | { \ | ||
89 | .parent = &pll3_clk, \ | ||
90 | .enable_reg = IOMEM(EMEV2_SMU_BASE + (_reg)), \ | ||
91 | .enable_bit = _shift, \ | ||
92 | } | ||
93 | |||
94 | static struct clk sclkdiv_clks[SCLKDIV_NR] = { | ||
95 | [SCLKDIV_USIAU0] = SCLKDIV(USIAU0SCLKDIV, 0), | ||
96 | [SCLKDIV_USIBU2] = SCLKDIV(USIB2SCLKDIV, 16), | ||
97 | [SCLKDIV_USIBU1] = SCLKDIV(USIB2SCLKDIV, 0), | ||
98 | [SCLKDIV_USIBU3] = SCLKDIV(USIB3SCLKDIV, 0), | ||
99 | }; | ||
100 | |||
101 | enum { GCLK_USIAU0_SCLK, GCLK_USIBU1_SCLK, GCLK_USIBU2_SCLK, GCLK_USIBU3_SCLK, | ||
102 | GCLK_STI_SCLK, | ||
103 | GCLK_NR }; | ||
104 | |||
105 | #define GCLK_SCLK(_parent, _reg) \ | ||
106 | { \ | ||
107 | .parent = _parent, \ | ||
108 | .enable_reg = IOMEM(EMEV2_SMU_BASE + (_reg)), \ | ||
109 | .enable_bit = 1, /* SCLK_GCC */ \ | ||
110 | } | ||
111 | |||
112 | static struct clk gclk_clks[GCLK_NR] = { | ||
113 | [GCLK_USIAU0_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIAU0], | ||
114 | USIAU0GCLKCTRL), | ||
115 | [GCLK_USIBU1_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU1], | ||
116 | USIBU1GCLKCTRL), | ||
117 | [GCLK_USIBU2_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU2], | ||
118 | USIBU2GCLKCTRL), | ||
119 | [GCLK_USIBU3_SCLK] = GCLK_SCLK(&sclkdiv_clks[SCLKDIV_USIBU3], | ||
120 | USIBU3GCLKCTRL), | ||
121 | [GCLK_STI_SCLK] = GCLK_SCLK(&c32k_clk, STIGCLKCTRL), | ||
122 | }; | ||
123 | |||
124 | static int emev2_gclk_enable(struct clk *clk) | ||
125 | { | ||
126 | iowrite32(ioread32(clk->mapped_reg) | (1 << clk->enable_bit), | ||
127 | clk->mapped_reg); | ||
128 | return 0; | ||
129 | } | ||
130 | |||
131 | static void emev2_gclk_disable(struct clk *clk) | ||
132 | { | ||
133 | iowrite32(ioread32(clk->mapped_reg) & ~(1 << clk->enable_bit), | ||
134 | clk->mapped_reg); | ||
135 | } | ||
136 | |||
137 | static struct sh_clk_ops emev2_gclk_clk_ops = { | ||
138 | .enable = emev2_gclk_enable, | ||
139 | .disable = emev2_gclk_disable, | ||
140 | .recalc = followparent_recalc, | ||
141 | }; | ||
142 | |||
143 | static int __init emev2_gclk_register(struct clk *clks, int nr) | ||
144 | { | ||
145 | struct clk *clkp; | ||
146 | int ret = 0; | ||
147 | int k; | ||
148 | |||
149 | for (k = 0; !ret && (k < nr); k++) { | ||
150 | clkp = clks + k; | ||
151 | clkp->ops = &emev2_gclk_clk_ops; | ||
152 | ret |= clk_register(clkp); | ||
153 | } | ||
154 | |||
155 | return ret; | ||
156 | } | ||
157 | |||
158 | static unsigned long emev2_sclkdiv_recalc(struct clk *clk) | ||
159 | { | ||
160 | unsigned int sclk_div; | ||
161 | |||
162 | sclk_div = (ioread32(clk->mapped_reg) >> clk->enable_bit) & 0xff; | ||
163 | |||
164 | return clk->parent->rate / (sclk_div + 1); | ||
165 | } | ||
166 | |||
167 | static struct sh_clk_ops emev2_sclkdiv_clk_ops = { | ||
168 | .recalc = emev2_sclkdiv_recalc, | ||
169 | }; | ||
170 | |||
171 | static int __init emev2_sclkdiv_register(struct clk *clks, int nr) | ||
172 | { | ||
173 | struct clk *clkp; | ||
174 | int ret = 0; | ||
175 | int k; | ||
176 | |||
177 | for (k = 0; !ret && (k < nr); k++) { | ||
178 | clkp = clks + k; | ||
179 | clkp->ops = &emev2_sclkdiv_clk_ops; | ||
180 | ret |= clk_register(clkp); | ||
181 | } | ||
182 | |||
183 | return ret; | ||
184 | } | ||
185 | |||
186 | static struct clk_lookup lookups[] = { | ||
187 | CLKDEV_DEV_ID("serial8250-em.0", &gclk_clks[GCLK_USIAU0_SCLK]), | ||
188 | CLKDEV_DEV_ID("e1020000.uart", &gclk_clks[GCLK_USIAU0_SCLK]), | ||
189 | CLKDEV_DEV_ID("serial8250-em.1", &gclk_clks[GCLK_USIBU1_SCLK]), | ||
190 | CLKDEV_DEV_ID("e1030000.uart", &gclk_clks[GCLK_USIBU1_SCLK]), | ||
191 | CLKDEV_DEV_ID("serial8250-em.2", &gclk_clks[GCLK_USIBU2_SCLK]), | ||
192 | CLKDEV_DEV_ID("e1040000.uart", &gclk_clks[GCLK_USIBU2_SCLK]), | ||
193 | CLKDEV_DEV_ID("serial8250-em.3", &gclk_clks[GCLK_USIBU3_SCLK]), | ||
194 | CLKDEV_DEV_ID("e1050000.uart", &gclk_clks[GCLK_USIBU3_SCLK]), | ||
195 | CLKDEV_DEV_ID("em_sti.0", &gclk_clks[GCLK_STI_SCLK]), | ||
196 | CLKDEV_DEV_ID("e0180000.sti", &gclk_clks[GCLK_STI_SCLK]), | ||
197 | }; | ||
198 | |||
199 | void __init emev2_clock_init(void) | ||
200 | { | ||
201 | int k, ret = 0; | ||
202 | |||
203 | smu_base = ioremap(EMEV2_SMU_BASE, PAGE_SIZE); | ||
204 | BUG_ON(!smu_base); | ||
205 | |||
206 | /* setup STI timer to run on 32.768 kHz and deassert reset */ | ||
207 | emev2_smu_write(0, STI_CLKSEL); | ||
208 | emev2_smu_write(1, STI_RSTCTRL); | ||
209 | |||
210 | /* deassert reset for UART0->UART3 */ | ||
211 | emev2_smu_write(2, USIAU0_RSTCTRL); | ||
212 | emev2_smu_write(2, USIBU1_RSTCTRL); | ||
213 | emev2_smu_write(2, USIBU2_RSTCTRL); | ||
214 | emev2_smu_write(2, USIBU3_RSTCTRL); | ||
215 | |||
216 | for (k = 0; !ret && (k < ARRAY_SIZE(main_clks)); k++) | ||
217 | ret = clk_register(main_clks[k]); | ||
218 | |||
219 | if (!ret) | ||
220 | ret = emev2_sclkdiv_register(sclkdiv_clks, SCLKDIV_NR); | ||
221 | |||
222 | if (!ret) | ||
223 | ret = emev2_gclk_register(gclk_clks, GCLK_NR); | ||
224 | |||
225 | clkdev_add_table(lookups, ARRAY_SIZE(lookups)); | ||
226 | |||
227 | if (!ret) | ||
228 | shmobile_clk_init(); | ||
229 | else | ||
230 | panic("failed to setup emev2 clocks\n"); | ||
231 | } | ||
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 | ||
220 | void __init r7s72100_clock_init(void) | 211 | void __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..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]), |
@@ -596,7 +589,7 @@ static struct clk_lookup lookups[] = { | |||
596 | CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), | 589 | CLKDEV_DEV_ID("sh_mmcif", &mstp_clks[MSTP312]), |
597 | CLKDEV_DEV_ID("e6bd0000.mmc", &mstp_clks[MSTP312]), | 590 | CLKDEV_DEV_ID("e6bd0000.mmc", &mstp_clks[MSTP312]), |
598 | CLKDEV_DEV_ID("r8a7740-gether", &mstp_clks[MSTP309]), | 591 | CLKDEV_DEV_ID("r8a7740-gether", &mstp_clks[MSTP309]), |
599 | CLKDEV_DEV_ID("e9a00000.sh-eth", &mstp_clks[MSTP309]), | 592 | CLKDEV_DEV_ID("e9a00000.ethernet", &mstp_clks[MSTP309]), |
600 | CLKDEV_DEV_ID("renesas-tpu-pwm", &mstp_clks[MSTP304]), | 593 | CLKDEV_DEV_ID("renesas-tpu-pwm", &mstp_clks[MSTP304]), |
601 | CLKDEV_DEV_ID("e6600000.pwm", &mstp_clks[MSTP304]), | 594 | CLKDEV_DEV_ID("e6600000.pwm", &mstp_clks[MSTP304]), |
602 | 595 | ||
@@ -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 9989b1b06ffd..13f8f3ab8840 100644 --- a/arch/arm/mach-shmobile/clock-r8a7778.c +++ b/arch/arm/mach-shmobile/clock-r8a7778.c | |||
@@ -175,10 +175,6 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
175 | 175 | ||
176 | static struct clk_lookup lookups[] = { | 176 | static struct clk_lookup lookups[] = { |
177 | /* main */ | 177 | /* main */ |
178 | CLKDEV_CON_ID("audio_clk_a", &audio_clk_a), | ||
179 | CLKDEV_CON_ID("audio_clk_b", &audio_clk_b), | ||
180 | CLKDEV_CON_ID("audio_clk_c", &audio_clk_c), | ||
181 | CLKDEV_CON_ID("audio_clk_internal", &s1_clk), | ||
182 | CLKDEV_CON_ID("shyway_clk", &s_clk), | 178 | CLKDEV_CON_ID("shyway_clk", &s_clk), |
183 | CLKDEV_CON_ID("peripheral_clk", &p_clk), | 179 | CLKDEV_CON_ID("peripheral_clk", &p_clk), |
184 | 180 | ||
@@ -211,8 +207,6 @@ static struct clk_lookup lookups[] = { | |||
211 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ | 207 | CLKDEV_DEV_ID("sh-sci.3", &mstp_clks[MSTP023]), /* SCIF3 */ |
212 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ | 208 | CLKDEV_DEV_ID("sh-sci.4", &mstp_clks[MSTP022]), /* SCIF4 */ |
213 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ | 209 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP021]), /* SCIF6 */ |
214 | CLKDEV_DEV_ID("sh_tmu.0", &mstp_clks[MSTP016]), /* TMU00 */ | ||
215 | CLKDEV_DEV_ID("sh_tmu.1", &mstp_clks[MSTP015]), /* TMU01 */ | ||
216 | CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ | 210 | CLKDEV_DEV_ID("sh-hspi.0", &mstp_clks[MSTP007]), /* HSPI0 */ |
217 | CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ | 211 | CLKDEV_DEV_ID("fffc7000.spi", &mstp_clks[MSTP007]), /* HSPI0 */ |
218 | CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ | 212 | CLKDEV_DEV_ID("sh-hspi.1", &mstp_clks[MSTP007]), /* HSPI1 */ |
@@ -234,15 +228,17 @@ static struct clk_lookup lookups[] = { | |||
234 | CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]), | 228 | CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]), |
235 | CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]), | 229 | CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]), |
236 | CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]), | 230 | CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]), |
237 | CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP531]), | 231 | CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP531]), |
238 | CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP530]), | 232 | CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP530]), |
239 | CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP529]), | 233 | CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP529]), |
240 | CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP528]), | 234 | CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP528]), |
241 | CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP527]), | 235 | CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP527]), |
242 | CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP526]), | 236 | CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP526]), |
243 | CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP525]), | 237 | CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]), |
244 | CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP524]), | 238 | CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]), |
245 | CLKDEV_ICK_ID("scu.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]), | ||
246 | }; | 242 | }; |
247 | 243 | ||
248 | void __init r8a7778_clock_init(void) | 244 | void __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 3f93503f5b96..296a057109e4 100644 --- a/arch/arm/mach-shmobile/clock-r8a7790.c +++ b/arch/arm/mach-shmobile/clock-r8a7790.c | |||
@@ -249,10 +249,10 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
249 | [MSTP1007] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 7, MSTPSR10, 0), /* SSI8 */ | 249 | [MSTP1007] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 7, MSTPSR10, 0), /* SSI8 */ |
250 | [MSTP1006] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 6, MSTPSR10, 0), /* SSI9 */ | 250 | [MSTP1006] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 6, MSTPSR10, 0), /* SSI9 */ |
251 | [MSTP1005] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 5, MSTPSR10, 0), /* SSI ALL */ | 251 | [MSTP1005] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR10, 5, MSTPSR10, 0), /* SSI ALL */ |
252 | [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */ | 252 | [MSTP931] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */ |
253 | [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */ | 253 | [MSTP930] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */ |
254 | [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */ | 254 | [MSTP929] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */ |
255 | [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */ | 255 | [MSTP928] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */ |
256 | [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */ | 256 | [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */ |
257 | [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */ | 257 | [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */ |
258 | [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */ | 258 | [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */ |
@@ -294,10 +294,6 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
294 | static struct clk_lookup lookups[] = { | 294 | static struct clk_lookup lookups[] = { |
295 | 295 | ||
296 | /* main clocks */ | 296 | /* main clocks */ |
297 | CLKDEV_CON_ID("audio_clk_a", &audio_clk_a), | ||
298 | CLKDEV_CON_ID("audio_clk_b", &audio_clk_b), | ||
299 | CLKDEV_CON_ID("audio_clk_c", &audio_clk_c), | ||
300 | CLKDEV_CON_ID("audio_clk_internal", &m2_clk), | ||
301 | CLKDEV_CON_ID("extal", &extal_clk), | 297 | CLKDEV_CON_ID("extal", &extal_clk), |
302 | CLKDEV_CON_ID("extal_div2", &extal_div2_clk), | 298 | CLKDEV_CON_ID("extal_div2", &extal_div2_clk), |
303 | CLKDEV_CON_ID("main", &main_clk), | 299 | CLKDEV_CON_ID("main", &main_clk), |
@@ -361,7 +357,6 @@ static struct clk_lookup lookups[] = { | |||
361 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]), | 357 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP312]), |
362 | CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]), | 358 | CLKDEV_DEV_ID("sh_mobile_sdhi.3", &mstp_clks[MSTP311]), |
363 | CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), | 359 | CLKDEV_DEV_ID("sh_mmcif.1", &mstp_clks[MSTP305]), |
364 | CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), | ||
365 | CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), | 360 | CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), |
366 | CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]), | 361 | CLKDEV_DEV_ID("renesas_usbhs", &mstp_clks[MSTP704]), |
367 | CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]), | 362 | CLKDEV_DEV_ID("pci-rcar-gen2.0", &mstp_clks[MSTP703]), |
@@ -371,6 +366,7 @@ static struct clk_lookup lookups[] = { | |||
371 | CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]), | 366 | CLKDEV_DEV_ID("sata-r8a7790.1", &mstp_clks[MSTP814]), |
372 | 367 | ||
373 | /* ICK */ | 368 | /* ICK */ |
369 | CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.0", &mstp_clks[MSTP124]), | ||
374 | CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]), | 370 | CLKDEV_ICK_ID("usbhs", "usb_phy_rcar_gen2", &mstp_clks[MSTP704]), |
375 | CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7790", &mstp_clks[MSTP726]), | 371 | CLKDEV_ICK_ID("lvds.0", "rcar-du-r8a7790", &mstp_clks[MSTP726]), |
376 | CLKDEV_ICK_ID("lvds.1", "rcar-du-r8a7790", &mstp_clks[MSTP725]), | 372 | CLKDEV_ICK_ID("lvds.1", "rcar-du-r8a7790", &mstp_clks[MSTP725]), |
@@ -381,16 +377,16 @@ static struct clk_lookup lookups[] = { | |||
381 | CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b), | 377 | CLKDEV_ICK_ID("clk_b", "rcar_sound", &audio_clk_b), |
382 | CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c), | 378 | CLKDEV_ICK_ID("clk_c", "rcar_sound", &audio_clk_c), |
383 | CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk), | 379 | CLKDEV_ICK_ID("clk_i", "rcar_sound", &m2_clk), |
384 | CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP1031]), | 380 | CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP1031]), |
385 | CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP1030]), | 381 | CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP1030]), |
386 | CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP1029]), | 382 | CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP1029]), |
387 | CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP1028]), | 383 | CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP1028]), |
388 | CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP1027]), | 384 | CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP1027]), |
389 | CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP1026]), | 385 | CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP1026]), |
390 | CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP1025]), | 386 | CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP1025]), |
391 | CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP1024]), | 387 | CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP1024]), |
392 | CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP1023]), | 388 | CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP1023]), |
393 | CLKDEV_ICK_ID("scu.9", "rcar_sound", &mstp_clks[MSTP1022]), | 389 | CLKDEV_ICK_ID("src.9", "rcar_sound", &mstp_clks[MSTP1022]), |
394 | CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]), | 390 | CLKDEV_ICK_ID("ssi.0", "rcar_sound", &mstp_clks[MSTP1015]), |
395 | CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]), | 391 | CLKDEV_ICK_ID("ssi.1", "rcar_sound", &mstp_clks[MSTP1014]), |
396 | CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]), | 392 | CLKDEV_ICK_ID("ssi.2", "rcar_sound", &mstp_clks[MSTP1013]), |
diff --git a/arch/arm/mach-shmobile/clock-r8a7791.c b/arch/arm/mach-shmobile/clock-r8a7791.c index 701383fe3267..e2fdfcc14436 100644 --- a/arch/arm/mach-shmobile/clock-r8a7791.c +++ b/arch/arm/mach-shmobile/clock-r8a7791.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/clkdev.h> | 25 | #include <linux/clkdev.h> |
26 | #include <mach/clock.h> | 26 | #include <mach/clock.h> |
27 | #include <mach/common.h> | 27 | #include <mach/common.h> |
28 | #include <mach/rcar-gen2.h> | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * MD EXTAL PLL0 PLL1 PLL3 | 31 | * MD EXTAL PLL0 PLL1 PLL3 |
@@ -43,8 +44,6 @@ | |||
43 | * see "p1 / 2" on R8A7791_CLOCK_ROOT() below | 44 | * see "p1 / 2" on R8A7791_CLOCK_ROOT() below |
44 | */ | 45 | */ |
45 | 46 | ||
46 | #define MD(nr) (1 << nr) | ||
47 | |||
48 | #define CPG_BASE 0xe6150000 | 47 | #define CPG_BASE 0xe6150000 |
49 | #define CPG_LEN 0x1000 | 48 | #define CPG_LEN 0x1000 |
50 | 49 | ||
@@ -68,7 +67,6 @@ | |||
68 | #define MSTPSR9 IOMEM(0xe61509a4) | 67 | #define MSTPSR9 IOMEM(0xe61509a4) |
69 | #define MSTPSR11 IOMEM(0xe61509ac) | 68 | #define MSTPSR11 IOMEM(0xe61509ac) |
70 | 69 | ||
71 | #define MODEMR 0xE6160060 | ||
72 | #define SDCKCR 0xE6150074 | 70 | #define SDCKCR 0xE6150074 |
73 | #define SD1CKCR 0xE6150078 | 71 | #define SD1CKCR 0xE6150078 |
74 | #define SD2CKCR 0xE615026c | 72 | #define SD2CKCR 0xE615026c |
@@ -190,12 +188,12 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
190 | [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */ | 188 | [MSTP1108] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 8, MSTPSR11, 0), /* SCIFA5 */ |
191 | [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */ | 189 | [MSTP1107] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 7, MSTPSR11, 0), /* SCIFA4 */ |
192 | [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */ | 190 | [MSTP1106] = SH_CLK_MSTP32_STS(&mp_clk, SMSTPCR11, 6, MSTPSR11, 0), /* SCIFA3 */ |
193 | [MSTP931] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */ | 191 | [MSTP931] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 31, MSTPSR9, 0), /* I2C0 */ |
194 | [MSTP930] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */ | 192 | [MSTP930] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 30, MSTPSR9, 0), /* I2C1 */ |
195 | [MSTP929] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */ | 193 | [MSTP929] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 29, MSTPSR9, 0), /* I2C2 */ |
196 | [MSTP928] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */ | 194 | [MSTP928] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 28, MSTPSR9, 0), /* I2C3 */ |
197 | [MSTP927] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */ | 195 | [MSTP927] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 27, MSTPSR9, 0), /* I2C4 */ |
198 | [MSTP925] = SH_CLK_MSTP32_STS(&p_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */ | 196 | [MSTP925] = SH_CLK_MSTP32_STS(&hp_clk, SMSTPCR9, 25, MSTPSR9, 0), /* I2C5 */ |
199 | [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */ | 197 | [MSTP917] = SH_CLK_MSTP32_STS(&qspi_clk, SMSTPCR9, 17, MSTPSR9, 0), /* QSPI */ |
200 | [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */ | 198 | [MSTP815] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 15, MSTPSR8, 0), /* SATA0 */ |
201 | [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */ | 199 | [MSTP814] = SH_CLK_MSTP32_STS(&zs_clk, SMSTPCR8, 14, MSTPSR8, 0), /* SATA1 */ |
@@ -266,7 +264,7 @@ static struct clk_lookup lookups[] = { | |||
266 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), | 264 | CLKDEV_DEV_ID("sh_mobile_sdhi.0", &mstp_clks[MSTP314]), |
267 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]), | 265 | CLKDEV_DEV_ID("sh_mobile_sdhi.1", &mstp_clks[MSTP312]), |
268 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), | 266 | CLKDEV_DEV_ID("sh_mobile_sdhi.2", &mstp_clks[MSTP311]), |
269 | CLKDEV_DEV_ID("sh_cmt.0", &mstp_clks[MSTP124]), | 267 | CLKDEV_ICK_ID("fck", "sh-cmt-48-gen2.0", &mstp_clks[MSTP124]), |
270 | CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), | 268 | CLKDEV_DEV_ID("qspi.0", &mstp_clks[MSTP917]), |
271 | CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), | 269 | CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]), |
272 | CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]), | 270 | CLKDEV_DEV_ID("i2c-rcar_gen2.0", &mstp_clks[MSTP931]), |
@@ -295,14 +293,9 @@ static struct clk_lookup lookups[] = { | |||
295 | 293 | ||
296 | void __init r8a7791_clock_init(void) | 294 | void __init r8a7791_clock_init(void) |
297 | { | 295 | { |
298 | void __iomem *modemr = ioremap_nocache(MODEMR, PAGE_SIZE); | 296 | u32 mode = rcar_gen2_read_mode_pins(); |
299 | u32 mode; | ||
300 | int k, ret = 0; | 297 | int k, ret = 0; |
301 | 298 | ||
302 | BUG_ON(!modemr); | ||
303 | mode = ioread32(modemr); | ||
304 | iounmap(modemr); | ||
305 | |||
306 | switch (mode & (MD(14) | MD(13))) { | 299 | switch (mode & (MD(14) | MD(13))) { |
307 | case 0: | 300 | case 0: |
308 | R8A7791_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88); | 301 | R8A7791_CLOCK_ROOT(15, &extal_clk, 172, 208, 106, 88); |
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 | ||
688 | void __init sh73a0_clock_init(void) | 687 | void __init sh73a0_clock_init(void) |
diff --git a/arch/arm/mach-shmobile/clock.c b/arch/arm/mach-shmobile/clock.c index ad7df629d995..e7232a0373b9 100644 --- a/arch/arm/mach-shmobile/clock.c +++ b/arch/arm/mach-shmobile/clock.c | |||
@@ -21,6 +21,32 @@ | |||
21 | */ | 21 | */ |
22 | #include <linux/kernel.h> | 22 | #include <linux/kernel.h> |
23 | #include <linux/init.h> | 23 | #include <linux/init.h> |
24 | |||
25 | #ifdef CONFIG_COMMON_CLK | ||
26 | #include <linux/clk.h> | ||
27 | #include <linux/clkdev.h> | ||
28 | #include <mach/clock.h> | ||
29 | |||
30 | void __init shmobile_clk_workaround(const struct clk_name *clks, | ||
31 | int nr_clks, bool enable) | ||
32 | { | ||
33 | const struct clk_name *clkn; | ||
34 | struct clk *clk; | ||
35 | unsigned int i; | ||
36 | |||
37 | for (i = 0; i < nr_clks; ++i) { | ||
38 | clkn = clks + i; | ||
39 | clk = clk_get(NULL, clkn->clk); | ||
40 | if (!IS_ERR(clk)) { | ||
41 | clk_register_clkdev(clk, clkn->con_id, clkn->dev_id); | ||
42 | if (enable) | ||
43 | clk_prepare_enable(clk); | ||
44 | clk_put(clk); | ||
45 | } | ||
46 | } | ||
47 | } | ||
48 | |||
49 | #else /* CONFIG_COMMON_CLK */ | ||
24 | #include <linux/sh_clk.h> | 50 | #include <linux/sh_clk.h> |
25 | #include <linux/export.h> | 51 | #include <linux/export.h> |
26 | #include <mach/clock.h> | 52 | #include <mach/clock.h> |
@@ -58,3 +84,5 @@ void __clk_put(struct clk *clk) | |||
58 | { | 84 | { |
59 | } | 85 | } |
60 | EXPORT_SYMBOL(__clk_put); | 86 | EXPORT_SYMBOL(__clk_put); |
87 | |||
88 | #endif /* CONFIG_COMMON_CLK */ | ||
diff --git a/arch/arm/mach-shmobile/include/mach/clock.h b/arch/arm/mach-shmobile/include/mach/clock.h index 03e56074928c..31b6417463e6 100644 --- a/arch/arm/mach-shmobile/include/mach/clock.h +++ b/arch/arm/mach-shmobile/include/mach/clock.h | |||
@@ -1,6 +1,22 @@ | |||
1 | #ifndef CLOCK_H | 1 | #ifndef CLOCK_H |
2 | #define CLOCK_H | 2 | #define CLOCK_H |
3 | 3 | ||
4 | #ifdef CONFIG_COMMON_CLK | ||
5 | /* temporary clock configuration helper for platform devices */ | ||
6 | |||
7 | struct clk_name { | ||
8 | const char *clk; | ||
9 | const char *con_id; | ||
10 | const char *dev_id; | ||
11 | }; | ||
12 | |||
13 | void shmobile_clk_workaround(const struct clk_name *clks, int nr_clks, | ||
14 | bool enable); | ||
15 | |||
16 | #else /* CONFIG_COMMON_CLK */ | ||
17 | /* legacy clock implementation */ | ||
18 | |||
19 | struct clk; | ||
4 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk); | 20 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk); |
5 | extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops; | 21 | extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops; |
6 | 22 | ||
@@ -36,4 +52,5 @@ do { \ | |||
36 | (p)->div = d; \ | 52 | (p)->div = d; \ |
37 | } while (0) | 53 | } while (0) |
38 | 54 | ||
55 | #endif /* CONFIG_COMMON_CLK */ | ||
39 | #endif | 56 | #endif |
diff --git a/arch/arm/mach-shmobile/include/mach/common.h b/arch/arm/mach-shmobile/include/mach/common.h index cb8e32deb2a3..f7a360edcc35 100644 --- a/arch/arm/mach-shmobile/include/mach/common.h +++ b/arch/arm/mach-shmobile/include/mach/common.h | |||
@@ -4,6 +4,7 @@ | |||
4 | extern void shmobile_earlytimer_init(void); | 4 | extern void shmobile_earlytimer_init(void); |
5 | extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, | 5 | extern void shmobile_setup_delay(unsigned int max_cpu_core_mhz, |
6 | unsigned int mult, unsigned int div); | 6 | unsigned int mult, unsigned int div); |
7 | extern void shmobile_init_delay(void); | ||
7 | struct twd_local_timer; | 8 | struct twd_local_timer; |
8 | extern void shmobile_setup_console(void); | 9 | extern void shmobile_setup_console(void); |
9 | extern void shmobile_boot_vector(void); | 10 | extern void shmobile_boot_vector(void); |
diff --git a/arch/arm/mach-shmobile/include/mach/emev2.h b/arch/arm/mach-shmobile/include/mach/emev2.h deleted file mode 100644 index fcb142a14e07..000000000000 --- a/arch/arm/mach-shmobile/include/mach/emev2.h +++ /dev/null | |||
@@ -1,9 +0,0 @@ | |||
1 | #ifndef __ASM_EMEV2_H__ | ||
2 | #define __ASM_EMEV2_H__ | ||
3 | |||
4 | extern void emev2_map_io(void); | ||
5 | extern void emev2_init_delay(void); | ||
6 | extern void emev2_clock_init(void); | ||
7 | extern struct smp_operations emev2_smp_ops; | ||
8 | |||
9 | #endif /* __ASM_EMEV2_H__ */ | ||
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7740.h b/arch/arm/mach-shmobile/include/mach/r8a7740.h index d07932f872b6..5e3c9ec06303 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7740.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7740.h | |||
@@ -47,7 +47,6 @@ enum { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | extern void r8a7740_meram_workaround(void); | 49 | extern void r8a7740_meram_workaround(void); |
50 | extern void r8a7740_init_delay(void); | ||
51 | extern void r8a7740_init_irq_of(void); | 50 | extern void r8a7740_init_irq_of(void); |
52 | extern void r8a7740_map_io(void); | 51 | extern void r8a7740_map_io(void); |
53 | extern void r8a7740_add_early_devices(void); | 52 | extern void r8a7740_add_early_devices(void); |
diff --git a/arch/arm/mach-shmobile/include/mach/r8a7791.h b/arch/arm/mach-shmobile/include/mach/r8a7791.h index 200fa699f730..664274cc4b64 100644 --- a/arch/arm/mach-shmobile/include/mach/r8a7791.h +++ b/arch/arm/mach-shmobile/include/mach/r8a7791.h | |||
@@ -5,7 +5,6 @@ void r8a7791_add_standard_devices(void); | |||
5 | void r8a7791_add_dt_devices(void); | 5 | void r8a7791_add_dt_devices(void); |
6 | void r8a7791_clock_init(void); | 6 | void r8a7791_clock_init(void); |
7 | void r8a7791_pinmux_init(void); | 7 | void r8a7791_pinmux_init(void); |
8 | void r8a7791_init_early(void); | ||
9 | extern struct smp_operations r8a7791_smp_ops; | 8 | extern struct smp_operations r8a7791_smp_ops; |
10 | 9 | ||
11 | #endif /* __ASM_R8A7791_H__ */ | 10 | #endif /* __ASM_R8A7791_H__ */ |
diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c index 1fc05d9453d0..f710235aff2f 100644 --- a/arch/arm/mach-shmobile/pm-rmobile.c +++ b/arch/arm/mach-shmobile/pm-rmobile.c | |||
@@ -99,39 +99,7 @@ static int rmobile_pd_power_up(struct generic_pm_domain *genpd) | |||
99 | 99 | ||
100 | static bool rmobile_pd_active_wakeup(struct device *dev) | 100 | static bool rmobile_pd_active_wakeup(struct device *dev) |
101 | { | 101 | { |
102 | bool (*active_wakeup)(struct device *dev); | 102 | return true; |
103 | |||
104 | active_wakeup = dev_gpd_data(dev)->ops.active_wakeup; | ||
105 | return active_wakeup ? active_wakeup(dev) : true; | ||
106 | } | ||
107 | |||
108 | static int rmobile_pd_stop_dev(struct device *dev) | ||
109 | { | ||
110 | int (*stop)(struct device *dev); | ||
111 | |||
112 | stop = dev_gpd_data(dev)->ops.stop; | ||
113 | if (stop) { | ||
114 | int ret = stop(dev); | ||
115 | if (ret) | ||
116 | return ret; | ||
117 | } | ||
118 | return pm_clk_suspend(dev); | ||
119 | } | ||
120 | |||
121 | static int rmobile_pd_start_dev(struct device *dev) | ||
122 | { | ||
123 | int (*start)(struct device *dev); | ||
124 | int ret; | ||
125 | |||
126 | ret = pm_clk_resume(dev); | ||
127 | if (ret) | ||
128 | return ret; | ||
129 | |||
130 | start = dev_gpd_data(dev)->ops.start; | ||
131 | if (start) | ||
132 | ret = start(dev); | ||
133 | |||
134 | return ret; | ||
135 | } | 103 | } |
136 | 104 | ||
137 | static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) | 105 | static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) |
@@ -140,8 +108,8 @@ static void rmobile_init_pm_domain(struct rmobile_pm_domain *rmobile_pd) | |||
140 | struct dev_power_governor *gov = rmobile_pd->gov; | 108 | struct dev_power_governor *gov = rmobile_pd->gov; |
141 | 109 | ||
142 | pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); | 110 | pm_genpd_init(genpd, gov ? : &simple_qos_governor, false); |
143 | genpd->dev_ops.stop = rmobile_pd_stop_dev; | 111 | genpd->dev_ops.stop = pm_clk_suspend; |
144 | genpd->dev_ops.start = rmobile_pd_start_dev; | 112 | genpd->dev_ops.start = pm_clk_resume; |
145 | genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup; | 113 | genpd->dev_ops.active_wakeup = rmobile_pd_active_wakeup; |
146 | genpd->dev_irq_safe = true; | 114 | genpd->dev_irq_safe = true; |
147 | genpd->power_off = rmobile_pd_power_down; | 115 | genpd->power_off = rmobile_pd_power_down; |
diff --git a/arch/arm/mach-shmobile/setup-emev2.c b/arch/arm/mach-shmobile/setup-emev2.c index c71d667007b8..d953ff6e78a2 100644 --- a/arch/arm/mach-shmobile/setup-emev2.c +++ b/arch/arm/mach-shmobile/setup-emev2.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
22 | #include <linux/of_platform.h> | 22 | #include <linux/of_platform.h> |
23 | #include <mach/common.h> | 23 | #include <mach/common.h> |
24 | #include <mach/emev2.h> | ||
25 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
26 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
27 | #include <asm/mach/map.h> | 26 | #include <asm/mach/map.h> |
@@ -38,23 +37,19 @@ static struct map_desc emev2_io_desc[] __initdata = { | |||
38 | #endif | 37 | #endif |
39 | }; | 38 | }; |
40 | 39 | ||
41 | void __init emev2_map_io(void) | 40 | static void __init emev2_map_io(void) |
42 | { | 41 | { |
43 | iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); | 42 | iotable_init(emev2_io_desc, ARRAY_SIZE(emev2_io_desc)); |
44 | } | 43 | } |
45 | 44 | ||
46 | void __init emev2_init_delay(void) | 45 | static void __init emev2_init_delay(void) |
47 | { | 46 | { |
48 | shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ | 47 | shmobile_setup_delay(533, 1, 3); /* Cortex-A9 @ 533MHz */ |
49 | } | 48 | } |
50 | 49 | ||
51 | static void __init emev2_add_standard_devices_dt(void) | 50 | static void __init emev2_add_standard_devices_dt(void) |
52 | { | 51 | { |
53 | #ifdef CONFIG_COMMON_CLK | ||
54 | of_clk_init(NULL); | 52 | of_clk_init(NULL); |
55 | #else | ||
56 | emev2_clock_init(); | ||
57 | #endif | ||
58 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 53 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
59 | } | 54 | } |
60 | 55 | ||
@@ -63,6 +58,8 @@ static const char *emev2_boards_compat_dt[] __initconst = { | |||
63 | NULL, | 58 | NULL, |
64 | }; | 59 | }; |
65 | 60 | ||
61 | extern struct smp_operations emev2_smp_ops; | ||
62 | |||
66 | DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") | 63 | DT_MACHINE_START(EMEV2_DT, "Generic Emma Mobile EV2 (Flattened Device Tree)") |
67 | .smp = smp_ops(emev2_smp_ops), | 64 | .smp = smp_ops(emev2_smp_ops), |
68 | .map_io = emev2_map_io, | 65 | .map_io = emev2_map_io, |
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) \ | 30 | static struct resource mtu2_resources[] __initdata = { |
32 | static 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 | \ | ||
40 | static 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 | |||
48 | R7S72100_SCIF(0, 0xe8007000, gic_iid(221)); | ||
49 | R7S72100_SCIF(1, 0xe8007800, gic_iid(225)); | ||
50 | R7S72100_SCIF(2, 0xe8008000, gic_iid(229)); | ||
51 | R7S72100_SCIF(3, 0xe8008800, gic_iid(233)); | ||
52 | R7S72100_SCIF(4, 0xe8009000, gic_iid(237)); | ||
53 | R7S72100_SCIF(5, 0xe8009800, gic_iid(241)); | ||
54 | R7S72100_SCIF(6, 0xe800a000, gic_iid(245)); | ||
55 | R7S72100_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 | |||
65 | static 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 | |||
72 | static 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 | ||
84 | void __init r7s72100_add_dt_devices(void) | 41 | void __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 | ||
97 | void __init r7s72100_init_early(void) | 46 | void __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 | ||
172 | static struct sh_timer_config cmt10_platform_data = { | 172 | static 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 | ||
178 | static struct resource cmt10_resources[] = { | 176 | static 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..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)); | |||
237 | R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108)); | 237 | R8A7740_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(108)); |
238 | 238 | ||
239 | /* CMT */ | 239 | /* CMT */ |
240 | static struct sh_timer_config cmt10_platform_data = { | 240 | static 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 | ||
248 | static struct resource cmt10_resources[] = { | 244 | static 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 | ||
261 | static struct platform_device cmt10_device = { | 249 | static 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 */ |
272 | static struct sh_timer_config tmu00_platform_data = { | 260 | static 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 | ||
279 | static struct resource tmu00_resources[] = { | 264 | static 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 | ||
292 | static struct platform_device tmu00_device = { | 271 | static 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 | |||
302 | static struct sh_timer_config tmu01_platform_data = { | ||
303 | .name = "TMU01", | ||
304 | .channel_offset = 0x10, | ||
305 | .timer_bit = 1, | ||
306 | .clocksource_rating = 200, | ||
307 | }; | ||
308 | |||
309 | static 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 | |||
322 | static struct platform_device tmu01_device = { | ||
323 | .name = "sh_tmu", | ||
324 | .id = 1, | ||
325 | .dev = { | ||
326 | .platform_data = &tmu01_platform_data, | ||
327 | }, | 276 | }, |
328 | .resource = tmu01_resources, | 277 | .resource = tmu0_resources, |
329 | .num_resources = ARRAY_SIZE(tmu01_resources), | 278 | .num_resources = ARRAY_SIZE(tmu0_resources), |
330 | }; | ||
331 | |||
332 | static struct sh_timer_config tmu02_platform_data = { | ||
333 | .name = "TMU02", | ||
334 | .channel_offset = 0x1C, | ||
335 | .timer_bit = 2, | ||
336 | .clocksource_rating = 200, | ||
337 | }; | ||
338 | |||
339 | static 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 | |||
352 | static struct platform_device tmu02_device = { | ||
353 | .name = "sh_tmu", | ||
354 | .id = 2, | ||
355 | .dev = { | ||
356 | .platform_data = &tmu02_platform_data, | ||
357 | }, | ||
358 | .resource = tmu02_resources, | ||
359 | .num_resources = ARRAY_SIZE(tmu02_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 | ||
406 | static struct platform_device *r8a7740_early_devices[] __initdata = { | 325 | static 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 | ||
@@ -765,7 +682,7 @@ static struct platform_device *r8a7740_late_devices[] __initdata = { | |||
765 | * "Media RAM (MERAM)" on r8a7740 documentation | 682 | * "Media RAM (MERAM)" on r8a7740 documentation |
766 | */ | 683 | */ |
767 | #define MEBUFCNTR 0xFE950098 | 684 | #define MEBUFCNTR 0xFE950098 |
768 | void r8a7740_meram_workaround(void) | 685 | void __init r8a7740_meram_workaround(void) |
769 | { | 686 | { |
770 | void __iomem *reg; | 687 | void __iomem *reg; |
771 | 688 | ||
@@ -869,17 +786,6 @@ void __init r8a7740_add_early_devices(void) | |||
869 | 786 | ||
870 | #ifdef CONFIG_USE_OF | 787 | #ifdef CONFIG_USE_OF |
871 | 788 | ||
872 | void __init r8a7740_add_early_devices_dt(void) | ||
873 | { | ||
874 | shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ | ||
875 | |||
876 | early_platform_add_devices(r8a7740_early_devices, | ||
877 | ARRAY_SIZE(r8a7740_early_devices)); | ||
878 | |||
879 | /* setup early console here as well */ | ||
880 | shmobile_setup_console(); | ||
881 | } | ||
882 | |||
883 | void __init r8a7740_add_standard_devices_dt(void) | 789 | void __init r8a7740_add_standard_devices_dt(void) |
884 | { | 790 | { |
885 | platform_add_devices(r8a7740_devices_dt, | 791 | platform_add_devices(r8a7740_devices_dt, |
@@ -887,11 +793,6 @@ void __init r8a7740_add_standard_devices_dt(void) | |||
887 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 793 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
888 | } | 794 | } |
889 | 795 | ||
890 | void __init r8a7740_init_delay(void) | ||
891 | { | ||
892 | shmobile_setup_delay(800, 1, 3); /* Cortex-A9 @ 800MHz */ | ||
893 | }; | ||
894 | |||
895 | void __init r8a7740_init_irq_of(void) | 796 | void __init r8a7740_init_irq_of(void) |
896 | { | 797 | { |
897 | void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); | 798 | void __iomem *intc_prio_base = ioremap_nocache(0xe6900010, 0x10); |
@@ -935,9 +836,10 @@ static const char *r8a7740_boards_compat_dt[] __initdata = { | |||
935 | 836 | ||
936 | DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") | 837 | DT_MACHINE_START(R8A7740_DT, "Generic R8A7740 (Flattened Device Tree)") |
937 | .map_io = r8a7740_map_io, | 838 | .map_io = r8a7740_map_io, |
938 | .init_early = r8a7740_init_delay, | 839 | .init_early = shmobile_init_delay, |
939 | .init_irq = r8a7740_init_irq_of, | 840 | .init_irq = r8a7740_init_irq_of, |
940 | .init_machine = r8a7740_generic_init, | 841 | .init_machine = r8a7740_generic_init, |
842 | .init_late = shmobile_init_late, | ||
941 | .dt_compat = r8a7740_boards_compat_dt, | 843 | .dt_compat = r8a7740_boards_compat_dt, |
942 | MACHINE_END | 844 | MACHINE_END |
943 | 845 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7778.c b/arch/arm/mach-shmobile/setup-r8a7778.c index 6d694526e4ca..d311ef903b39 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 */ |
74 | static struct resource sh_tmu0_resources[] __initdata = { | 74 | static 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 | |||
79 | static 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 | ||
86 | static struct resource sh_tmu1_resources[] __initdata = { | 78 | static 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 | |||
91 | static 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, \ |
@@ -298,10 +285,10 @@ void __init r8a7778_add_dt_devices(void) | |||
298 | void __iomem *base = ioremap_nocache(0xf0100000, 0x1000); | 285 | void __iomem *base = ioremap_nocache(0xf0100000, 0x1000); |
299 | if (base) { | 286 | if (base) { |
300 | /* | 287 | /* |
301 | * Early BRESP enable, Shared attribute override enable, 64K*16way | 288 | * Shared attribute override enable, 64K*16way |
302 | * don't call iounmap(base) | 289 | * don't call iounmap(base) |
303 | */ | 290 | */ |
304 | l2x0_init(base, 0x40470000, 0x82000fff); | 291 | l2x0_init(base, 0x00400000, 0xc20f0fff); |
305 | } | 292 | } |
306 | #endif | 293 | #endif |
307 | 294 | ||
@@ -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..aba4ed652d54 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)); | |||
219 | R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); | 219 | R8A7779_SCIF(5, 0xffe45000, gic_iid(0x7d)); |
220 | 220 | ||
221 | /* TMU */ | 221 | /* TMU */ |
222 | static struct sh_timer_config tmu00_platform_data = { | 222 | static 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 | ||
229 | static struct resource tmu00_resources[] = { | 226 | static 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 | ||
242 | static struct platform_device tmu00_device = { | 233 | static 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 | |||
252 | static struct sh_timer_config tmu01_platform_data = { | ||
253 | .name = "TMU01", | ||
254 | .channel_offset = 0x10, | ||
255 | .timer_bit = 1, | ||
256 | .clocksource_rating = 200, | ||
257 | }; | ||
258 | |||
259 | static 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 | |||
272 | static 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 | ||
692 | static struct platform_device *r8a7779_standard_devices[] __initdata = { | 652 | static struct platform_device *r8a7779_standard_devices[] __initdata = { |
@@ -700,8 +660,8 @@ static struct platform_device *r8a7779_standard_devices[] __initdata = { | |||
700 | void __init r8a7779_add_standard_devices(void) | 660 | void __init r8a7779_add_standard_devices(void) |
701 | { | 661 | { |
702 | #ifdef CONFIG_CACHE_L2X0 | 662 | #ifdef CONFIG_CACHE_L2X0 |
703 | /* Early BRESP enable, Shared attribute override enable, 64K*16way */ | 663 | /* Shared attribute override enable, 64K*16way */ |
704 | l2x0_init(IOMEM(0xf0100000), 0x40470000, 0x82000fff); | 664 | l2x0_init(IOMEM(0xf0100000), 0x00400000, 0xc20f0fff); |
705 | #endif | 665 | #endif |
706 | r8a7779_pm_init(); | 666 | r8a7779_pm_init(); |
707 | 667 | ||
diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c index c4616f0698c6..6bd08b127fa4 100644 --- a/arch/arm/mach-shmobile/setup-r8a7790.c +++ b/arch/arm/mach-shmobile/setup-r8a7790.c | |||
@@ -185,12 +185,6 @@ void __init r8a7790_pinmux_init(void) | |||
185 | r8a7790_register_gpio(3); | 185 | r8a7790_register_gpio(3); |
186 | r8a7790_register_gpio(4); | 186 | r8a7790_register_gpio(4); |
187 | r8a7790_register_gpio(5); | 187 | r8a7790_register_gpio(5); |
188 | r8a7790_register_i2c(0); | ||
189 | r8a7790_register_i2c(1); | ||
190 | r8a7790_register_i2c(2); | ||
191 | r8a7790_register_i2c(3); | ||
192 | r8a7790_register_audio_dmac(0); | ||
193 | r8a7790_register_audio_dmac(1); | ||
194 | } | 188 | } |
195 | 189 | ||
196 | #define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \ | 190 | #define __R8A7790_SCIF(scif_type, _scscr, index, baseaddr, irq) \ |
@@ -269,20 +263,17 @@ static const struct resource thermal_resources[] __initconst = { | |||
269 | thermal_resources, \ | 263 | thermal_resources, \ |
270 | ARRAY_SIZE(thermal_resources)) | 264 | ARRAY_SIZE(thermal_resources)) |
271 | 265 | ||
272 | static const struct sh_timer_config cmt00_platform_data __initconst = { | 266 | static struct sh_timer_config cmt0_platform_data = { |
273 | .name = "CMT00", | 267 | .channels_mask = 0x60, |
274 | .timer_bit = 0, | ||
275 | .clockevent_rating = 80, | ||
276 | }; | 268 | }; |
277 | 269 | ||
278 | static const struct resource cmt00_resources[] __initconst = { | 270 | static struct resource cmt0_resources[] = { |
279 | DEFINE_RES_MEM(0xffca0510, 0x0c), | 271 | DEFINE_RES_MEM(0xffca0000, 0x1004), |
280 | DEFINE_RES_MEM(0xffca0500, 0x04), | 272 | DEFINE_RES_IRQ(gic_spi(142)), |
281 | DEFINE_RES_IRQ(gic_spi(142)), /* CMT0_0 */ | ||
282 | }; | 273 | }; |
283 | 274 | ||
284 | #define r8a7790_register_cmt(idx) \ | 275 | #define r8a7790_register_cmt(idx) \ |
285 | platform_device_register_resndata(&platform_bus, "sh_cmt", \ | 276 | platform_device_register_resndata(&platform_bus, "sh-cmt-48-gen2", \ |
286 | idx, cmt##idx##_resources, \ | 277 | idx, cmt##idx##_resources, \ |
287 | ARRAY_SIZE(cmt##idx##_resources), \ | 278 | ARRAY_SIZE(cmt##idx##_resources), \ |
288 | &cmt##idx##_platform_data, \ | 279 | &cmt##idx##_platform_data, \ |
@@ -290,6 +281,11 @@ static const struct resource cmt00_resources[] __initconst = { | |||
290 | 281 | ||
291 | void __init r8a7790_add_dt_devices(void) | 282 | void __init r8a7790_add_dt_devices(void) |
292 | { | 283 | { |
284 | r8a7790_register_cmt(0); | ||
285 | } | ||
286 | |||
287 | void __init r8a7790_add_standard_devices(void) | ||
288 | { | ||
293 | r8a7790_register_scif(0); | 289 | r8a7790_register_scif(0); |
294 | r8a7790_register_scif(1); | 290 | r8a7790_register_scif(1); |
295 | r8a7790_register_scif(2); | 291 | r8a7790_register_scif(2); |
@@ -300,14 +296,15 @@ void __init r8a7790_add_dt_devices(void) | |||
300 | r8a7790_register_scif(7); | 296 | r8a7790_register_scif(7); |
301 | r8a7790_register_scif(8); | 297 | r8a7790_register_scif(8); |
302 | r8a7790_register_scif(9); | 298 | r8a7790_register_scif(9); |
303 | r8a7790_register_cmt(00); | ||
304 | } | ||
305 | |||
306 | void __init r8a7790_add_standard_devices(void) | ||
307 | { | ||
308 | r8a7790_add_dt_devices(); | 299 | r8a7790_add_dt_devices(); |
309 | r8a7790_register_irqc(0); | 300 | r8a7790_register_irqc(0); |
310 | r8a7790_register_thermal(); | 301 | r8a7790_register_thermal(); |
302 | r8a7790_register_i2c(0); | ||
303 | r8a7790_register_i2c(1); | ||
304 | r8a7790_register_i2c(2); | ||
305 | r8a7790_register_i2c(3); | ||
306 | r8a7790_register_audio_dmac(0); | ||
307 | r8a7790_register_audio_dmac(1); | ||
311 | } | 308 | } |
312 | 309 | ||
313 | void __init r8a7790_init_early(void) | 310 | void __init r8a7790_init_early(void) |
diff --git a/arch/arm/mach-shmobile/setup-r8a7791.c b/arch/arm/mach-shmobile/setup-r8a7791.c index e28404e43860..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 | ||
131 | static const struct sh_timer_config cmt00_platform_data __initconst = { | 131 | static 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 | ||
137 | static const struct resource cmt00_resources[] __initconst = { | 135 | static 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 | ||
186 | void __init r8a7791_add_dt_devices(void) | 183 | void __init r8a7791_add_dt_devices(void) |
187 | { | 184 | { |
185 | r8a7791_register_cmt(0); | ||
186 | } | ||
187 | |||
188 | void __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,23 +202,11 @@ 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 | |||
206 | void __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(); |
211 | } | 208 | } |
212 | 209 | ||
213 | void __init r8a7791_init_early(void) | ||
214 | { | ||
215 | #ifndef CONFIG_ARM_ARCH_TIMER | ||
216 | shmobile_setup_delay(1300, 2, 4); /* Cortex-A15 @ 1300MHz */ | ||
217 | #endif | ||
218 | } | ||
219 | |||
220 | #ifdef CONFIG_USE_OF | 210 | #ifdef CONFIG_USE_OF |
221 | static const char *r8a7791_boards_compat_dt[] __initdata = { | 211 | static const char *r8a7791_boards_compat_dt[] __initdata = { |
222 | "renesas,r8a7791", | 212 | "renesas,r8a7791", |
@@ -225,7 +215,7 @@ static const char *r8a7791_boards_compat_dt[] __initdata = { | |||
225 | 215 | ||
226 | DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") | 216 | DT_MACHINE_START(R8A7791_DT, "Generic R8A7791 (Flattened Device Tree)") |
227 | .smp = smp_ops(r8a7791_smp_ops), | 217 | .smp = smp_ops(r8a7791_smp_ops), |
228 | .init_early = r8a7791_init_early, | 218 | .init_early = shmobile_init_delay, |
229 | .init_time = rcar_gen2_timer_init, | 219 | .init_time = rcar_gen2_timer_init, |
230 | .dt_compat = r8a7791_boards_compat_dt, | 220 | .dt_compat = r8a7791_boards_compat_dt, |
231 | MACHINE_END | 221 | MACHINE_END |
diff --git a/arch/arm/mach-shmobile/setup-rcar-gen2.c b/arch/arm/mach-shmobile/setup-rcar-gen2.c index 10604480f325..542c5a47173f 100644 --- a/arch/arm/mach-shmobile/setup-rcar-gen2.c +++ b/arch/arm/mach-shmobile/setup-rcar-gen2.c | |||
@@ -30,12 +30,16 @@ | |||
30 | 30 | ||
31 | u32 rcar_gen2_read_mode_pins(void) | 31 | u32 rcar_gen2_read_mode_pins(void) |
32 | { | 32 | { |
33 | void __iomem *modemr = ioremap_nocache(MODEMR, 4); | 33 | static u32 mode; |
34 | u32 mode; | 34 | static bool mode_valid; |
35 | 35 | ||
36 | BUG_ON(!modemr); | 36 | if (!mode_valid) { |
37 | mode = ioread32(modemr); | 37 | void __iomem *modemr = ioremap_nocache(MODEMR, 4); |
38 | iounmap(modemr); | 38 | BUG_ON(!modemr); |
39 | mode = ioread32(modemr); | ||
40 | iounmap(modemr); | ||
41 | mode_valid = true; | ||
42 | } | ||
39 | 43 | ||
40 | return mode; | 44 | return mode; |
41 | } | 45 | } |
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index 27301278c208..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 */ |
121 | static struct sh_timer_config cmt2_platform_data = { | 121 | static 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 | ||
129 | static struct resource cmt2_resources[] = { | 125 | static 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 | ||
142 | static struct platform_device cmt2_device = { | 130 | static 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 */ |
153 | static struct sh_timer_config tmu00_platform_data = { | 141 | static 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 | ||
160 | static struct resource tmu00_resources[] = { | 145 | static 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 | ||
173 | static struct platform_device tmu00_device = { | 152 | static 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 | |||
183 | static struct sh_timer_config tmu01_platform_data = { | ||
184 | .name = "TMU01", | ||
185 | .channel_offset = 0x10, | ||
186 | .timer_bit = 1, | ||
187 | .clocksource_rating = 200, | ||
188 | }; | ||
189 | |||
190 | static 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 | |||
203 | static 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(); |
@@ -1037,11 +984,7 @@ void __init sh7372_add_early_devices_dt(void) | |||
1037 | { | 984 | { |
1038 | shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */ | 985 | shmobile_setup_delay(800, 1, 3); /* Cortex-A8 @ 800MHz */ |
1039 | 986 | ||
1040 | early_platform_add_devices(sh7372_early_devices, | 987 | sh7372_add_early_devices(); |
1041 | ARRAY_SIZE(sh7372_early_devices)); | ||
1042 | |||
1043 | /* setup early console here as well */ | ||
1044 | shmobile_setup_console(); | ||
1045 | } | 988 | } |
1046 | 989 | ||
1047 | void __init sh7372_add_standard_devices_dt(void) | 990 | void __init sh7372_add_standard_devices_dt(void) |
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)); | |||
104 | SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143)); | 104 | SH73A0_SCIF(PORT_SCIFA, 7, 0xe6cd0000, gic_spi(143)); |
105 | SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80)); | 105 | SH73A0_SCIF(PORT_SCIFB, 8, 0xe6c30000, gic_spi(80)); |
106 | 106 | ||
107 | static struct sh_timer_config cmt10_platform_data = { | 107 | static 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 | ||
115 | static struct resource cmt10_resources[] = { | 111 | static 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 | ||
128 | static struct platform_device cmt10_device = { | 116 | static 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 */ |
139 | static struct sh_timer_config tmu00_platform_data = { | 127 | static 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 | ||
146 | static struct resource tmu00_resources[] = { | 131 | static 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 | ||
154 | static struct platform_device tmu00_device = { | 138 | static 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 | |||
164 | static struct sh_timer_config tmu01_platform_data = { | ||
165 | .name = "TMU01", | ||
166 | .channel_offset = 0x10, | ||
167 | .timer_bit = 1, | ||
168 | .clocksource_rating = 200, | ||
169 | }; | ||
170 | |||
171 | static 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 | |||
179 | static 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 | ||
189 | static struct resource i2c0_resources[] = { | 148 | static 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 | ||
752 | static struct platform_device *sh73a0_early_devices[] __initdata = { | 711 | static 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/arm/mach-shmobile/smp-emev2.c b/arch/arm/mach-shmobile/smp-emev2.c index f2ca92308f75..2dfd748da7f3 100644 --- a/arch/arm/mach-shmobile/smp-emev2.c +++ b/arch/arm/mach-shmobile/smp-emev2.c | |||
@@ -24,7 +24,6 @@ | |||
24 | #include <linux/io.h> | 24 | #include <linux/io.h> |
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <mach/common.h> | 26 | #include <mach/common.h> |
27 | #include <mach/emev2.h> | ||
28 | #include <asm/smp_plat.h> | 27 | #include <asm/smp_plat.h> |
29 | #include <asm/smp_scu.h> | 28 | #include <asm/smp_scu.h> |
30 | 29 | ||
diff --git a/arch/arm/mach-shmobile/smp-r8a7791.c b/arch/arm/mach-shmobile/smp-r8a7791.c index 2df5bd190fe4..ec979529f30f 100644 --- a/arch/arm/mach-shmobile/smp-r8a7791.c +++ b/arch/arm/mach-shmobile/smp-r8a7791.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <asm/smp_plat.h> | 20 | #include <asm/smp_plat.h> |
21 | #include <mach/common.h> | 21 | #include <mach/common.h> |
22 | #include <mach/r8a7791.h> | 22 | #include <mach/r8a7791.h> |
23 | #include <mach/rcar-gen2.h> | ||
23 | 24 | ||
24 | #define RST 0xe6160000 | 25 | #define RST 0xe6160000 |
25 | #define CA15BAR 0x0020 | 26 | #define CA15BAR 0x0020 |
@@ -51,9 +52,21 @@ static void __init r8a7791_smp_prepare_cpus(unsigned int max_cpus) | |||
51 | iounmap(p); | 52 | iounmap(p); |
52 | } | 53 | } |
53 | 54 | ||
55 | static int r8a7791_smp_boot_secondary(unsigned int cpu, | ||
56 | struct task_struct *idle) | ||
57 | { | ||
58 | /* Error out when hardware debug mode is enabled */ | ||
59 | if (rcar_gen2_read_mode_pins() & BIT(21)) { | ||
60 | pr_warn("Unable to boot CPU%u when MD21 is set\n", cpu); | ||
61 | return -ENOTSUPP; | ||
62 | } | ||
63 | |||
64 | return shmobile_smp_apmu_boot_secondary(cpu, idle); | ||
65 | } | ||
66 | |||
54 | struct smp_operations r8a7791_smp_ops __initdata = { | 67 | struct smp_operations r8a7791_smp_ops __initdata = { |
55 | .smp_prepare_cpus = r8a7791_smp_prepare_cpus, | 68 | .smp_prepare_cpus = r8a7791_smp_prepare_cpus, |
56 | .smp_boot_secondary = shmobile_smp_apmu_boot_secondary, | 69 | .smp_boot_secondary = r8a7791_smp_boot_secondary, |
57 | #ifdef CONFIG_HOTPLUG_CPU | 70 | #ifdef CONFIG_HOTPLUG_CPU |
58 | .cpu_disable = shmobile_smp_cpu_disable, | 71 | .cpu_disable = shmobile_smp_cpu_disable, |
59 | .cpu_die = shmobile_smp_apmu_cpu_die, | 72 | .cpu_die = shmobile_smp_apmu_cpu_die, |
diff --git a/arch/arm/mach-shmobile/timer.c b/arch/arm/mach-shmobile/timer.c index 62d7052d6f21..68bc0b82226d 100644 --- a/arch/arm/mach-shmobile/timer.c +++ b/arch/arm/mach-shmobile/timer.c | |||
@@ -21,6 +21,24 @@ | |||
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/clocksource.h> | 22 | #include <linux/clocksource.h> |
23 | #include <linux/delay.h> | 23 | #include <linux/delay.h> |
24 | #include <linux/of_address.h> | ||
25 | |||
26 | void __init shmobile_setup_delay_hz(unsigned int max_cpu_core_hz, | ||
27 | unsigned int mult, unsigned int div) | ||
28 | { | ||
29 | /* calculate a worst-case loops-per-jiffy value | ||
30 | * based on maximum cpu core hz setting and the | ||
31 | * __delay() implementation in arch/arm/lib/delay.S | ||
32 | * | ||
33 | * this will result in a longer delay than expected | ||
34 | * when the cpu core runs on lower frequencies. | ||
35 | */ | ||
36 | |||
37 | unsigned int value = HZ * div / mult; | ||
38 | |||
39 | if (!preset_lpj) | ||
40 | preset_lpj = max_cpu_core_hz / value; | ||
41 | } | ||
24 | 42 | ||
25 | void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, | 43 | void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, |
26 | unsigned int mult, unsigned int div) | 44 | unsigned int mult, unsigned int div) |
@@ -39,6 +57,33 @@ void __init shmobile_setup_delay(unsigned int max_cpu_core_mhz, | |||
39 | preset_lpj = max_cpu_core_mhz * value; | 57 | preset_lpj = max_cpu_core_mhz * value; |
40 | } | 58 | } |
41 | 59 | ||
60 | void __init shmobile_init_delay(void) | ||
61 | { | ||
62 | struct device_node *np, *parent; | ||
63 | u32 max_freq, freq; | ||
64 | |||
65 | max_freq = 0; | ||
66 | |||
67 | parent = of_find_node_by_path("/cpus"); | ||
68 | if (parent) { | ||
69 | for_each_child_of_node(parent, np) { | ||
70 | if (!of_property_read_u32(np, "clock-frequency", &freq)) | ||
71 | max_freq = max(max_freq, freq); | ||
72 | } | ||
73 | of_node_put(parent); | ||
74 | } | ||
75 | |||
76 | if (max_freq) { | ||
77 | if (of_find_compatible_node(NULL, NULL, "arm,cortex-a8")) | ||
78 | shmobile_setup_delay_hz(max_freq, 1, 3); | ||
79 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a9")) | ||
80 | shmobile_setup_delay_hz(max_freq, 1, 3); | ||
81 | else if (of_find_compatible_node(NULL, NULL, "arm,cortex-a15")) | ||
82 | if (!IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) | ||
83 | shmobile_setup_delay_hz(max_freq, 2, 4); | ||
84 | } | ||
85 | } | ||
86 | |||
42 | static void __init shmobile_late_time_init(void) | 87 | static void __init shmobile_late_time_init(void) |
43 | { | 88 | { |
44 | /* | 89 | /* |