diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/boot/dts/r8a7790.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/boot/dts/r8a7791.dtsi | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-bockw.c | 63 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch-reference.c | 86 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-koelsch.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-lager-reference.c | 79 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/board-lager.c | 29 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7778.c | 22 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7790.c | 32 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-r8a7791.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock.c | 28 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/clock.h | 16 |
13 files changed, 220 insertions, 166 deletions
diff --git a/arch/arm/boot/dts/r8a7790.dtsi b/arch/arm/boot/dts/r8a7790.dtsi index 618e5b537eaf..10b326bdf831 100644 --- a/arch/arm/boot/dts/r8a7790.dtsi +++ b/arch/arm/boot/dts/r8a7790.dtsi | |||
@@ -673,7 +673,7 @@ | |||
673 | renesas,clock-indices = < | 673 | renesas,clock-indices = < |
674 | R8A7790_CLK_TMU1 R8A7790_CLK_TMU3 R8A7790_CLK_TMU2 | 674 | R8A7790_CLK_TMU1 R8A7790_CLK_TMU3 R8A7790_CLK_TMU2 |
675 | R8A7790_CLK_CMT0 R8A7790_CLK_TMU0 R8A7790_CLK_VSP1_DU1 | 675 | R8A7790_CLK_CMT0 R8A7790_CLK_TMU0 R8A7790_CLK_VSP1_DU1 |
676 | R8A7790_CLK_VSP1_DU0 R8A7790_CLK_VSP1_RT R8A7790_CLK_VSP1_SY | 676 | R8A7790_CLK_VSP1_DU0 R8A7790_CLK_VSP1_R R8A7790_CLK_VSP1_S |
677 | >; | 677 | >; |
678 | clock-output-names = | 678 | clock-output-names = |
679 | "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1", | 679 | "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1", |
diff --git a/arch/arm/boot/dts/r8a7791.dtsi b/arch/arm/boot/dts/r8a7791.dtsi index 46181708e59c..aa1cba94196c 100644 --- a/arch/arm/boot/dts/r8a7791.dtsi +++ b/arch/arm/boot/dts/r8a7791.dtsi | |||
@@ -688,7 +688,7 @@ | |||
688 | renesas,clock-indices = < | 688 | renesas,clock-indices = < |
689 | R8A7791_CLK_TMU1 R8A7791_CLK_TMU3 R8A7791_CLK_TMU2 | 689 | R8A7791_CLK_TMU1 R8A7791_CLK_TMU3 R8A7791_CLK_TMU2 |
690 | R8A7791_CLK_CMT0 R8A7791_CLK_TMU0 R8A7791_CLK_VSP1_DU1 | 690 | R8A7791_CLK_CMT0 R8A7791_CLK_TMU0 R8A7791_CLK_VSP1_DU1 |
691 | R8A7791_CLK_VSP1_DU0 R8A7791_CLK_VSP1_SY | 691 | R8A7791_CLK_VSP1_DU0 R8A7791_CLK_VSP1_S |
692 | >; | 692 | >; |
693 | clock-output-names = | 693 | clock-output-names = |
694 | "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1", | 694 | "tmu1", "tmu3", "tmu2", "cmt0", "tmu0", "vsp1-du1", |
diff --git a/arch/arm/mach-shmobile/Makefile b/arch/arm/mach-shmobile/Makefile index 4caffc912a81..c12a1c50e9d2 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 |
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-koelsch-reference.c b/arch/arm/mach-shmobile/board-koelsch-reference.c index a3fd30242bd8..941f8b394e84 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,50 @@ 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", NULL, "sh_cmt.0" }, |
91 | static const struct clk_name { | 90 | { "scifa0", NULL, "sh-sci.0" }, |
92 | const char *clk; | 91 | { "scifa1", NULL, "sh-sci.1" }, |
93 | const char *con_id; | 92 | { "scifb0", NULL, "sh-sci.2" }, |
94 | const char *dev_id; | 93 | { "scifb1", NULL, "sh-sci.3" }, |
95 | } clk_names[] = { | 94 | { "scifb2", NULL, "sh-sci.4" }, |
96 | { "cmt0", NULL, "sh_cmt.0" }, | 95 | { "scifa2", NULL, "sh-sci.5" }, |
97 | { "scifa0", NULL, "sh-sci.0" }, | 96 | { "scif0", NULL, "sh-sci.6" }, |
98 | { "scifa1", NULL, "sh-sci.1" }, | 97 | { "scif1", NULL, "sh-sci.7" }, |
99 | { "scifb0", NULL, "sh-sci.2" }, | 98 | { "scif2", NULL, "sh-sci.8" }, |
100 | { "scifb1", NULL, "sh-sci.3" }, | 99 | { "scif3", NULL, "sh-sci.9" }, |
101 | { "scifb2", NULL, "sh-sci.4" }, | 100 | { "scif4", NULL, "sh-sci.10" }, |
102 | { "scifa2", NULL, "sh-sci.5" }, | 101 | { "scif5", NULL, "sh-sci.11" }, |
103 | { "scif0", NULL, "sh-sci.6" }, | 102 | { "scifa3", NULL, "sh-sci.12" }, |
104 | { "scif1", NULL, "sh-sci.7" }, | 103 | { "scifa4", NULL, "sh-sci.13" }, |
105 | { "scif2", NULL, "sh-sci.8" }, | 104 | { "scifa5", NULL, "sh-sci.14" }, |
106 | { "scif3", NULL, "sh-sci.9" }, | 105 | { "du0", "du.0", "rcar-du-r8a7791" }, |
107 | { "scif4", NULL, "sh-sci.10" }, | 106 | { "du1", "du.1", "rcar-du-r8a7791" }, |
108 | { "scif5", NULL, "sh-sci.11" }, | 107 | { "lvds0", "lvds.0", "rcar-du-r8a7791" }, |
109 | { "scifa3", NULL, "sh-sci.12" }, | 108 | }; |
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 | 109 | ||
119 | for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { | 110 | /* |
120 | clk = clk_get(NULL, clk_names[i].clk); | 111 | * This is a really crude hack to work around core platform clock issues |
121 | if (!IS_ERR(clk)) { | 112 | */ |
122 | clk_register_clkdev(clk, clk_names[i].con_id, | 113 | static const struct clk_name clk_enables[] __initconst = { |
123 | clk_names[i].dev_id); | 114 | { "ether", NULL, "ee700000.ethernet" }, |
124 | clk_put(clk); | 115 | { "i2c2", NULL, "e6530000.i2c" }, |
125 | } | 116 | { "msiof0", NULL, "e6e20000.spi" }, |
126 | } | 117 | { "qspi_mod", NULL, "e6b10000.spi" }, |
118 | { "sdhi0", NULL, "ee100000.sd" }, | ||
119 | { "sdhi1", NULL, "ee140000.sd" }, | ||
120 | { "sdhi2", NULL, "ee160000.sd" }, | ||
121 | { "thermal", NULL, "e61f0000.thermal" }, | ||
122 | }; | ||
127 | 123 | ||
124 | static void __init koelsch_add_standard_devices(void) | ||
125 | { | ||
126 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); | ||
127 | shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true); | ||
128 | r8a7791_add_dt_devices(); | 128 | r8a7791_add_dt_devices(); |
129 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 129 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
130 | 130 | ||
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c index 5a034ff405d0..a12a9d3b4b6e 100644 --- a/arch/arm/mach-shmobile/board-koelsch.c +++ b/arch/arm/mach-shmobile/board-koelsch.c | |||
@@ -216,7 +216,7 @@ static const struct spi_board_info spi_info[] __initconst = { | |||
216 | { | 216 | { |
217 | .modalias = "m25p80", | 217 | .modalias = "m25p80", |
218 | .platform_data = &spi_flash_data, | 218 | .platform_data = &spi_flash_data, |
219 | .mode = SPI_MODE_0, | 219 | .mode = SPI_MODE_0 | SPI_TX_QUAD | SPI_RX_QUAD, |
220 | .max_speed_hz = 30000000, | 220 | .max_speed_hz = 30000000, |
221 | .bus_num = 0, | 221 | .bus_num = 0, |
222 | .chip_select = 0, | 222 | .chip_select = 0, |
diff --git a/arch/arm/mach-shmobile/board-lager-reference.c b/arch/arm/mach-shmobile/board-lager-reference.c index 440aac36d693..1eb48cffb4c5 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,46 @@ 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", NULL, "sh_cmt.0" }, |
95 | static const struct clk_name { | 94 | { "scifa0", NULL, "sh-sci.0" }, |
96 | const char *clk; | 95 | { "scifa1", NULL, "sh-sci.1" }, |
97 | const char *con_id; | 96 | { "scifb0", NULL, "sh-sci.2" }, |
98 | const char *dev_id; | 97 | { "scifb1", NULL, "sh-sci.3" }, |
99 | } clk_names[] = { | 98 | { "scifb2", NULL, "sh-sci.4" }, |
100 | { "cmt0", NULL, "sh_cmt.0" }, | 99 | { "scifa2", NULL, "sh-sci.5" }, |
101 | { "scifa0", NULL, "sh-sci.0" }, | 100 | { "scif0", NULL, "sh-sci.6" }, |
102 | { "scifa1", NULL, "sh-sci.1" }, | 101 | { "scif1", NULL, "sh-sci.7" }, |
103 | { "scifb0", NULL, "sh-sci.2" }, | 102 | { "hscif0", NULL, "sh-sci.8" }, |
104 | { "scifb1", NULL, "sh-sci.3" }, | 103 | { "hscif1", NULL, "sh-sci.9" }, |
105 | { "scifb2", NULL, "sh-sci.4" }, | 104 | { "du0", "du.0", "rcar-du-r8a7790" }, |
106 | { "scifa2", NULL, "sh-sci.5" }, | 105 | { "du1", "du.1", "rcar-du-r8a7790" }, |
107 | { "scif0", NULL, "sh-sci.6" }, | 106 | { "du2", "du.2", "rcar-du-r8a7790" }, |
108 | { "scif1", NULL, "sh-sci.7" }, | 107 | { "lvds0", "lvds.0", "rcar-du-r8a7790" }, |
109 | { "hscif0", NULL, "sh-sci.8" }, | 108 | { "lvds1", "lvds.1", "rcar-du-r8a7790" }, |
110 | { "hscif1", NULL, "sh-sci.9" }, | 109 | }; |
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 | 110 | ||
120 | for (i = 0; i < ARRAY_SIZE(clk_names); ++i) { | 111 | /* |
121 | clk = clk_get(NULL, clk_names[i].clk); | 112 | * This is a really crude hack to work around core platform clock issues |
122 | if (!IS_ERR(clk)) { | 113 | */ |
123 | clk_register_clkdev(clk, clk_names[i].con_id, | 114 | static const struct clk_name clk_enables[] __initconst = { |
124 | clk_names[i].dev_id); | 115 | { "ether", NULL, "ee700000.ethernet" }, |
125 | clk_put(clk); | 116 | { "msiof1", NULL, "e6e10000.spi" }, |
126 | } | 117 | { "mmcif1", NULL, "ee220000.mmc" }, |
127 | } | 118 | { "qspi_mod", NULL, "e6b10000.spi" }, |
119 | { "sdhi0", NULL, "ee100000.sd" }, | ||
120 | { "sdhi2", NULL, "ee140000.sd" }, | ||
121 | { "thermal", NULL, "e61f0000.thermal" }, | ||
122 | }; | ||
128 | 123 | ||
124 | static void __init lager_add_standard_devices(void) | ||
125 | { | ||
126 | shmobile_clk_workaround(clk_names, ARRAY_SIZE(clk_names), false); | ||
127 | shmobile_clk_workaround(clk_enables, ARRAY_SIZE(clk_enables), true); | ||
129 | r8a7790_add_dt_devices(); | 128 | r8a7790_add_dt_devices(); |
130 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | 129 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); |
131 | 130 | ||
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-r8a7778.c b/arch/arm/mach-shmobile/clock-r8a7778.c index 9989b1b06ffd..6609beb9b9b4 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 | ||
@@ -234,15 +230,15 @@ static struct clk_lookup lookups[] = { | |||
234 | CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]), | 230 | CLKDEV_ICK_ID("ssi.6", "rcar_sound", &mstp_clks[MSTP309]), |
235 | CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]), | 231 | CLKDEV_ICK_ID("ssi.7", "rcar_sound", &mstp_clks[MSTP308]), |
236 | CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]), | 232 | CLKDEV_ICK_ID("ssi.8", "rcar_sound", &mstp_clks[MSTP307]), |
237 | CLKDEV_ICK_ID("scu.0", "rcar_sound", &mstp_clks[MSTP531]), | 233 | CLKDEV_ICK_ID("src.0", "rcar_sound", &mstp_clks[MSTP531]), |
238 | CLKDEV_ICK_ID("scu.1", "rcar_sound", &mstp_clks[MSTP530]), | 234 | CLKDEV_ICK_ID("src.1", "rcar_sound", &mstp_clks[MSTP530]), |
239 | CLKDEV_ICK_ID("scu.2", "rcar_sound", &mstp_clks[MSTP529]), | 235 | CLKDEV_ICK_ID("src.2", "rcar_sound", &mstp_clks[MSTP529]), |
240 | CLKDEV_ICK_ID("scu.3", "rcar_sound", &mstp_clks[MSTP528]), | 236 | CLKDEV_ICK_ID("src.3", "rcar_sound", &mstp_clks[MSTP528]), |
241 | CLKDEV_ICK_ID("scu.4", "rcar_sound", &mstp_clks[MSTP527]), | 237 | CLKDEV_ICK_ID("src.4", "rcar_sound", &mstp_clks[MSTP527]), |
242 | CLKDEV_ICK_ID("scu.5", "rcar_sound", &mstp_clks[MSTP526]), | 238 | CLKDEV_ICK_ID("src.5", "rcar_sound", &mstp_clks[MSTP526]), |
243 | CLKDEV_ICK_ID("scu.6", "rcar_sound", &mstp_clks[MSTP525]), | 239 | CLKDEV_ICK_ID("src.6", "rcar_sound", &mstp_clks[MSTP525]), |
244 | CLKDEV_ICK_ID("scu.7", "rcar_sound", &mstp_clks[MSTP524]), | 240 | CLKDEV_ICK_ID("src.7", "rcar_sound", &mstp_clks[MSTP524]), |
245 | CLKDEV_ICK_ID("scu.8", "rcar_sound", &mstp_clks[MSTP523]), | 241 | CLKDEV_ICK_ID("src.8", "rcar_sound", &mstp_clks[MSTP523]), |
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-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c index 3f93503f5b96..a936ae7de083 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), |
@@ -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..3b26c7eee873 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 */ |
@@ -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.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..9a93cf924b9c 100644 --- a/arch/arm/mach-shmobile/include/mach/clock.h +++ b/arch/arm/mach-shmobile/include/mach/clock.h | |||
@@ -1,6 +1,21 @@ | |||
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 | |||
4 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk); | 19 | unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk); |
5 | extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops; | 20 | extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops; |
6 | 21 | ||
@@ -36,4 +51,5 @@ do { \ | |||
36 | (p)->div = d; \ | 51 | (p)->div = d; \ |
37 | } while (0) | 52 | } while (0) |
38 | 53 | ||
54 | #endif /* CONFIG_COMMON_CLK */ | ||
39 | #endif | 55 | #endif |