Skip to content

Commit 7ceb666

Browse files
Magnus Dammpmundt
authored andcommitted
ARM: mach-shmobile: sh7372 MSIOF clock support
Add clock control support for sh7372 MSIOF hardware blocks. No upstream sh7372 boards are making use of MSIOF0->2, but the sh7372 hardware happens to come out of reset with all MSIOF MSTP clocks _enabled_, so to save power we need to implement a fix in software to shut down unused clocks. This patch relies on the recently merged 794d78f drivers: sh: late disabling of clocks V2 to make sure the unused clocks get disabled as expected. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
1 parent 6b4cb8f commit 7ceb666

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎arch/arm/mach-shmobile/clock-sh7372.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -503,14 +503,14 @@ static struct clk *late_main_clks[] = {
503503
&sh7372_fsidivb_clk,
504504
};
505505

506-
enum { MSTP001,
506+
enum { MSTP001, MSTP000,
507507
MSTP131, MSTP130,
508508
MSTP129, MSTP128, MSTP127, MSTP126, MSTP125,
509509
MSTP118, MSTP117, MSTP116, MSTP113,
510510
MSTP106, MSTP101, MSTP100,
511511
MSTP223,
512-
MSTP214, MSTP218, MSTP217, MSTP216,
513-
MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
512+
MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207,
513+
MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200,
514514
MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312,
515515
MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406,
516516
MSTP403, MSTP400,
@@ -521,6 +521,7 @@ enum { MSTP001,
521521

522522
static struct clk mstp_clks[MSTP_NR] = {
523523
[MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */
524+
[MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */
524525
[MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */
525526
[MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */
526527
[MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */
@@ -540,8 +541,10 @@ static struct clk mstp_clks[MSTP_NR] = {
540541
[MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */
541542
[MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */
542543
[MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */
544+
[MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */
543545
[MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */
544546
[MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */
547+
[MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */
545548
[MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */
546549
[MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */
547550
[MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */
@@ -612,6 +615,7 @@ static struct clk_lookup lookups[] = {
612615

613616
/* MSTP32 clocks */
614617
CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */
618+
CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */
615619
CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */
616620
CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */
617621
CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */
@@ -633,8 +637,10 @@ static struct clk_lookup lookups[] = {
633637
CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */
634638
CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */
635639
CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */
640+
CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */
636641
CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */
637642
CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */
643+
CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */
638644
CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */
639645
CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */
640646
CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */

0 commit comments

Comments
 (0)