]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
qualcommax: ipq50xx: Enable RX and TX clocks for IPQ5018 GEPHY
authorGeorge Moussalem <george.moussalem@outlook.com>
Tue, 19 May 2026 13:00:00 +0000 (17:00 +0400)
committerRobert Marko <robimarko@gmail.com>
Sat, 11 Jul 2026 20:26:43 +0000 (22:26 +0200)
Clocks are disabled by default for IPQ5018 GEPHY, but they are required
for the PHY to function properly. So let's enable the RX and TX clocks.

Signed-off-by: George Moussalem <george.moussalem@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/22381
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/qualcommax/patches-6.12/0740-01-dt-bindings-net-ethernet-phy-increase-max-clock-count-to-two.patch [new file with mode: 0644]
target/linux/qualcommax/patches-6.12/0740-03-arm64-qcom-ipq5018-add-gephy-rx-and-tx-clocks.patch [new file with mode: 0644]
target/linux/qualcommax/patches-6.12/0740-04-net-phy-at803x-add-rx-and-tx-clock-management-for-ipq5018-phy.patch [new file with mode: 0644]
target/linux/qualcommax/patches-6.12/0816-arm64-dts-qcom-ipq5018-add-wifi-support.patch
target/linux/qualcommax/patches-6.12/0818-arm64-dts-qcom-ipq5018-fix-assigned-cmn-pll-clock-rate.patch

diff --git a/target/linux/qualcommax/patches-6.12/0740-01-dt-bindings-net-ethernet-phy-increase-max-clock-count-to-two.patch b/target/linux/qualcommax/patches-6.12/0740-01-dt-bindings-net-ethernet-phy-increase-max-clock-count-to-two.patch
new file mode 100644 (file)
index 0000000..57285d0
--- /dev/null
@@ -0,0 +1,45 @@
+From 009bdd7a91990982e5b3bab4001318dfe5f6f575 Mon Sep 17 00:00:00 2001
+From: George Moussalem <george.moussalem@outlook.com>
+Date: Sun, 07 Jun 2026 13:00:06 +0400
+Subject: [PATCH v4 1/4] dt-bindings: net: ethernet-phy: increase max clock count to two
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+Message-Id: <20260607-ipq5018-gephy-clocks-v4-1-15b3a5ba7460@outlook.com>
+
+The clocks property has a restriction to maximum one.
+Yet, some PHYs may require more than 1 clock such as the IPQ5018 PHY
+which requires two clocks for RX and TX. As such, increase maxItems to
+two.
+
+Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
+Signed-off-by: George Moussalem <george.moussalem@outlook.com>
+---
+Commit 350b7a258f20 introduced the clocks property with a restriction to
+maximum 1 to the main ethernet-phy.yaml binding for Realtek to add an
+optional external clock source. This is restrictive to all PHY bindings,
+as some PHYs may require more than 1 clock such as the IPQ5018 PHY which
+requires 2 clocks (for RX and TX).
+---
+ Documentation/devicetree/bindings/net/ethernet-phy.yaml | 9 ++++++---
+ 1 file changed, 6 insertions(+), 3 deletions(-)
+
+--- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml
++++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml
+@@ -102,10 +102,13 @@ properties:
+       by software.
+   clocks:
+-    maxItems: 1
++    minItems: 1
++    maxItems: 2
+     description:
+-      External clock connected to the PHY. If not specified it is assumed
+-      that the PHY uses a fixed crystal or an internal oscillator.
++      External clock connected to the PHY or RX and TX clocks that the PHY
++      requires to enable explicitly. If not specified it is assumed
++      that the PHY uses a fixed crystal or an internal oscillator or that the
++      RX/TX clocks are hardware enabled by default.
+   enet-phy-lane-swap:
+     $ref: /schemas/types.yaml#/definitions/flag
diff --git a/target/linux/qualcommax/patches-6.12/0740-03-arm64-qcom-ipq5018-add-gephy-rx-and-tx-clocks.patch b/target/linux/qualcommax/patches-6.12/0740-03-arm64-qcom-ipq5018-add-gephy-rx-and-tx-clocks.patch
new file mode 100644 (file)
index 0000000..0e2aed9
--- /dev/null
@@ -0,0 +1,30 @@
+From ea59840c0b6839c65eaf39887a0762dfc4993f50 Mon Sep 17 00:00:00 2001
+From: George Moussalem <george.moussalem@outlook.com>
+Date: Sun, 07 Jun 2026 13:00:08 +0400
+Subject: [PATCH v4 3/4] arm64: qcom: ipq5018: Add GEPHY RX and TX clocks
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+Message-Id: <20260607-ipq5018-gephy-clocks-v4-3-15b3a5ba7460@outlook.com>
+
+Add RX and TX clocks for the IPQ5018 GEPHY to enable the datapath.
+
+Fixes: f5f2b835e316 ("arm64: dts: qcom: ipq5018: Add GE PHY to internal mdio bus")
+Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
+Signed-off-by: George Moussalem <george.moussalem@outlook.com>
+---
+ arch/arm64/boot/dts/qcom/ipq5018.dtsi | 3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
++++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
+@@ -234,6 +234,9 @@
+                               compatible = "ethernet-phy-id004d.d0c0";
+                               reg = <7>;
++                              clocks = <&gcc GCC_GEPHY_RX_CLK>,
++                                       <&gcc GCC_GEPHY_TX_CLK>;
++                              clock-names = "rx", "tx";
+                               resets = <&gcc GCC_GEPHY_MISC_ARES>;
+                       };
+               };
diff --git a/target/linux/qualcommax/patches-6.12/0740-04-net-phy-at803x-add-rx-and-tx-clock-management-for-ipq5018-phy.patch b/target/linux/qualcommax/patches-6.12/0740-04-net-phy-at803x-add-rx-and-tx-clock-management-for-ipq5018-phy.patch
new file mode 100644 (file)
index 0000000..de78180
--- /dev/null
@@ -0,0 +1,54 @@
+From 929c734775fc0e4f576727b47f8a07d7e5cabb4f Mon Sep 17 00:00:00 2001
+From: George Moussalem <george.moussalem@outlook.com>
+Date: Sun, 07 Jun 2026 13:00:09 +0400
+Subject: [PATCH v4 4/4] net: phy: at803x: add RX and TX clock management for IPQ5018 PHY
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 7bit
+Message-Id: <20260607-ipq5018-gephy-clocks-v4-4-15b3a5ba7460@outlook.com>
+
+Acquire and enable the RX and TX clocks for the IPQ5018 PHY.
+These clocks are required for the PHY's datapath to function correctly.
+
+Fixes: d46502279a11 ("net: phy: qcom: at803x: Add Qualcomm IPQ5018 Internal PHY support")
+Signed-off-by: George Moussalem <george.moussalem@outlook.com>
+---
+ drivers/net/phy/qcom/at803x.c | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
+
+--- a/drivers/net/phy/qcom/at803x.c
++++ b/drivers/net/phy/qcom/at803x.c
+@@ -19,6 +19,7 @@
+ #include <linux/regulator/consumer.h>
+ #include <linux/of.h>
+ #include <linux/phylink.h>
++#include <linux/clk.h>
+ #include <linux/reset.h>
+ #include <linux/sfp.h>
+ #include <dt-bindings/net/qca-ar803x.h>
+@@ -176,6 +177,8 @@ struct at803x_context {
+ };
+ struct ipq5018_priv {
++      struct clk *rx_clk;
++      struct clk *tx_clk;
+       struct reset_control *rst;
+       bool set_short_cable_dac;
+ };
+@@ -1099,6 +1102,16 @@ static int ipq5018_probe(struct phy_devi
+       priv->set_short_cable_dac = of_property_read_bool(dev->of_node,
+                                                         "qcom,dac-preset-short-cable");
++      priv->rx_clk = devm_clk_get_enabled(dev, "rx");
++      if (IS_ERR(priv->rx_clk))
++              return dev_err_probe(dev, PTR_ERR(priv->rx_clk),
++                                   "failed to get and enable RX clock\n");
++
++      priv->tx_clk = devm_clk_get_enabled(dev, "tx");
++      if (IS_ERR(priv->tx_clk))
++              return dev_err_probe(dev, PTR_ERR(priv->tx_clk),
++                                   "failed to get and enable TX clock\n");
++
+       priv->rst = devm_reset_control_array_get_exclusive(dev);
+       if (IS_ERR(priv->rst))
+               return dev_err_probe(dev, PTR_ERR(priv->rst),
index c9dcc0d12644c3bca3bc296a86671d9dbcefc4a7..8c6b2f9769eca331e20677e117515b6f7aa35d1c 100644 (file)
@@ -13,7 +13,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
 ---
 --- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
 +++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
-@@ -736,6 +736,118 @@
+@@ -739,6 +739,118 @@
                        };
                };
  
index 6ab9ba3788bad640756c2d22c19cb079bc14be91..8d0ca3741d9ce6b274fdbc0b1681f4373623051c 100644 (file)
@@ -23,7 +23,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
 
 --- a/arch/arm64/boot/dts/qcom/ipq5018.dtsi
 +++ b/arch/arm64/boot/dts/qcom/ipq5018.dtsi
-@@ -266,7 +266,7 @@
+@@ -269,7 +269,7 @@
                                      "sys";
                        #clock-cells = <1>;
                        assigned-clocks = <&cmn_pll IPQ5018_CMN_PLL_CLK>;