Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332
@ 2026-01-07  5:35 Luo Jie
  2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
                   ` (5 more replies)
  0 siblings, 6 replies; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie,
	Krzysztof Kozlowski

This patch series adds support for the CMN PLL block on the IPQ5332 SoC.
The CMN PLL implementation in IPQ5332 is largely similar to that of
IPQ9574, which is already supported by the driver. The primary difference
is that the fixed output clocks to PPE from the CMN PLL operate at 200 MHz.

Additionally, IPQ5332 provides a single 50 MHz clock to both UNIPHY (PCS)
instances, which in turn supply either 25 MHz or 50 MHz to the connected
Ethernet PHY or switch.

This series also introduces a SoC-specific header file to export the CMN
PLL output clock specifiers for IPQ5332. A new table of output clocks for
the CMN PLL is added, and the appropriate clocks are acquired from the
device based on the compatible string.

Account for the CMN PLL reference divider when calculating CMN PLL output
rate. This fixes the doubled rate observed on IPQ5332 and is a no-op on
earlier platforms where ref_div = 1.

Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
Changes in v2:
- Use WARN_ON() to catch a factor or divider value of 0.
- Update DTS clock names to use 1 line per entry to align with corresponding
  clock definitions.
- Collect the Reviewed-by tags.
- Link to v1: https://patch.msgid.link/20251128-qcom_ipq5332_cmnpll-v1-0-55127ba85613@oss.qualcomm.com

---
Luo Jie (5):
      clk: qcom: cmnpll: Account for reference clock divider
      dt-bindings: clock: qcom: Add CMN PLL support for IPQ5332 SoC
      clk: qcom: cmnpll: Add IPQ5332 SoC support
      arm64: dts: ipq5332: Add CMN PLL node for networking hardware
      arm64: dts: qcom: Represent xo_board as fixed-factor clock on IPQ5332

 .../bindings/clock/qcom,ipq9574-cmn-pll.yaml       |  1 +
 arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi   | 24 +++++++++++++++--
 arch/arm64/boot/dts/qcom/ipq5332.dtsi              | 29 ++++++++++++++++++++-
 drivers/clk/qcom/ipq-cmn-pll.c                     | 30 +++++++++++++++++++---
 include/dt-bindings/clock/qcom,ipq5332-cmn-pll.h   | 19 ++++++++++++++
 5 files changed, 97 insertions(+), 6 deletions(-)
---
base-commit: 6cd6c12031130a349a098dbeb19d8c3070d2dfbe
change-id: 20251127-qcom_ipq5332_cmnpll-bc27e042d08d

Best regards,
--  
Luo Jie <jie.luo@oss.qualcomm.com>


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
@ 2026-01-07  5:35 ` Luo Jie
  2026-01-07 12:16   ` Konrad Dybcio
  2026-01-07 13:17   ` George Moussalem
  2026-01-07  5:35 ` [PATCH v2 2/5] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5332 SoC Luo Jie
                   ` (4 subsequent siblings)
  5 siblings, 2 replies; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie

The clk_cmn_pll_recalc_rate() function must account for the reference clock
divider programmed in CMN_PLL_REFCLK_CONFIG. Without this fix, platforms
with a reference divider other than 1 calculate incorrect CMN PLL rates.
For example, on IPQ5332 where the reference divider is 2, the computed rate
becomes twice the actual output.

Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
applying the 2 * FACTOR scaling. This yields the correct rate calculation:
rate = (parent_rate / ref_div) * 2 * factor.

Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
IPQ5424, IPQ5018) that use ref_div = 1.

Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
 drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
index dafbf5732048..369798d1ce42 100644
--- a/drivers/clk/qcom/ipq-cmn-pll.c
+++ b/drivers/clk/qcom/ipq-cmn-pll.c
@@ -185,7 +185,7 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
 					     unsigned long parent_rate)
 {
 	struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
-	u32 val, factor;
+	u32 val, factor, ref_div;
 
 	/*
 	 * The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
@@ -193,8 +193,15 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
 	 */
 	regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
 	factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
+	if (WARN_ON(factor == 0))
+		factor = 1;
 
-	return parent_rate * 2 * factor;
+	regmap_read(cmn_pll->regmap, CMN_PLL_REFCLK_CONFIG, &val);
+	ref_div = FIELD_GET(CMN_PLL_REFCLK_DIV, val);
+	if (WARN_ON(ref_div == 0))
+		ref_div = 1;
+
+	return div_u64((u64)parent_rate * 2 * factor, ref_div);
 }
 
 static int clk_cmn_pll_determine_rate(struct clk_hw *hw,

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 2/5] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5332 SoC
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
  2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
@ 2026-01-07  5:35 ` Luo Jie
  2026-01-07  5:35 ` [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support Luo Jie
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie,
	Krzysztof Kozlowski

Add device tree bindings for the CMN PLL block in IPQ5332 SoC, which shares
similarities with IPQ9574 but has different output clock frequencies.

Add a new header file to export CMN PLL output clock specifiers for IPQ5332
SoC.

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
 .../bindings/clock/qcom,ipq9574-cmn-pll.yaml          |  1 +
 include/dt-bindings/clock/qcom,ipq5332-cmn-pll.h      | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+)

diff --git a/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml b/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml
index 817d51135fbf..5bf29fcd8501 100644
--- a/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml
+++ b/Documentation/devicetree/bindings/clock/qcom,ipq9574-cmn-pll.yaml
@@ -25,6 +25,7 @@ properties:
   compatible:
     enum:
       - qcom,ipq5018-cmn-pll
+      - qcom,ipq5332-cmn-pll
       - qcom,ipq5424-cmn-pll
       - qcom,ipq9574-cmn-pll
 
diff --git a/include/dt-bindings/clock/qcom,ipq5332-cmn-pll.h b/include/dt-bindings/clock/qcom,ipq5332-cmn-pll.h
new file mode 100644
index 000000000000..172330e43669
--- /dev/null
+++ b/include/dt-bindings/clock/qcom,ipq5332-cmn-pll.h
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef _DT_BINDINGS_CLK_QCOM_IPQ5332_CMN_PLL_H
+#define _DT_BINDINGS_CLK_QCOM_IPQ5332_CMN_PLL_H
+
+/* CMN PLL core clock. */
+#define IPQ5332_CMN_PLL_CLK			0
+
+/* The output clocks from CMN PLL of IPQ5332. */
+#define IPQ5332_XO_24MHZ_CLK			1
+#define IPQ5332_SLEEP_32KHZ_CLK			2
+#define IPQ5332_PCS_31P25MHZ_CLK		3
+#define IPQ5332_NSS_300MHZ_CLK			4
+#define IPQ5332_PPE_200MHZ_CLK			5
+#define IPQ5332_ETH_50MHZ_CLK			6
+#endif

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
  2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
  2026-01-07  5:35 ` [PATCH v2 2/5] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5332 SoC Luo Jie
@ 2026-01-07  5:35 ` Luo Jie
  2026-01-08 14:10   ` Konrad Dybcio
  2026-01-07  5:35 ` [PATCH v2 4/5] arm64: dts: ipq5332: Add CMN PLL node for networking hardware Luo Jie
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie

The CMN PLL in IPQ5332 SoC produces different output clocks when compared
to IPQ9574. While most clock outputs match IPQ9574, the ethernet PHY/switch
(50 Mhz) and PPE clocks (200 Mhz) in IPQ5332 are different.

Add IPQ5332-specific clock definitions and of_device_id entry.

Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
 drivers/clk/qcom/ipq-cmn-pll.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
index 369798d1ce42..962462286837 100644
--- a/drivers/clk/qcom/ipq-cmn-pll.c
+++ b/drivers/clk/qcom/ipq-cmn-pll.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
- * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
 /*
@@ -20,6 +20,11 @@
  * and an output clock to NSS (network subsystem) at 300 MHZ. The other output
  * clocks from CMN PLL on IPQ5424 are the same as IPQ9574.
  *
+ * On the IPQ5332 SoC, the CMN PLL provides a single 50 MHZ clock output to
+ * the Ethernet PHY (or switch) via the UNIPHY (PCS). It also supplies a 200
+ * MHZ clock to the PPE. The remaining fixed-rate clocks to the GCC and PCS
+ * are the same as those in the IPQ9574 SoC.
+ *
  *               +---------+
  *               |   GCC   |
  *               +--+---+--+
@@ -51,6 +56,7 @@
 
 #include <dt-bindings/clock/qcom,ipq-cmn-pll.h>
 #include <dt-bindings/clock/qcom,ipq5018-cmn-pll.h>
+#include <dt-bindings/clock/qcom,ipq5332-cmn-pll.h>
 #include <dt-bindings/clock/qcom,ipq5424-cmn-pll.h>
 
 #define CMN_PLL_REFCLK_SRC_SELECTION		0x28
@@ -117,6 +123,16 @@ static const struct cmn_pll_fixed_output_clk ipq5018_output_clks[] = {
 	{ /* Sentinel */ }
 };
 
+static const struct cmn_pll_fixed_output_clk ipq5332_output_clks[] = {
+	CLK_PLL_OUTPUT(IPQ5332_XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
+	CLK_PLL_OUTPUT(IPQ5332_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
+	CLK_PLL_OUTPUT(IPQ5332_PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL),
+	CLK_PLL_OUTPUT(IPQ5332_NSS_300MHZ_CLK, "nss-300mhz", 300000000UL),
+	CLK_PLL_OUTPUT(IPQ5332_PPE_200MHZ_CLK, "ppe-200mhz", 200000000UL),
+	CLK_PLL_OUTPUT(IPQ5332_ETH_50MHZ_CLK, "eth-50mhz", 50000000UL),
+	{ /* Sentinel */ }
+};
+
 static const struct cmn_pll_fixed_output_clk ipq5424_output_clks[] = {
 	CLK_PLL_OUTPUT(IPQ5424_XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
 	CLK_PLL_OUTPUT(IPQ5424_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
@@ -454,6 +470,7 @@ static const struct dev_pm_ops ipq_cmn_pll_pm_ops = {
 
 static const struct of_device_id ipq_cmn_pll_clk_ids[] = {
 	{ .compatible = "qcom,ipq5018-cmn-pll", .data = &ipq5018_output_clks },
+	{ .compatible = "qcom,ipq5332-cmn-pll", .data = &ipq5332_output_clks },
 	{ .compatible = "qcom,ipq5424-cmn-pll", .data = &ipq5424_output_clks },
 	{ .compatible = "qcom,ipq9574-cmn-pll", .data = &ipq9574_output_clks },
 	{ }

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 4/5] arm64: dts: ipq5332: Add CMN PLL node for networking hardware
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
                   ` (2 preceding siblings ...)
  2026-01-07  5:35 ` [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support Luo Jie
@ 2026-01-07  5:35 ` Luo Jie
  2026-01-07  5:35 ` [PATCH v2 5/5] arm64: dts: qcom: Represent xo_board as fixed-factor clock on IPQ5332 Luo Jie
  2026-05-13 19:09 ` (subset) [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Bjorn Andersson
  5 siblings, 0 replies; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie

Add the CMN PLL node required for networking hardware operation on IPQ5332.
The CMN PLL core runs at 6 GHz on this platform, differing from others like
IPQ9574.

Configure the reference clock path where XO (48 MHz or 96 MHz) routes
through the WiFi block's multiplier/divider to provide a stable 48 MHz
reference to the CMN PLL.
.XO (48 MHZ or 96 MHZ)-->WiFi (multiplier/divider)--> 48 MHZ to CMN PLL.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi | 17 +++++++++++++-
 arch/arm64/boot/dts/qcom/ipq5332.dtsi            | 28 +++++++++++++++++++++++-
 2 files changed, 43 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
index b37ae7749083..471024ee1ddd 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
@@ -2,7 +2,7 @@
 /*
  * IPQ5332 RDP board common device tree source
  *
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
 /dts-v1/;
@@ -55,6 +55,17 @@ &blsp1_uart0 {
 	status = "okay";
 };
 
+/*
+ * The bootstrap pins for the board select the XO clock frequency that
+ * supports 48 MHZ or 96 MHZ. This setting automatically enables the
+ * right dividers, to ensure the reference clock output from WiFi to
+ * the CMN PLL is 48 MHZ.
+ */
+&ref_48mhz_clk {
+	clock-div = <1>;
+	clock-mult = <1>;
+};
+
 &sleep_clk {
 	clock-frequency = <32000>;
 };
@@ -63,6 +74,10 @@ &xo_board {
 	clock-frequency = <24000000>;
 };
 
+&xo_clk {
+	clock-frequency = <48000000>;
+};
+
 /* PINCTRL */
 &tlmm {
 	gpio_keys_default: gpio-keys-default-state {
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index 45fc512a3bab..2b1d098f9424 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -2,10 +2,11 @@
 /*
  * IPQ5332 device tree source
  *
- * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
  */
 
 #include <dt-bindings/clock/qcom,apss-ipq.h>
+#include <dt-bindings/clock/qcom,ipq5332-cmn-pll.h>
 #include <dt-bindings/clock/qcom,ipq5332-gcc.h>
 #include <dt-bindings/interconnect/qcom,ipq5332.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -16,6 +17,12 @@ / {
 	#size-cells = <2>;
 
 	clocks {
+		ref_48mhz_clk: ref-48mhz-clk {
+			compatible = "fixed-factor-clock";
+			clocks = <&xo_clk>;
+			#clock-cells = <0>;
+		};
+
 		sleep_clk: sleep-clk {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
@@ -25,6 +32,11 @@ xo_board: xo-board-clk {
 			compatible = "fixed-clock";
 			#clock-cells = <0>;
 		};
+
+		xo_clk: xo-clk {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+		};
 	};
 
 	cpus {
@@ -167,6 +179,20 @@ usbphy0: phy@7b000 {
 			status = "disabled";
 		};
 
+		cmn_pll: clock-controller@9b000 {
+			compatible = "qcom,ipq5332-cmn-pll";
+			reg = <0x0009b000 0x800>;
+			clocks = <&ref_48mhz_clk>,
+				 <&gcc GCC_CMN_12GPLL_AHB_CLK>,
+				 <&gcc GCC_CMN_12GPLL_SYS_CLK>;
+			clock-names = "ref",
+				      "ahb",
+				      "sys";
+			#clock-cells = <1>;
+			assigned-clocks = <&cmn_pll IPQ5332_CMN_PLL_CLK>;
+			assigned-clock-rates-u64 = /bits/ 64 <6000000000>;
+		};
+
 		qfprom: efuse@a4000 {
 			compatible = "qcom,ipq5332-qfprom", "qcom,qfprom";
 			reg = <0x000a4000 0x721>;

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v2 5/5] arm64: dts: qcom: Represent xo_board as fixed-factor clock on IPQ5332
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
                   ` (3 preceding siblings ...)
  2026-01-07  5:35 ` [PATCH v2 4/5] arm64: dts: ipq5332: Add CMN PLL node for networking hardware Luo Jie
@ 2026-01-07  5:35 ` Luo Jie
  2026-05-13 19:09 ` (subset) [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Bjorn Andersson
  5 siblings, 0 replies; 14+ messages in thread
From: Luo Jie @ 2026-01-07  5:35 UTC (permalink / raw)
  To: Bjorn Andersson, Michael Turquette, Stephen Boyd, Konrad Dybcio,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia, Luo Jie

The xo_board clock is derived from the 48 MHz WiFi output clock (divided
by 2), and not a standalone fixed frequency source.

The previous implementation incorrectly modelled it as a fixed-clock with
fixed frequency, which doesn't reflect the actual hardware clock tree.
Update for fixed-factor-clock compatibility, and properly reference the
source clock.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
---
 arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi | 7 ++++++-
 arch/arm64/boot/dts/qcom/ipq5332.dtsi            | 3 ++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi b/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
index 471024ee1ddd..e1346098ab0e 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332-rdp-common.dtsi
@@ -70,8 +70,13 @@ &sleep_clk {
 	clock-frequency = <32000>;
 };
 
+/*
+ * The frequency of xo_board is fixed to 24 MHZ, which is routed
+ * from WiFi output clock 48 MHZ divided by 2.
+ */
 &xo_board {
-	clock-frequency = <24000000>;
+	clock-div = <2>;
+	clock-mult = <1>;
 };
 
 &xo_clk {
diff --git a/arch/arm64/boot/dts/qcom/ipq5332.dtsi b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
index 2b1d098f9424..c076537c6504 100644
--- a/arch/arm64/boot/dts/qcom/ipq5332.dtsi
+++ b/arch/arm64/boot/dts/qcom/ipq5332.dtsi
@@ -29,7 +29,8 @@ sleep_clk: sleep-clk {
 		};
 
 		xo_board: xo-board-clk {
-			compatible = "fixed-clock";
+			compatible = "fixed-factor-clock";
+			clocks = <&ref_48mhz_clk>;
 			#clock-cells = <0>;
 		};
 

-- 
2.43.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
@ 2026-01-07 12:16   ` Konrad Dybcio
  2026-01-08  6:39     ` Jie Luo
  2026-01-07 13:17   ` George Moussalem
  1 sibling, 1 reply; 14+ messages in thread
From: Konrad Dybcio @ 2026-01-07 12:16 UTC (permalink / raw)
  To: Luo Jie, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia

On 1/7/26 6:35 AM, Luo Jie wrote:
> The clk_cmn_pll_recalc_rate() function must account for the reference clock
> divider programmed in CMN_PLL_REFCLK_CONFIG. Without this fix, platforms
> with a reference divider other than 1 calculate incorrect CMN PLL rates.
> For example, on IPQ5332 where the reference divider is 2, the computed rate
> becomes twice the actual output.
> 
> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
> rate = (parent_rate / ref_div) * 2 * factor.
> 
> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
> IPQ5424, IPQ5018) that use ref_div = 1.
> 
> Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
> ---
>  drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
> index dafbf5732048..369798d1ce42 100644
> --- a/drivers/clk/qcom/ipq-cmn-pll.c
> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
> @@ -185,7 +185,7 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>  					     unsigned long parent_rate)
>  {
>  	struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
> -	u32 val, factor;
> +	u32 val, factor, ref_div;
>  
>  	/*
>  	 * The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
> @@ -193,8 +193,15 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>  	 */
>  	regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
>  	factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
> +	if (WARN_ON(factor == 0))
> +		factor = 1;

FWIW the docs tell me the value of this field is '192' on IPQ5332..

Konrad

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
  2026-01-07 12:16   ` Konrad Dybcio
@ 2026-01-07 13:17   ` George Moussalem
  2026-01-08  6:42     ` Jie Luo
  1 sibling, 1 reply; 14+ messages in thread
From: George Moussalem @ 2026-01-07 13:17 UTC (permalink / raw)
  To: Luo Jie, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Konrad Dybcio, Luo Jie, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia



On 1/7/26 09:35, Luo Jie wrote:
> The clk_cmn_pll_recalc_rate() function must account for the reference clock
> divider programmed in CMN_PLL_REFCLK_CONFIG. Without this fix, platforms
> with a reference divider other than 1 calculate incorrect CMN PLL rates.
> For example, on IPQ5332 where the reference divider is 2, the computed rate
> becomes twice the actual output.
> 
> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
> rate = (parent_rate / ref_div) * 2 * factor.
> 
> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
> IPQ5424, IPQ5018) that use ref_div = 1.

Just tested this patch and can confirm IPQ5018 also has a ref_div of 2.
With this patch applied, the correct assigned clock rate of 4.8GHz is
also reported:

root@OpenWrt:~# cat /sys/kernel/debug/clk/clk_summary | grep cmn -A 3 -B 3

                                  deviceless
no_connection_id
 xo-clk                              1       1        0        48000000
  0          0     50000      Y   deviceless
no_connection_id
    ref-96mhz-clk                    1       1        0        96000000
  0          0     50000      Y      deviceless
no_connection_id
       cmn_pll                       0       0        0
4800000000  0          0     50000      Y         deviceless
         no_connection_id
          eth-50mhz                  0       0        0        50000000
  0          0     50000      Y            deviceless
  no_connection_id
          sleep-32khz                0       0        0        32000
  0          0     50000      Y            deviceless
  no_connection_id
          xo-24mhz                   0       0        0        24000000
  0          0     50000      Y            deviceless
  no_connection_id

Once accepted, I will submit a patch to correct the assigned clock rate
from 9.6GHz to 4.8GHz as the ref div is now properly applied.

Thanks Luo!

> 
> Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
> ---
>  drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
> index dafbf5732048..369798d1ce42 100644
> --- a/drivers/clk/qcom/ipq-cmn-pll.c
> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
> @@ -185,7 +185,7 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>  					     unsigned long parent_rate)
>  {
>  	struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
> -	u32 val, factor;
> +	u32 val, factor, ref_div;
>  
>  	/*
>  	 * The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
> @@ -193,8 +193,15 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>  	 */
>  	regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
>  	factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
> +	if (WARN_ON(factor == 0))
> +		factor = 1;
>  
> -	return parent_rate * 2 * factor;
> +	regmap_read(cmn_pll->regmap, CMN_PLL_REFCLK_CONFIG, &val);
> +	ref_div = FIELD_GET(CMN_PLL_REFCLK_DIV, val);
> +	if (WARN_ON(ref_div == 0))
> +		ref_div = 1;
> +
> +	return div_u64((u64)parent_rate * 2 * factor, ref_div);
>  }
>  
>  static int clk_cmn_pll_determine_rate(struct clk_hw *hw,
> 

Best regards,
George


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-07 12:16   ` Konrad Dybcio
@ 2026-01-08  6:39     ` Jie Luo
  2026-01-08 10:23       ` Konrad Dybcio
  0 siblings, 1 reply; 14+ messages in thread
From: Jie Luo @ 2026-01-08  6:39 UTC (permalink / raw)
  To: Konrad Dybcio, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia



On 1/7/2026 8:16 PM, Konrad Dybcio wrote:
> On 1/7/26 6:35 AM, Luo Jie wrote:
>> The clk_cmn_pll_recalc_rate() function must account for the reference clock
>> divider programmed in CMN_PLL_REFCLK_CONFIG. Without this fix, platforms
>> with a reference divider other than 1 calculate incorrect CMN PLL rates.
>> For example, on IPQ5332 where the reference divider is 2, the computed rate
>> becomes twice the actual output.
>>
>> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
>> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
>> rate = (parent_rate / ref_div) * 2 * factor.
>>
>> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
>> IPQ5424, IPQ5018) that use ref_div = 1.
>>
>> Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
>> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
>> ---
>>  drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++--
>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
>> index dafbf5732048..369798d1ce42 100644
>> --- a/drivers/clk/qcom/ipq-cmn-pll.c
>> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
>> @@ -185,7 +185,7 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>>  					     unsigned long parent_rate)
>>  {
>>  	struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
>> -	u32 val, factor;
>> +	u32 val, factor, ref_div;
>>  
>>  	/*
>>  	 * The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
>> @@ -193,8 +193,15 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>>  	 */
>>  	regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
>>  	factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
>> +	if (WARN_ON(factor == 0))
>> +		factor = 1;
> 
> FWIW the docs tell me the value of this field is '192' on IPQ5332..
> 
> Konrad

Although the register description lists the default value as 192, the
actual runtime value is 125 on IPQ5332, as shown in the dump below.

# devmem 0x9B794
0x00006C7D

# cat /sys/kernel/debug/clk/clk_summary | grep cmn_pll -B 2
 xo-clk                              1       1        0        48000000
  0          0     50000      Y   deviceless
no_connection_id
    ref-48mhz-clk                    2       2        0        48000000
  0          0     50000      Y      deviceless
no_connection_id
       cmn_pll                       3       3        0
6000000000  0          0     50000      Y         deviceless
         no_connection_id




^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-07 13:17   ` George Moussalem
@ 2026-01-08  6:42     ` Jie Luo
  2026-01-08 10:12       ` George Moussalem
  0 siblings, 1 reply; 14+ messages in thread
From: Jie Luo @ 2026-01-08  6:42 UTC (permalink / raw)
  To: George Moussalem, Bjorn Andersson, Michael Turquette,
	Stephen Boyd, Konrad Dybcio, Luo Jie, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia



On 1/7/2026 9:17 PM, George Moussalem wrote:
>> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
>> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
>> rate = (parent_rate / ref_div) * 2 * factor.
>>
>> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
>> IPQ5424, IPQ5018) that use ref_div = 1.
> Just tested this patch and can confirm IPQ5018 also has a ref_div of 2.
> With this patch applied, the correct assigned clock rate of 4.8GHz is
> also reported:
> 
> root@OpenWrt:~# cat /sys/kernel/debug/clk/clk_summary | grep cmn -A 3 -B 3
> 
>                                   deviceless
> no_connection_id
>  xo-clk                              1       1        0        48000000
>   0          0     50000      Y   deviceless
> no_connection_id
>     ref-96mhz-clk                    1       1        0        96000000
>   0          0     50000      Y      deviceless
> no_connection_id
>        cmn_pll                       0       0        0
> 4800000000  0          0     50000      Y         deviceless
>          no_connection_id
>           eth-50mhz                  0       0        0        50000000
>   0          0     50000      Y            deviceless
>   no_connection_id
>           sleep-32khz                0       0        0        32000
>   0          0     50000      Y            deviceless
>   no_connection_id
>           xo-24mhz                   0       0        0        24000000
>   0          0     50000      Y            deviceless
>   no_connection_id
> 
> Once accepted, I will submit a patch to correct the assigned clock rate
> from 9.6GHz to 4.8GHz as the ref div is now properly applied.

Thanks for validating this on the IPQ5018 platform.

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-08  6:42     ` Jie Luo
@ 2026-01-08 10:12       ` George Moussalem
  0 siblings, 0 replies; 14+ messages in thread
From: George Moussalem @ 2026-01-08 10:12 UTC (permalink / raw)
  To: Jie Luo, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Konrad Dybcio, Luo Jie, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia



On 1/8/26 10:42, Jie Luo wrote:
> 
> 
> On 1/7/2026 9:17 PM, George Moussalem wrote:
>>> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
>>> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
>>> rate = (parent_rate / ref_div) * 2 * factor.
>>>
>>> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
>>> IPQ5424, IPQ5018) that use ref_div = 1.
>> Just tested this patch and can confirm IPQ5018 also has a ref_div of 2.
>> With this patch applied, the correct assigned clock rate of 4.8GHz is
>> also reported:
>>
>> root@OpenWrt:~# cat /sys/kernel/debug/clk/clk_summary | grep cmn -A 3 -B 3
>>
>>                                   deviceless
>> no_connection_id
>>  xo-clk                              1       1        0        48000000
>>   0          0     50000      Y   deviceless
>> no_connection_id
>>     ref-96mhz-clk                    1       1        0        96000000
>>   0          0     50000      Y      deviceless
>> no_connection_id
>>        cmn_pll                       0       0        0
>> 4800000000  0          0     50000      Y         deviceless
>>          no_connection_id
>>           eth-50mhz                  0       0        0        50000000
>>   0          0     50000      Y            deviceless
>>   no_connection_id
>>           sleep-32khz                0       0        0        32000
>>   0          0     50000      Y            deviceless
>>   no_connection_id
>>           xo-24mhz                   0       0        0        24000000
>>   0          0     50000      Y            deviceless
>>   no_connection_id
>>
>> Once accepted, I will submit a patch to correct the assigned clock rate
>> from 9.6GHz to 4.8GHz as the ref div is now properly applied.
> 
> Thanks for validating this on the IPQ5018 platform.

FWIW:

root@OpenWrt:~# devmem 0x9b794
0x00006C32

50*96KHz=4.8GHz (correct). So:

Tested-by: George Moussalem <george.moussalem@outlook.com>

> 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider
  2026-01-08  6:39     ` Jie Luo
@ 2026-01-08 10:23       ` Konrad Dybcio
  0 siblings, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-01-08 10:23 UTC (permalink / raw)
  To: Jie Luo, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia

On 1/8/26 7:39 AM, Jie Luo wrote:
> 
> 
> On 1/7/2026 8:16 PM, Konrad Dybcio wrote:
>> On 1/7/26 6:35 AM, Luo Jie wrote:
>>> The clk_cmn_pll_recalc_rate() function must account for the reference clock
>>> divider programmed in CMN_PLL_REFCLK_CONFIG. Without this fix, platforms
>>> with a reference divider other than 1 calculate incorrect CMN PLL rates.
>>> For example, on IPQ5332 where the reference divider is 2, the computed rate
>>> becomes twice the actual output.
>>>
>>> Read CMN_PLL_REFCLK_DIV and divide the parent rate by this value before
>>> applying the 2 * FACTOR scaling. This yields the correct rate calculation:
>>> rate = (parent_rate / ref_div) * 2 * factor.
>>>
>>> Maintain backward compatibility with earlier platforms (e.g. IPQ9574,
>>> IPQ5424, IPQ5018) that use ref_div = 1.
>>>
>>> Fixes: f81715a4c87c ("clk: qcom: Add CMN PLL clock controller driver for IPQ SoC")
>>> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
>>> ---
>>>  drivers/clk/qcom/ipq-cmn-pll.c | 11 +++++++++--
>>>  1 file changed, 9 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
>>> index dafbf5732048..369798d1ce42 100644
>>> --- a/drivers/clk/qcom/ipq-cmn-pll.c
>>> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
>>> @@ -185,7 +185,7 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>>>  					     unsigned long parent_rate)
>>>  {
>>>  	struct clk_cmn_pll *cmn_pll = to_clk_cmn_pll(hw);
>>> -	u32 val, factor;
>>> +	u32 val, factor, ref_div;
>>>  
>>>  	/*
>>>  	 * The value of CMN_PLL_DIVIDER_CTRL_FACTOR is automatically adjusted
>>> @@ -193,8 +193,15 @@ static unsigned long clk_cmn_pll_recalc_rate(struct clk_hw *hw,
>>>  	 */
>>>  	regmap_read(cmn_pll->regmap, CMN_PLL_DIVIDER_CTRL, &val);
>>>  	factor = FIELD_GET(CMN_PLL_DIVIDER_CTRL_FACTOR, val);
>>> +	if (WARN_ON(factor == 0))
>>> +		factor = 1;
>>
>> FWIW the docs tell me the value of this field is '192' on IPQ5332..
>>
>> Konrad
> 
> Although the register description lists the default value as 192, the
> actual runtime value is 125 on IPQ5332, as shown in the dump below.
> 
> # devmem 0x9B794
> 0x00006C7D
> 
> # cat /sys/kernel/debug/clk/clk_summary | grep cmn_pll -B 2
>  xo-clk                              1       1        0        48000000
>   0          0     50000      Y   deviceless
> no_connection_id
>     ref-48mhz-clk                    2       2        0        48000000
>   0          0     50000      Y      deviceless
> no_connection_id
>        cmn_pll                       3       3        0
> 6000000000  0          0     50000      Y         deviceless
>          no_connection_id

Aaah I totally forgot about the xo rate in the calculations.. 1 vs 2
vs 100-something threw me off :)

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support
  2026-01-07  5:35 ` [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support Luo Jie
@ 2026-01-08 14:10   ` Konrad Dybcio
  0 siblings, 0 replies; 14+ messages in thread
From: Konrad Dybcio @ 2026-01-08 14:10 UTC (permalink / raw)
  To: Luo Jie, Bjorn Andersson, Michael Turquette, Stephen Boyd,
	Luo Jie, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia

On 1/7/26 6:35 AM, Luo Jie wrote:
> The CMN PLL in IPQ5332 SoC produces different output clocks when compared
> to IPQ9574. While most clock outputs match IPQ9574, the ethernet PHY/switch
> (50 Mhz) and PPE clocks (200 Mhz) in IPQ5332 are different.
> 
> Add IPQ5332-specific clock definitions and of_device_id entry.
> 
> Signed-off-by: Luo Jie <jie.luo@oss.qualcomm.com>
> ---
>  drivers/clk/qcom/ipq-cmn-pll.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/qcom/ipq-cmn-pll.c b/drivers/clk/qcom/ipq-cmn-pll.c
> index 369798d1ce42..962462286837 100644
> --- a/drivers/clk/qcom/ipq-cmn-pll.c
> +++ b/drivers/clk/qcom/ipq-cmn-pll.c
> @@ -1,6 +1,6 @@
>  // SPDX-License-Identifier: GPL-2.0-only
>  /*
> - * Copyright (c) 2024-2025 Qualcomm Innovation Center, Inc. All rights reserved.
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
>   */
>  
>  /*
> @@ -20,6 +20,11 @@
>   * and an output clock to NSS (network subsystem) at 300 MHZ. The other output
>   * clocks from CMN PLL on IPQ5424 are the same as IPQ9574.
>   *
> + * On the IPQ5332 SoC, the CMN PLL provides a single 50 MHZ clock output to
> + * the Ethernet PHY (or switch) via the UNIPHY (PCS). It also supplies a 200
> + * MHZ clock to the PPE. The remaining fixed-rate clocks to the GCC and PCS
> + * are the same as those in the IPQ9574 SoC.
> + *
>   *               +---------+
>   *               |   GCC   |
>   *               +--+---+--+
> @@ -51,6 +56,7 @@
>  
>  #include <dt-bindings/clock/qcom,ipq-cmn-pll.h>
>  #include <dt-bindings/clock/qcom,ipq5018-cmn-pll.h>
> +#include <dt-bindings/clock/qcom,ipq5332-cmn-pll.h>
>  #include <dt-bindings/clock/qcom,ipq5424-cmn-pll.h>
>  
>  #define CMN_PLL_REFCLK_SRC_SELECTION		0x28
> @@ -117,6 +123,16 @@ static const struct cmn_pll_fixed_output_clk ipq5018_output_clks[] = {
>  	{ /* Sentinel */ }
>  };
>  
> +static const struct cmn_pll_fixed_output_clk ipq5332_output_clks[] = {
> +	CLK_PLL_OUTPUT(IPQ5332_XO_24MHZ_CLK, "xo-24mhz", 24000000UL),
> +	CLK_PLL_OUTPUT(IPQ5332_SLEEP_32KHZ_CLK, "sleep-32khz", 32000UL),
> +	CLK_PLL_OUTPUT(IPQ5332_PCS_31P25MHZ_CLK, "pcs-31p25mhz", 31250000UL),
> +	CLK_PLL_OUTPUT(IPQ5332_NSS_300MHZ_CLK, "nss-300mhz", 300000000UL),
> +	CLK_PLL_OUTPUT(IPQ5332_PPE_200MHZ_CLK, "ppe-200mhz", 200000000UL),
> +	CLK_PLL_OUTPUT(IPQ5332_ETH_50MHZ_CLK, "eth-50mhz", 50000000UL),
> +	{ /* Sentinel */ }

Trusting you on these entries as I can't find a source

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad



^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: (subset) [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332
  2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
                   ` (4 preceding siblings ...)
  2026-01-07  5:35 ` [PATCH v2 5/5] arm64: dts: qcom: Represent xo_board as fixed-factor clock on IPQ5332 Luo Jie
@ 2026-05-13 19:09 ` Bjorn Andersson
  5 siblings, 0 replies; 14+ messages in thread
From: Bjorn Andersson @ 2026-05-13 19:09 UTC (permalink / raw)
  To: Michael Turquette, Stephen Boyd, Konrad Dybcio, Luo Jie,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Konrad Dybcio,
	Luo Jie
  Cc: linux-arm-msm, linux-clk, linux-kernel, devicetree, quic_kkumarcs,
	quic_linchen, quic_leiwei, quic_pavir, quic_suruchia,
	Krzysztof Kozlowski


On Tue, 06 Jan 2026 21:35:09 -0800, Luo Jie wrote:
> This patch series adds support for the CMN PLL block on the IPQ5332 SoC.
> The CMN PLL implementation in IPQ5332 is largely similar to that of
> IPQ9574, which is already supported by the driver. The primary difference
> is that the fixed output clocks to PPE from the CMN PLL operate at 200 MHz.
> 
> Additionally, IPQ5332 provides a single 50 MHz clock to both UNIPHY (PCS)
> instances, which in turn supply either 25 MHz or 50 MHz to the connected
> Ethernet PHY or switch.
> 
> [...]

Applied, thanks!

[1/5] clk: qcom: cmnpll: Account for reference clock divider
      commit: 88c543fff756450bcd04ec4560c4440be36c9e75
[3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support
      commit: 1dcbf4195a262d57f4da812248cdbbcdc81bf8d8

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-05-13 19:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-07  5:35 [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Luo Jie
2026-01-07  5:35 ` [PATCH v2 1/5] clk: qcom: cmnpll: Account for reference clock divider Luo Jie
2026-01-07 12:16   ` Konrad Dybcio
2026-01-08  6:39     ` Jie Luo
2026-01-08 10:23       ` Konrad Dybcio
2026-01-07 13:17   ` George Moussalem
2026-01-08  6:42     ` Jie Luo
2026-01-08 10:12       ` George Moussalem
2026-01-07  5:35 ` [PATCH v2 2/5] dt-bindings: clock: qcom: Add CMN PLL support for IPQ5332 SoC Luo Jie
2026-01-07  5:35 ` [PATCH v2 3/5] clk: qcom: cmnpll: Add IPQ5332 SoC support Luo Jie
2026-01-08 14:10   ` Konrad Dybcio
2026-01-07  5:35 ` [PATCH v2 4/5] arm64: dts: ipq5332: Add CMN PLL node for networking hardware Luo Jie
2026-01-07  5:35 ` [PATCH v2 5/5] arm64: dts: qcom: Represent xo_board as fixed-factor clock on IPQ5332 Luo Jie
2026-05-13 19:09 ` (subset) [PATCH v2 0/5] Add CMN PLL clock controller support for IPQ5332 Bjorn Andersson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox