Skip to contentSkip to conversation

Add XO clocks for MSM8226/MSM8974

PATCH Applied Rayyan Ansari 5 participants 12 messages Jan 21, 2023 – Mar 16, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v4 cover Add XO clocks for MSM8226/MSM8974

Changes since v3:
- Put the rpmcc.h include back in

Rayyan Ansari (3):
clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974
ARM: dts: qcom: msm8226: add clocks and clock-names to GCC node
ARM: dts: qcom: msm8974: add correct XO clock source to GCC node

 arch/arm/boot/dts/qcom-msm8226.dtsi | 6 ++++++
 arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +-
 drivers/clk/qcom/clk-smd-rpm.c      | 2 ++
 3 files changed, 9 insertions(+), 1 deletion(-)
Signature · 1 line
2.39.0
#1 lore raw

PATCH v4 1/3 clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

---
 drivers/clk/qcom/clk-smd-rpm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/qcom/clk-smd-rpm.c +2 -0
index 6f23ca4828f4..31f6de13d156 100644
@@ -610,6 +610,8 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8936 = {
 };
 
 static struct clk_smd_rpm *msm8974_clks[] = {
+	[RPM_SMD_XO_CLK_SRC]		= &clk_smd_rpm_branch_bi_tcxo,
+	[RPM_SMD_XO_A_CLK_SRC]		= &clk_smd_rpm_branch_bi_tcxo_a,
 	[RPM_SMD_PNOC_CLK]		= &clk_smd_rpm_bus_0_pcnoc_clk,
 	[RPM_SMD_PNOC_A_CLK]		= &clk_smd_rpm_bus_0_pcnoc_a_clk,
 	[RPM_SMD_SNOC_CLK]		= &clk_smd_rpm_bus_1_snoc_clk,
Signature · 1 line
2.39.0
Reviewed-by on v4 1/3
#2 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Quoted 5 lines · Rayyan Ansari

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

---

Konrad

Quoted 16 lines
 drivers/clk/qcom/clk-smd-rpm.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/clk/qcom/clk-smd-rpm.c +2 -0
index 6f23ca4828f4..31f6de13d156 100644
@@ -610,6 +610,8 @@ static const struct rpm_smd_clk_desc rpm_clk_msm8936 = {
 };
 
 static struct clk_smd_rpm *msm8974_clks[] = {
+	[RPM_SMD_XO_CLK_SRC]		= &clk_smd_rpm_branch_bi_tcxo,
+	[RPM_SMD_XO_A_CLK_SRC]		= &clk_smd_rpm_branch_bi_tcxo_a,
 	[RPM_SMD_PNOC_CLK]		= &clk_smd_rpm_bus_0_pcnoc_clk,
 	[RPM_SMD_PNOC_A_CLK]		= &clk_smd_rpm_bus_0_pcnoc_a_clk,
 	[RPM_SMD_SNOC_CLK]		= &clk_smd_rpm_bus_1_snoc_clk,
maintainer
#3 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

In reply to Rayyan Ansari

Quoting Rayyan Ansari (2023-01-21 11:25:38)

Quoted 2 lines

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

Why was this missing for so long? Does this break suspend? Why are you adding it now?

#4 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Quoted 6 lines · Stephen Boyd

Quoting Rayyan Ansari (2023-01-21 11:25:38)

Quoted 2 lines

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

Why was this missing for so long? Does this break suspend? Why are you adding it now?

I am adding it because of a recommendation from a maintainer on an older patch version. See https://lore.kernel.org/linux-arm-msm/[email protected]/#t

maintainer
#5 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Quoting Rayyan Ansari (2023-01-25 14:25:08)

Quoted 5 lines · Stephen Boyd
Quoted 4 lines

Quoting Rayyan Ansari (2023-01-21 11:25:38)

Quoted 2 lines

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

Quoted 7 lines
Quoted 2 lines

Why was this missing for so long? Does this break suspend? Why are you adding it now?

I am adding it because of a recommendation from a maintainer on an older patch version.
See
https://lore.kernel.org/linux-arm-msm/[email protected]/#t

So nobody has tested this on msm8974? Can you add this information to the commit text? And can it be tested on msm8974?

#6 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Quoted 9 lines · Stephen Boyd

Quoting Rayyan Ansari (2023-01-25 14:25:08)

Quoted 8 lines · Stephen Boyd
Quoted 6 lines

Quoting Rayyan Ansari (2023-01-21 11:25:38)

Quoted 2 lines

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

Why was this missing for so long? Does this break suspend? Why are you adding it now?

Quoted 7 lines
Quoted 4 lines

I am adding it because of a recommendation from a maintainer on an older patch version.
See
https://lore.kernel.org/linux-arm-msm/[email protected]/#t

So nobody has tested this on msm8974? Can you add this information to the commit text?

And can it be tested on msm8974?
+ Luca

^ could you, please?

Konrad

Tested-by
#7 lore raw

Re: [PATCH v4 1/3] clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974

Hi,

Checking clk_summary in debugfs it looks fine on msn8974pro-fairphone-fp2

Regards
Luca

Konrad Dybcio <[email protected]> schreef op 26 januari 2023 00:33:42 CET:

Quoted 27 lines · Stephen Boyd
Quoted 9 lines

Quoting Rayyan Ansari (2023-01-25 14:25:08)

Quoted 8 lines · Stephen Boyd
Quoted 6 lines

Quoting Rayyan Ansari (2023-01-21 11:25:38)

Quoted 2 lines

Add the XO and XO_A clocks to the MSM8974 clock list, which is also used on MSM8226.

Why was this missing for so long? Does this break suspend? Why are you adding it now?

Quoted 7 lines
Quoted 4 lines

I am adding it because of a recommendation from a maintainer on an older patch version.
See
https://lore.kernel.org/linux-arm-msm/[email protected]/#t

So nobody has tested this on msm8974? Can you add this information to the commit text?

And can it be tested on msm8974?
+ Luca

^ could you, please?

Konrad

#8 lore raw

PATCH v4 2/3 ARM: dts: qcom: msm8226: add clocks and clock-names to GCC node

In reply to Rayyan Ansari

Add the XO and Sleep Clock sources to the GCC node on MSM8226.

---
 arch/arm/boot/dts/qcom-msm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/qcom-msm8226.dtsi +6 -0
index c373081bc21b..42acb9ddb8cc 100644
@@ -8,6 +8,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
 #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
+#include <dt-bindings/clock/qcom,rpmcc.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/reset/qcom,gcc-msm8974.h>
@@ -377,6 +378,11 @@ gcc: clock-controller@fc400000 {
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;
+
+			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>,
+				 <&sleep_clk>;
+			clock-names = "xo",
+				      "sleep_clk";
 		};
 
 		mmcc: clock-controller@fd8c0000 {
Signature · 1 line
2.39.0
Reviewed-by on v4 2/3
#9 lore raw

Re: [PATCH v4 2/3] ARM: dts: qcom: msm8226: add clocks and clock-names to GCC node

Quoted 4 lines · Rayyan Ansari

Add the XO and Sleep Clock sources to the GCC node on MSM8226.

---

Konrad

Quoted 27 lines
 arch/arm/boot/dts/qcom-msm8226.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/boot/dts/qcom-msm8226.dtsi +6 -0
index c373081bc21b..42acb9ddb8cc 100644
@@ -8,6 +8,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/clock/qcom,gcc-msm8974.h>
 #include <dt-bindings/clock/qcom,mmcc-msm8974.h>
+#include <dt-bindings/clock/qcom,rpmcc.h>
 #include <dt-bindings/gpio/gpio.h>
 #include <dt-bindings/power/qcom-rpmpd.h>
 #include <dt-bindings/reset/qcom,gcc-msm8974.h>
@@ -377,6 +378,11 @@ gcc: clock-controller@fc400000 {
 			#clock-cells = <1>;
 			#reset-cells = <1>;
 			#power-domain-cells = <1>;
+
+			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>,
+				 <&sleep_clk>;
+			clock-names = "xo",
+				      "sleep_clk";
 		};
 
 		mmcc: clock-controller@fd8c0000 {
#10 lore raw

PATCH v4 3/3 ARM: dts: qcom: msm8974: add correct XO clock source to GCC node

In reply to Rayyan Ansari

Change the XO clock in MSM8974's GCC node to point to RPMCC.

---
 arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-msm8974.dtsi +1 -1
index 834ad95515b1..31e9721b571d 100644
@@ -1057,7 +1057,7 @@ gcc: clock-controller@fc400000 {
 			#power-domain-cells = <1>;
 			reg = <0xfc400000 0x4000>;
 
-			clocks = <&xo_board>,
+			clocks = <&rpmcc RPM_SMD_XO_CLK_SRC>,
 				 <&sleep_clk>;
 			clock-names = "xo",
 				      "sleep_clk";
Signature · 1 line
2.39.0
maintainer Applied
#11 lore raw

Re: (subset) [PATCH v4 0/3] Add XO clocks for MSM8226/MSM8974

In reply to Rayyan Ansari
Quoted 9 lines · Rayyan Ansari

Changes since v3:
- Put the rpmcc.h include back in

Rayyan Ansari (3):
clk: qcom: smd: Add XO RPM clocks for MSM8226/MSM8974
ARM: dts: qcom: msm8226: add clocks and clock-names to GCC node
ARM: dts: qcom: msm8974: add correct XO clock source to GCC node

[...]

Applied, thanks!

[2/3] ARM: dts: qcom: msm8226: add clocks and clock-names to GCC node

      commit: d4b2c596fe5cb62560ce5a1442d8f64ec1ee716e
[3/3] ARM: dts: qcom: msm8974: add correct XO clock source to GCC node
      commit: 17c5ee1914dc8c4f42cab7a5beb2dc91aef0f873

Best regards,

Signature · 1 line
Bjorn Andersson <[email protected]>