Skip to contentSkip to conversation

Add support for RPMHCC for SC7180

PATCH Superseded Taniya Das 3 participants 8 messages Oct 18, 2019 – Oct 29, 2019

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Taniya Das

author
#0 lore raw

cover Add support for RPMHCC for SC7180

Update the Documentation binding of RPMHCC to YAML schemas. Add RPMH clocks required to be supported on SC7180.

Taniya Das (3):
dt-bindings: clock: Add YAML schemas for the QCOM RPMHCC clock
bindings
dt-bindings: clock: Introduce RPMHCC bindings for SC7180
clk: qcom: clk-rpmh: Add support for RPMHCC for SC7180

 .../devicetree/bindings/clock/qcom,rpmh-clk.txt    | 27 ------------
 .../devicetree/bindings/clock/qcom,rpmhcc.yaml     | 50 ++++++++++++++++++++
 drivers/clk/qcom/clk-rpmh.c                        | 19 ++++++++
 3 files changed, 69 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#1 lore raw

PATCH 1/3 dt-bindings: clock: Add YAML schemas for the QCOM RPMHCC clock bindings

The RPMHCC clock provider have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.

---
 .../devicetree/bindings/clock/qcom,rpmh-clk.txt    | 27 ------------
 .../devicetree/bindings/clock/qcom,rpmhcc.yaml     | 49 ++++++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml
Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt deleted +0 -27
deleted file mode 100644
index 365bbde..0000000
@@ -1,27 +0,0 @@
-Qualcomm Technologies, Inc. RPMh Clocks
--------------------------------------------------------
-
-Resource Power Manager Hardened (RPMh) manages shared resources on
-some Qualcomm Technologies Inc. SoCs. It accepts clock requests from
-other hardware subsystems via RSC to control clocks.
-
-Required properties :
-- compatible : must be one of:
-	       "qcom,sdm845-rpmh-clk"
-	       "qcom,sm8150-rpmh-clk"
-
-- #clock-cells : must contain 1
-- clocks: a list of phandles and clock-specifier pairs,
-	  one for each entry in clock-names.
-- clock-names: Parent board clock: "xo".
-
-Example :
-
-#include <dt-bindings/clock/qcom,rpmh.h>
-
-	&apps_rsc {
-		rpmhcc: clock-controller {
-			compatible = "qcom,sdm845-rpmh-clk";
-			#clock-cells = <1>;
-		};
-	};
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +49 -0

49 lines not on this page · raw message

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#4 lore raw

PATCH 2/3 dt-bindings: clock: Introduce RPMHCC bindings for SC7180

In reply to Taniya Das

Add compatible for SC7180 RPMHCC.

---
 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml +1 -0
index 326bfd7..e325c6e 100644
@@ -19,6 +19,7 @@ properties:
     enum:
        - qcom,sdm845-rpmh-clk
        - qcom,sm8150-rpmh-clk
+       - qcom,sc7180-rpmh-clk
 
   clocks:
     maxItems: 1

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#6 lore raw

PATCH 3/3 clk: qcom: clk-rpmh: Add support for RPMHCC for SC7180

In reply to Taniya Das

Add support for clock RPMh driver to vote for ARC and VRM managed clock resources.

---
 drivers/clk/qcom/clk-rpmh.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/clk/qcom/clk-rpmh.c +19 -0
index 96a36f6..7301c77 100644
@@ -391,6 +391,24 @@ static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
 	.num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
 };
 
+static struct clk_hw *sc7180_rpmh_clocks[] = {
+	[RPMH_CXO_CLK]		= &sdm845_bi_tcxo.hw,
+	[RPMH_CXO_CLK_A]	= &sdm845_bi_tcxo_ao.hw,
+	[RPMH_LN_BB_CLK2]	= &sdm845_ln_bb_clk2.hw,
+	[RPMH_LN_BB_CLK2_A]	= &sdm845_ln_bb_clk2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &sdm845_ln_bb_clk3.hw,
+	[RPMH_LN_BB_CLK3_A]	= &sdm845_ln_bb_clk3_ao.hw,
+	[RPMH_RF_CLK1]		= &sdm845_rf_clk1.hw,
+	[RPMH_RF_CLK1_A]	= &sdm845_rf_clk1_ao.hw,
+	[RPMH_RF_CLK2]		= &sdm845_rf_clk2.hw,
+	[RPMH_RF_CLK2_A]	= &sdm845_rf_clk2_ao.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sc7180 = {
+	.clks = sc7180_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sc7180_rpmh_clocks),
+};
+
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {
@@ -471,6 +489,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)
 static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
 	{ .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
+	{ .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},
 	{ }
 };
 MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);

--
Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

#7 lore raw

Re: [PATCH v1 3/3] clk: qcom: clk-rpmh: Add support for RPMHCC for SC7180

Quoted 38 lines · Taniya Das

Add support for clock RPMh driver to vote for ARC and VRM managed clock resources.

---
 drivers/clk/qcom/clk-rpmh.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)
drivers/clk/qcom/clk-rpmh.c +18 -0
index 96a36f6..7301c77 100644
@@ -391,6 +391,24 @@ static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
 	.num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
 };
 
+static struct clk_hw *sc7180_rpmh_clocks[] = {
+	[RPMH_CXO_CLK]		= &sdm845_bi_tcxo.hw,
+	[RPMH_CXO_CLK_A]	= &sdm845_bi_tcxo_ao.hw,
+	[RPMH_LN_BB_CLK2]	= &sdm845_ln_bb_clk2.hw,
+	[RPMH_LN_BB_CLK2_A]	= &sdm845_ln_bb_clk2_ao.hw,
+	[RPMH_LN_BB_CLK3]	= &sdm845_ln_bb_clk3.hw,
+	[RPMH_LN_BB_CLK3_A]	= &sdm845_ln_bb_clk3_ao.hw,
+	[RPMH_RF_CLK1]		= &sdm845_rf_clk1.hw,
+	[RPMH_RF_CLK1_A]	= &sdm845_rf_clk1_ao.hw,
+	[RPMH_RF_CLK2]		= &sdm845_rf_clk2.hw,
+	[RPMH_RF_CLK2_A]	= &sdm845_rf_clk2_ao.hw,
+};
+
+static const struct clk_rpmh_desc clk_rpmh_sc7180 = {
+	.clks = sc7180_rpmh_clocks,
+	.num_clks = ARRAY_SIZE(sc7180_rpmh_clocks),
+};
+
 static struct clk_hw *of_clk_rpmh_hw_get(struct of_phandle_args *clkspec,
 					 void *data)
 {

drivers/clk/qcom/clk-rpmh.c static int clk_rpmh_probe(struct platform_device *pdev) · line 492

Quoted 4 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
@@ -471,6 +489,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)
 static const struct of_device_id clk_rpmh_match_table[] = {
 	{ .compatible = "qcom,sdm845-rpmh-clk", .data = &clk_rpmh_sdm845},
 	{ .compatible = "qcom,sm8150-rpmh-clk", .data = &clk_rpmh_sm8150},
+	{ .compatible = "qcom,sc7180-rpmh-clk", .data = &clk_rpmh_sc7180},

Is the table above not same as sm8150, if so cant we reuse that for sc7180?

Quoted 6 lines
drivers/clk/qcom/clk-rpmh.c +0 -1
 	{ }
 };
 MODULE_DEVICE_TABLE(of, clk_rpmh_match_table);
--

Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

Signature · 1 line
~Vinod
maintainer
#2 lore raw

Re: [PATCH v1 1/3] dt-bindings: clock: Add YAML schemas for the QCOM RPMHCC clock bindings

In reply to Taniya Das
Quoted 58 lines · Taniya Das

The RPMHCC clock provider have a bunch of generic properties that are needed in a device tree. Add a YAML schemas for those.

---
 .../devicetree/bindings/clock/qcom,rpmh-clk.txt    | 27 ------------
 .../devicetree/bindings/clock/qcom,rpmhcc.yaml     | 49 ++++++++++++++++++++++
 2 files changed, 49 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml
Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt deleted +0 -27
deleted file mode 100644
index 365bbde..0000000
@@ -1,27 +0,0 @@
-Qualcomm Technologies, Inc. RPMh Clocks
--------------------------------------------------------
-
-Resource Power Manager Hardened (RPMh) manages shared resources on
-some Qualcomm Technologies Inc. SoCs. It accepts clock requests from
-other hardware subsystems via RSC to control clocks.
-
-Required properties :
-- compatible : must be one of:
-	       "qcom,sdm845-rpmh-clk"
-	       "qcom,sm8150-rpmh-clk"
-
-- #clock-cells : must contain 1
-- clocks: a list of phandles and clock-specifier pairs,
-	  one for each entry in clock-names.
-- clock-names: Parent board clock: "xo".
-
-Example :
-
-#include <dt-bindings/clock/qcom,rpmh.h>
-
-	&apps_rsc {
-		rpmhcc: clock-controller {
-			compatible = "qcom,sdm845-rpmh-clk";
-			#clock-cells = <1>;
-		};
-	};
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +8 -0
new file mode 100644
index 0000000..326bfd7
@@ -0,0 +1,49 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/bindings/clock/qcom,rpmhcc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm Technologies, Inc. RPMh Clocks Bindings
+

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 18

Quoted 10 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +10 -0
+maintainers:
+  - Taniya Das <[email protected]>
+
+description: |
+  Resource Power Manager Hardened (RPMh) manages shared resources on
+  some Qualcomm Technologies Inc. SoCs. It accepts clock requests from
+  other hardware subsystems via RSC to control clocks.
+
+properties:
+  compatible :

drop space ^

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 21

Quoted 3 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +3 -0
+    enum:
+       - qcom,sdm845-rpmh-clk
+       - qcom,sm8150-rpmh-clk

Wrong indent (1 char too many).

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 27

Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +6 -0
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    maxItems: 1

Can drop this. Implied by items list.

Quoted 26 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +22 -1
+    items:
+      - const: xo
+
+  '#clock-cells':
+      const: 1
+
+required:
+  - compatible
+  - '#clock-cells'
+
+examples:
+  # Example for GCC for SDM845: The below node should be defined inside
+  # &apps_rsc node.
+  - |
+    #include <dt-bindings/clock/qcom,rpmh.h>
+    rpmhcc: clock-controller {
+      compatible = "qcom,sdm845-rpmh-clk";
+      clocks = <&xo_board>;
+      clock-names = "xo";
+      #clock-cells = <1>;
+    };
+...
--

Qualcomm INDIA, on behalf of Qualcomm Innovation Center, Inc.is a member of the Code Aurora Forum, hosted by the Linux Foundation.

author
#3 lore raw

Re: [PATCH v1 1/3] dt-bindings: clock: Add YAML schemas for the QCOM RPMHCC clock bindings

In reply to Rob Herring

Hello Rob,

Thanks for the review. I will fix the below in the next patch.

Quoted 17 lines · Rob Herring

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 18

Quoted 2 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +2 -0
+properties:
+  compatible :

drop space ^

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 21

Quoted 3 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +3 -0
+    enum:
+       - qcom,sdm845-rpmh-clk
+       - qcom,sm8150-rpmh-clk

Wrong indent (1 char too many).

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml line 27

Quoted 6 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml new file +6 -0
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    maxItems: 1

Can drop this. Implied by items list.

Signature · 4 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation.

--