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.
Unified · Split
| @@ -503,14 +503,14 @@ static struct clk *late_main_clks[] = { · 502 unmodified lines | ||
| 503 | 503 | &sh7372_fsidivb_clk, |
| 504 | 504 | }; |
| 505 | 505 | |
| 506 | −enum { MSTP001, | |
| 506 | +enum { MSTP001, MSTP000, | |
| 507 | 507 | MSTP131, MSTP130, |
| 508 | 508 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, |
| 509 | 509 | MSTP118, MSTP117, MSTP116, MSTP113, |
| 510 | 510 | MSTP106, MSTP101, MSTP100, |
| 511 | 511 | 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, | |
| 514 | 514 | MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, |
| 515 | 515 | MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406, |
| 516 | 516 | MSTP403, MSTP400, |
| @@ -521,6 +521,7 @@ enum { MSTP001, · 4 unmodified lines | ||
| 521 | 521 | |
| 522 | 522 | static struct clk mstp_clks[MSTP_NR] = { |
| 523 | 523 | [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ |
| 524 | + [MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */ | |
| 524 | 525 | [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ |
| 525 | 526 | [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ |
| 526 | 527 | [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ |
| @@ -540,8 +541,10 @@ static struct clk mstp_clks[MSTP_NR] = { · 13 unmodified lines | ||
| 540 | 541 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ |
| 541 | 542 | [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ |
| 542 | 543 | [MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ |
| 544 | + [MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */ | |
| 543 | 545 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
| 544 | 546 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
| 547 | + [MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */ | |
| 545 | 548 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ |
| 546 | 549 | [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ |
| 547 | 550 | [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ |
| @@ -612,6 +615,7 @@ static struct clk_lookup lookups[] = { · 64 unmodified lines | ||
| 612 | 615 | |
| 613 | 616 | /* MSTP32 clocks */ |
| 614 | 617 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ |
| 618 | + CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */ | |
| 615 | 619 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ |
| 616 | 620 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ |
| 617 | 621 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ |
| @@ -633,8 +637,10 @@ static struct clk_lookup lookups[] = { · 15 unmodified lines | ||
| 633 | 637 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ |
| 634 | 638 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ |
| 635 | 639 | CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */ |
| 640 | + CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */ | |
| 636 | 641 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
| 637 | 642 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ |
| 643 | + CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */ | |
| 638 | 644 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ |
| 639 | 645 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ |
| 640 | 646 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ |