aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert+renesas@glider.be>2015-08-04 08:28:06 -0400
committerSimon Horman <horms+renesas@verge.net.au>2015-08-11 21:31:28 -0400
commitf04b486d34ac6bab2aaa3988ee098b2bad3950de (patch)
treee28e2db706b841737edacab2c30740e4f23d6cab
parent63e05d9365dc25ae71bdde436b27c49daedf1977 (diff)
clk: shmobile: rz: Add CPG/MSTP Clock Domain support
Add Clock Domain support to the RZ Clock Pulse Generator (CPG) driver using the generic PM Domain. This allows to power-manage the module clocks of SoC devices that are part of the CPG/MSTP Clock Domain using Runtime PM, or for system suspend/resume. SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed through an MSTP clock should be tagged in DT with a proper "power-domains" property. Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
-rw-r--r--Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt29
-rw-r--r--arch/arm/mach-shmobile/Kconfig1
-rw-r--r--drivers/clk/shmobile/clk-rz.c3
3 files changed, 31 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt b/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
index b0f7ddb8cdb1..bb51a33a1fbf 100644
--- a/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
+++ b/Documentation/devicetree/bindings/clock/renesas,rz-cpg-clocks.txt
@@ -2,6 +2,8 @@
2 2
3The CPG generates core clocks for the RZ SoCs. It includes the PLL, variable 3The CPG generates core clocks for the RZ SoCs. It includes the PLL, variable
4CPU and GPU clocks, and several fixed ratio dividers. 4CPU and GPU clocks, and several fixed ratio dividers.
5The CPG also provides a Clock Domain for SoC devices, in combination with the
6CPG Module Stop (MSTP) Clocks.
5 7
6Required Properties: 8Required Properties:
7 9
@@ -14,10 +16,18 @@ Required Properties:
14 - #clock-cells: Must be 1 16 - #clock-cells: Must be 1
15 - clock-output-names: The names of the clocks. Supported clocks are "pll", 17 - clock-output-names: The names of the clocks. Supported clocks are "pll",
16 "i", and "g" 18 "i", and "g"
19 - #power-domain-cells: Must be 0
17 20
21SoC devices that are part of the CPG/MSTP Clock Domain and can be power-managed
22through an MSTP clock should refer to the CPG device node in their
23"power-domains" property, as documented by the generic PM domain bindings in
24Documentation/devicetree/bindings/power/power_domain.txt.
18 25
19Example 26
20------- 27Examples
28--------
29
30 - CPG device node:
21 31
22 cpg_clocks: cpg_clocks@fcfe0000 { 32 cpg_clocks: cpg_clocks@fcfe0000 {
23 #clock-cells = <1>; 33 #clock-cells = <1>;
@@ -26,4 +36,19 @@ Example
26 reg = <0xfcfe0000 0x18>; 36 reg = <0xfcfe0000 0x18>;
27 clocks = <&extal_clk>, <&usb_x1_clk>; 37 clocks = <&extal_clk>, <&usb_x1_clk>;
28 clock-output-names = "pll", "i", "g"; 38 clock-output-names = "pll", "i", "g";
39 #power-domain-cells = <0>;
40 };
41
42
43 - CPG/MSTP Clock Domain member device node:
44
45 mtu2: timer@fcff0000 {
46 compatible = "renesas,mtu2-r7s72100", "renesas,mtu2";
47 reg = <0xfcff0000 0x400>;
48 interrupts = <0 107 IRQ_TYPE_LEVEL_HIGH>;
49 interrupt-names = "tgi0a";
50 clocks = <&mstp3_clks R7S72100_CLK_MTU2>;
51 clock-names = "fck";
52 power-domains = <&cpg_clocks>;
53 status = "disabled";
29 }; 54 };
diff --git a/arch/arm/mach-shmobile/Kconfig b/arch/arm/mach-shmobile/Kconfig
index e14fa5e87475..34eac88a9889 100644
--- a/arch/arm/mach-shmobile/Kconfig
+++ b/arch/arm/mach-shmobile/Kconfig
@@ -51,6 +51,7 @@ config ARCH_EMEV2
51 51
52config ARCH_R7S72100 52config ARCH_R7S72100
53 bool "RZ/A1H (R7S72100)" 53 bool "RZ/A1H (R7S72100)"
54 select PM_GENERIC_DOMAINS if PM
54 select SYS_SUPPORTS_SH_MTU2 55 select SYS_SUPPORTS_SH_MTU2
55 56
56config ARCH_R8A73A4 57config ARCH_R8A73A4
diff --git a/drivers/clk/shmobile/clk-rz.c b/drivers/clk/shmobile/clk-rz.c
index 7e68e8630962..9766e3cb595f 100644
--- a/drivers/clk/shmobile/clk-rz.c
+++ b/drivers/clk/shmobile/clk-rz.c
@@ -10,6 +10,7 @@
10 */ 10 */
11 11
12#include <linux/clk-provider.h> 12#include <linux/clk-provider.h>
13#include <linux/clk/shmobile.h>
13#include <linux/init.h> 14#include <linux/init.h>
14#include <linux/kernel.h> 15#include <linux/kernel.h>
15#include <linux/of.h> 16#include <linux/of.h>
@@ -99,5 +100,7 @@ static void __init rz_cpg_clocks_init(struct device_node *np)
99 } 100 }
100 101
101 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data); 102 of_clk_add_provider(np, of_clk_src_onecell_get, &cpg->data);
103
104 cpg_mstp_add_clk_domain(np);
102} 105}
103CLK_OF_DECLARE(rz_cpg_clks, "renesas,rz-cpg-clocks", rz_cpg_clocks_init); 106CLK_OF_DECLARE(rz_cpg_clks, "renesas,rz-cpg-clocks", rz_cpg_clocks_init);