Skip to contentSkip to conversation

Add support for RPMHCC for SC7180

PATCH Applied Taniya Das 3 participants 12 messages Oct 29, 2019 – Nov 8, 2019

Subsystems (4)
lore
Share & tools
lore

Taniya Das

author
#0 lore raw

v2 cover Add support for RPMHCC for SC7180

[v2]
* Fix indentation issues in YAML Documentation.

[v1]
* 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     | 49 ++++++++++++++++++++++
 drivers/clk/qcom/clk-rpmh.c                        | 19 +++++++++
 3 files changed, 68 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 v2 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     | 48 ++++++++++++++++++++++
 2 files changed, 48 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 +48 -0

48 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.

maintainer Reviewed-by on v2 1/3
#2 lore raw

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

Quoted 11 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     | 48 ++++++++++++++++++++++
 2 files changed, 48 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmh-clk.txt
 create mode 100644 Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml
maintainer Applied
#3 lore raw

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

In reply to Taniya Das

Quoting Taniya Das (2019-10-29 10:48:17)

Quoted 5 lines

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

---

Applied to clk-next

author
#4 lore raw

PATCH v2 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 f25d76f..feed637 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.

maintainer
#5 lore raw

Re: [PATCH v2 2/3] dt-bindings: clock: Introduce RPMHCC bindings for SC7180

Quoting Taniya Das (2019-10-29 10:48:18)

Quoted 13 lines

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 +0 -0
index f25d76f..feed637 100644

Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml properties: · line 23

Quoted 5 lines
Documentation/devicetree/bindings/clock/qcom,rpmhcc.yaml +1 -0
@@ -19,6 +19,7 @@ properties:
     enum:
       - qcom,sdm845-rpmh-clk
       - qcom,sm8150-rpmh-clk
+      - qcom,sc7180-rpmh-clk
 

Sort?

author
#7 lore raw

Re: [PATCH v2 2/3] dt-bindings: clock: Introduce RPMHCC bindings for SC7180

Quoted 9 lines · Stephen Boyd

Quoting Taniya Das (2019-10-29 10:48:18)

Quoted 5 lines

Add compatible for SC7180 RPMHCC.

---

Applied to clk-next + fixed the sort.

Thank you Stephen, will keep them sorted from next time.

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

--
author
#8 lore raw

PATCH v2 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 20d4258..3f3e08b 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.

maintainer
#9 lore raw

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

Quoting Taniya Das (2019-10-29 10:48:19)

Quoted 13 lines

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 +0 -0
index 20d4258..3f3e08b 100644

drivers/clk/qcom/clk-rpmh.c static const struct clk_rpmh_desc clk_rpmh_sm8150 = { · line 394

Quoted 4 lines
drivers/clk/qcom/clk-rpmh.c +1 -0
@@ -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[] = {

I don't think we need to duplicate this array either, unless somehow this driver is running on two different SoCs which seems highly unlikely.

Quoted 28 lines
drivers/clk/qcom/clk-rpmh.c +18 -0
+       [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);
maintainer
#10 lore raw

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

Quoting Stephen Boyd (2019-11-07 13:13:53)

Quoted 17 lines

Quoting Taniya Das (2019-10-29 10:48:19)

Quoted 16 lines

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 +0 -0
index 20d4258..3f3e08b 100644
@@ -391,6 +391,24 @@ static const struct clk_rpmh_desc clk_rpmh_sm8150 = {
        .num_clks = ARRAY_SIZE(sm8150_rpmh_clocks),
 };
 
Quoted 6 lines

drivers/clk/qcom/clk-rpmh.c static const struct clk_rpmh_desc clk_rpmh_sm8150 = { · line 394

Quoted 1 line
drivers/clk/qcom/clk-rpmh.c +1 -0
+static struct clk_hw *sc7180_rpmh_clocks[] = {

I don't think we need to duplicate this array either, unless somehow this driver is running on two different SoCs which seems highly unlikely.

Ah but we don't have IPA clk or RF_CLK3 on sc7180. Alright this can be revisited later.