Netdev List
 help / color / mirror / Atom feed
* [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support
@ 2026-11-17  8:45 Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

This series incorporates feedback from the RFC and adds the dt-bindings
and driver changes required to enable Gigabit Ethernet support on the
Qualcomm Shikra SoC. DTS changes will be sent out separately.

The series has grown from the RFC and can be broadly divided into three
areas: PHY power supply management, proper support for RGMII ID mode in
the Qualcomm ETHQOS driver, and Shikra specific clock dependencies
required for NOC access.

1. Shikra EVK boards use a GPIO-gated regulator for the DP83867 PHY
power supply. Patches 1 and 2 add supply management to the DP83867
driver so the PHY driver holds the regulator vote at probe. These
changes are largely inspired by similar work done for the QCA8081 PHY:
https://lore.kernel.org/netdev/20261015143849.483339-1-elder@riscstar.com/

2. The generic RGMII fixes from the RFC remain. As suggested, the new
flow to use phy managed delays is protected by a platform specific
boolean to ensure that it affects only tested hardware. Legacy boards
will remain unaffected. Some other optimizations are carried forward
(initial link clock to SPEED_10, common structure for custom
dwmac4_addrs).

3. NOC clock voting (patch 8) now uses dev_pm_opp_set_opp() so the
required VDD_CX performance state can be propagated through the clock
controller. The Shikra binding (patch 3) is updated accordingly: an
if/else block constrains Shikra to exactly six clocks and requires
operating-points-v2 and power-domains.

Testing:
The following boards have been tested with this new (proper) handling
for RGMII ID:
  - Shikra CQ/IQ variants (with the TI DP83867 PHY)
  - QCS615 Ride (with the Micrel KSZ9031 PHY)
  - Talos EVK (again with the Micrel KSZ9031 PHY)
  - Talos Lyra EVK (TI DP83867 PHY, this board also has a GPIO-gated
    regulator for the PHY power supply)

Changes in v4:
 - Re-added the bindings patch for DP83867 PHY regulators which was
   accidentally dropped in v3.
 - Skip dp83867_power_on() if CONFIG_REGULATOR is disabled to avoid
   unintentional delay due to its code stub: Sashiko.
 - Moved operating-points description to the top-level of ethqos
   bindings: Krzysztof.
 - Added power-domains as a required property for Shikra due to its OPP
   dependency: Sashiko.
 - Protect the phy-managed delay sequence with a platform specific
   boolean to avoid impact on legacy hardware: Andrew.
 - Dropped "net: stmmac: qcom-ethqos: warn about legacy RGMII PHY modes"
   since only Shikra and QCS615 are going to use the RGMII-ID mode.
 - Added additional details to some commit messages to clarify Sashiko
   queries.
 - Since QCS615/Talos was also tested, a new patch adds its platform
   descriptor with phy_managed_delays set to true.
 - Link to v3: https://lore.kernel.org/netdev/20261017-shikra_ethernet-v3-0-26a8beb44b8f@oss.qualcomm.com/

Changes in v3:
 - Remove #ifdef CONFIG_OF from the dp83867_power_on() function. This is
   a result of the recent discussion regarding similar handling in the
   qca808x driver:
   https://lore.kernel.org/netdev/atCSWZQAyqvz62_K@aspen.lan/
 - Clean up the -ENODEV handling in dp83867_power_on() and use a boolean
   to identify if supplies are provided -- Lorenzo.
 - Patch 7's commit message now says set_clk_tx_rate instead of
   fix_mac_speed -- Sashiko.
 - Add a new patch to abstract away the common dwma4_addrs for different
   versions of ethqos rather than duplicating them -- Lorenzo.
 - Use OPP table to set both the required clock rates and power state,
   update ethqos bindings accordingly to specify how the clock rates are
   described in DTS -- Konrad, Lorenzo.
 - Link to v2: https://lore.kernel.org/r/20260908-shikra_ethernet-v2-0-bbe3389d0652@oss.qualcomm.com

Changes in v2:
  - Collected Maxime's Reviewed-by tags.
  - Updated Patch 9's commit message to explain the double enable vote
    on the "stmmaceth" clock. Open to discussion on how best to handle
    this.
  - Wrapped regulator vote for dp83867 inside an #ifdef CONFIG_OF check
    to avoid adding an unnecessary 200 ms delay on systems where
    devm_regulator_get_enable_optional() would return 0. The change now
    mirrors the QCA8081 patch -- Sashiko.
  - Fixed ethqos_set_clk_tx_rate() to double the rate for all PHY modes
    other than RGMII-ID -- Sashiko.
  - Moved warning about the use of non RGMII-ID mode to probe instead
    of fix_mac_speed to avoid spamming during each link up event --
    Sashiko.
  - Fixed error unwind drops OPP before stopping link_clk -- Sashiko.
  - Fixed OPP vote set in probe not cleaned up on error -- Sashiko.
  - Link to v1: https://lore.kernel.org/netdev/20260904-shikra_ethernet-v1-0-a50765996035@oss.qualcomm.com/#t

Changes since RFC:
  - Two new patches add supply management for the DP83867, replacing
    the gpio-hog approach for PHY power -- Konrad, Andrew.
  - Use dev_pm_opp_set_rate() for the NOC AXI clock and require
    operating-points-v2 for Shikra -- Konrad.
  - Warn on legacy "rgmii"/"rgmii-txid" to encourage DTB migration --
    Andrew, Maxime.
  - Updated binding document for qcom,ethqos and snps,dwmac.
  - Drop the duplicate "axi" clock from Shikra's DT; use "axi-noc" and
    "pcie-tile-axi-noc" as the only additional clock-names.
  - Initialise RGMII link clock at SPEED_10 rather than SPEED_1000 on
    probe.
  - Link to RFC: https://lore.kernel.org/netdev/20260612-shikra_ethernet-v1-0-f0f4a1d19929@oss.qualcomm.com/

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
Mohd Ayaan Anwar (10):
      dt-bindings: net: ti,dp83867: add supply properties
      net: phy: dp83867: add regulator supply management
      dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible
      net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void
      net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays
      net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
      net: stmmac: qcom-ethqos: share common GMAC4 address table
      net: stmmac: qcom-ethqos: add per-platform NOC clock voting
      net: stmmac: qcom-ethqos: add Shikra EMAC support
      net: stmmac: qcom-ethqos: add QCS615 EMAC support

 .../devicetree/bindings/net/qcom,ethqos.yaml       |  54 +++-
 .../devicetree/bindings/net/snps,dwmac.yaml        |   2 +
 .../devicetree/bindings/net/ti,dp83867.yaml        |  14 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig        |   1 +
 .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    | 286 ++++++++++++++++-----
 drivers/net/phy/dp83867.c                          |  35 +++
 6 files changed, 327 insertions(+), 65 deletions(-)
---
base-commit: 6964ff21c5d8b75649211a52dbfd92753e605649
change-id: 20260903-shikra_ethernet-ae7bee5e804e

Best regards,
--  
Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>


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

* [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18 18:58   ` Rob Herring (Arm)
  2026-11-17  8:45 ` [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

The DP83867 PHY has four distinct power supplies:

  VDDA2P5 -- 2.5V analog supply
  VDD1P0  -- 1.0V digital supply
  VDDA1P8 -- 1.8V analog supply
  VDDIO   -- I/O supply, which can be 3.3V or 2.5V or 1.8V

The DP83867E/IS/CS datasheet (section 8.3) describes two power supply
configurations - "two-supply" and "three-supply".

  1. Two-Supply Configuration: VDDA2P5 and VDD1P0 connected, and the
     VDDA1P8 pins are left unconnected.
  2. Three-Supply Configuration: VDDA2P5, VDD1P0 and VDDA1P8 are all
     connected.

VDDIO is a separate fourth supply present in both configurations. The
datasheet specifies that it can either be 1.8V or 2.5V or 3.3V.

Some embedded board design expose a GPIO-controlled regulator to control
any one or more of these supplies. Therefore, document all four of the
available supply properties.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: This patch was accidentally dropped in v3. It has been re-added
as-is from v2.
---
 Documentation/devicetree/bindings/net/ti,dp83867.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/ti,dp83867.yaml b/Documentation/devicetree/bindings/net/ti,dp83867.yaml
index 4bc1f98fd9fe..e78f08ded3d0 100644
--- a/Documentation/devicetree/bindings/net/ti,dp83867.yaml
+++ b/Documentation/devicetree/bindings/net/ti,dp83867.yaml
@@ -118,6 +118,20 @@ properties:
       Transmitt FIFO depth- see dt-bindings/net/ti-dp83867.h for applicable
       values.
 
+  vdda-2p5-supply:
+    description: 2.5V analog supply (connected to the VDDA2P5 pins).
+
+  vdd-1p0-supply:
+    description: 1.0V digital core supply (connected to the VDD1P0 pins).
+
+  vdda-1p8-supply:
+    description: 1.8V analog supply (connected to the VDDA1P8 pins).
+
+  vddio-supply:
+    description: |
+      I/O supply (connected to the VDDIO pins). The supply can be 1.8V,
+      2.5V or 3.3V.
+
 required:
   - reg
 

-- 
2.34.1


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

* [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-20 11:45   ` netdev-bot+sashiko
  2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

Some embedded board designs use GPIO-controlled regulators for the
DP83867 power rails. Add dp83867_power_on() to enable all four supply
domains at probe time. Absent supplies are silently skipped, so boards
that do not describe them are unaffected.

When any supply is newly enabled the driver sleeps for 200 ms before
returning. This satisfies the post power-up stabilisation requirement
mentioned in section 6.6 of the DP83867E/IS/CS datasheet.

Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Acked-by: Andrew Davis <afd@ti.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: Sashiko suggested adding a check to skip dp83867_power_on if
CONFIG_REGULATOR was not enabled, to avoid unintentional delay due to
its code stub.
I have kept the Acked- and Reviewed-by tags since it's a small if check
requested by the AI review. I can drop them if required, please let me
know.
---
 drivers/net/phy/dp83867.c | 35 +++++++++++++++++++++++++++++++++++
 1 file changed, 35 insertions(+)

diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
index b4b4931c6f8c..ed8b3089e8e0 100644
--- a/drivers/net/phy/dp83867.c
+++ b/drivers/net/phy/dp83867.c
@@ -16,6 +16,7 @@
 #include <linux/etherdevice.h>
 #include <linux/bitfield.h>
 #include <linux/nvmem-consumer.h>
+#include <linux/regulator/consumer.h>
 
 #include <dt-bindings/net/ti-dp83867.h>
 
@@ -730,11 +731,45 @@ static int dp83867_resume(struct phy_device *phydev)
 	return 0;
 }
 
+static int dp83867_power_on(struct phy_device *phydev)
+{
+	static const char * const supply_names[] = {
+		"vdda-2p5", "vdd-1p0", "vdda-1p8", "vddio",
+	};
+	struct device *dev = &phydev->mdio.dev;
+	bool supplies_enabled = false;
+	int i, ret;
+
+	if (!IS_ENABLED(CONFIG_REGULATOR))
+		return 0;
+
+	for (i = 0; i < ARRAY_SIZE(supply_names); i++) {
+		ret = devm_regulator_get_enable_optional(dev, supply_names[i]);
+		if (ret == -ENODEV)
+			continue;
+		if (ret)
+			return dev_err_probe(dev, ret,
+					     "failed to enable %s supply\n",
+					     supply_names[i]);
+		supplies_enabled = true;
+	}
+
+	/* Datasheet section 6.6 suggests a 200ms post power-up stabilization */
+	if (supplies_enabled)
+		fsleep(200000);
+
+	return 0;
+}
+
 static int dp83867_probe(struct phy_device *phydev)
 {
 	struct dp83867_private *dp83867;
 	int ret;
 
+	ret = dp83867_power_on(phydev);
+	if (ret)
+		return ret;
+
 	dp83867 = devm_kzalloc_obj(&phydev->mdio.dev, *dp83867);
 	if (!dp83867)
 		return -ENOMEM;

-- 
2.34.1


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

* [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18 19:07   ` Rob Herring
  2026-11-20 11:45   ` netdev-bot+sashiko
  2026-11-17  8:45 ` [PATCH net-next v4 04/10] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
                   ` (6 subsequent siblings)
  9 siblings, 2 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

Shikra's EMAC requires two additional clocks for NOC interconnect
access (axi-noc, pcie-tile-axi-noc) beyond the standard four, and an
OPP table with required-opps to vote VDD_CX to SVS when the NOC clocks
are enabled.

Add qcom,shikra-ethqos to the compatible enum and use an if/else
block to constrain Shikra to exactly six clocks and require
operating-points-v2 and power-domains, while leaving existing
compatibles unchanged.

Add the relevant compatible to the binding document for snps,dwmac as
well.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: moved operating-points description to the top-level, and added
power-domains as a required property for Shikra.
---
 .../devicetree/bindings/net/qcom,ethqos.yaml       | 54 ++++++++++++++++++++--
 .../devicetree/bindings/net/snps,dwmac.yaml        |  2 +
 2 files changed, 52 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
index ef520f810577..6bd4bded650a 100644
--- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
+++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
@@ -14,9 +14,6 @@ description:
   dwmmac based Qualcomm ethernet devices which support Gigabit
   ethernet (version v2.3.0 and onwards).
 
-allOf:
-  - $ref: snps,dwmac.yaml#
-
 properties:
   compatible:
     oneOf:
@@ -32,6 +29,7 @@ properties:
           - qcom,qcs404-ethqos
           - qcom,sa8775p-ethqos
           - qcom,sc8280xp-ethqos
+          - qcom,shikra-ethqos
           - qcom,sm8150-ethqos
 
   reg:
@@ -57,9 +55,11 @@ properties:
       - const: sfty
 
   clocks:
-    maxItems: 4
+    minItems: 4
+    maxItems: 6
 
   clock-names:
+    minItems: 4
     items:
       - const: stmmaceth
       - const: pclk
@@ -67,6 +67,8 @@ properties:
       - enum:
           - rgmii
           - phyaux
+      - const: axi-noc
+      - const: pcie-tile-axi-noc
 
   iommus:
     maxItems: 1
@@ -81,6 +83,14 @@ properties:
       - const: cpu-mac
       - const: mac-mem
 
+  operating-points-v2:
+    description: |
+      For Shikra, the OPP table specifies the rates for the NOC access
+      clocks in "stmmaceth", "axi-noc", "pcie-tile-axi-noc" order.
+
+  opp-table:
+    type: object
+
   phys: true
 
   phy-names:
@@ -95,6 +105,42 @@ required:
   - clock-names
   - reg-names
 
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: qcom,shikra-ethqos
+    then:
+      properties:
+        clocks:
+          minItems: 6
+        clock-names:
+          items:
+            - const: stmmaceth
+            - const: pclk
+            - const: ptp_ref
+            - const: rgmii
+            - const: axi-noc
+            - const: pcie-tile-axi-noc
+      required:
+        - operating-points-v2
+        - power-domains
+    else:
+      properties:
+        clocks:
+          maxItems: 4
+        clock-names:
+          items:
+            - const: stmmaceth
+            - const: pclk
+            - const: ptp_ref
+            - enum:
+                - rgmii
+                - phyaux
+
 unevaluatedProperties: false
 
 examples:
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index ddfc32ba29cb..b6555ada21da 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -76,6 +76,7 @@ properties:
         - qcom,sa8255p-ethqos
         - qcom,sa8775p-ethqos
         - qcom,sc8280xp-ethqos
+        - qcom,shikra-ethqos
         - qcom,sm8150-ethqos
         - renesas,r9a06g032-gmac
         - renesas,r9a08g046-gbeth
@@ -568,6 +569,7 @@ allOf:
                 - qcom,sa8255p-ethqos
                 - qcom,sa8775p-ethqos
                 - qcom,sc8280xp-ethqos
+                - qcom,shikra-ethqos
                 - qcom,sm8150-ethqos
                 - snps,dwmac-4.00
                 - snps,dwmac-4.10a

-- 
2.34.1


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

* [PATCH net-next v4 04/10] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (2 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays Mohd Ayaan Anwar
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

The return value is never checked by its sole caller and the speed
validation duplicates a check higher up the call stack.  Convert to
void and remove the dead code.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Acked-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index d24509a4b4d7..f2428f0467bb 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -411,9 +411,8 @@ static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
 	return 0;
 }
 
-static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
+static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
 {
-	struct device *dev = &ethqos->pdev->dev;
 	unsigned int prg_rclk_dly, loopback;
 	unsigned int phase_shift;
 
@@ -424,11 +423,6 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
 	/* Select RGMII, write 0 to interface select */
 	rgmii_clrmask(ethqos, RGMII_CONFIG_INTF_SEL, RGMII_IO_MACRO_CONFIG);
 
-	if (speed != SPEED_1000 && speed != SPEED_100 && speed != SPEED_10) {
-		dev_err(dev, "Invalid speed %d\n", speed);
-		return -EINVAL;
-	}
-
 	rgmii_setmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
 
 	if (speed == SPEED_1000) {
@@ -519,8 +513,6 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
 
 	rgmii_updatel(ethqos, RGMII_CONFIG_LOOPBACK_EN, loopback,
 		      RGMII_IO_MACRO_CONFIG);
-
-	return 0;
 }
 
 static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,

-- 
2.34.1


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

* [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (3 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 04/10] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-20 11:45   ` netdev-bot+sashiko
  2026-11-17  8:45 ` [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

When "rgmii-id" is selected the PHY supplies both TX and RX delays, so
the MAC must not add its own. The driver currently falls through to the
generic DLL initialisation path which programs it to add a delay.

Power down the DLL and set DDR bypass mode for RGMII_ID, then program
the IO_MACRO via a new ethqos_rgmii_id_macro_init() helper. Also fix
ethqos_set_clk_tx_rate() to not double the clock rate in bypass mode at
100M/10M.

This new programming is guarded by a boolean set by the platform
descriptors. No change intended on existing platforms.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: protect this programming sequence by a boolean flag and reword the
commit message.
---
 .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    | 72 +++++++++++++++++++++-
 1 file changed, 71 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index f2428f0467bb..99ea7e0cfb00 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -68,6 +68,9 @@
 /* SDC4_STATUS bits */
 #define SDC4_STATUS_DLL_LOCK			BIT(7)
 
+/* SDCC_USR_CTL bits */
+#define SDCC_USR_CTL_DDR_BYPASS			BIT(30)
+
 /* RGMII_IO_MACRO_CONFIG2 fields */
 #define RGMII_CONFIG2_RSVD_CONFIG15		GENMASK(31, 17)
 #define RGMII_CONFIG2_RGMII_CLK_SEL_CFG		BIT(16)
@@ -93,6 +96,7 @@ struct ethqos_emac_driver_data {
 	const struct ethqos_emac_por *rgmii_por;
 	unsigned int num_rgmii_por;
 	bool rgmii_config_loopback_en;
+	bool phy_managed_delays;
 	bool has_emac_ge_3;
 	u8 dma_addr_width;
 	const char *link_clk_name;
@@ -189,7 +193,15 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
 	if (rate < 0)
 		return rate;
 
-	return clk_set_rate(ethqos->link_clk, rate * 2);
+	/* Clock Rate Requirements:
+	 * MAC added delay: 250/50/5 MHz for 1G/100M/10M
+	 * No MAC delay (DLL bypass): 250/25/2.5 MHz for 1G/100M/10M
+	 */
+	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
+	    speed == SPEED_1000)
+		rate *= 2;
+
+	return clk_set_rate(ethqos->link_clk, rate);
 }
 
 static void
@@ -515,6 +527,58 @@ static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
 		      RGMII_IO_MACRO_CONFIG);
 }
 
+static void ethqos_rgmii_id_macro_init(struct qcom_ethqos *ethqos, int speed)
+{
+	rgmii_clrmask(ethqos, RGMII_CONFIG2_TX_TO_RX_LOOPBACK_EN,
+		      RGMII_IO_MACRO_CONFIG2);
+
+	if (speed == SPEED_1000)
+		rgmii_setmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
+	else
+		rgmii_clrmask(ethqos, RGMII_CONFIG_DDR_MODE, RGMII_IO_MACRO_CONFIG);
+	rgmii_setmask(ethqos, RGMII_CONFIG_BYPASS_TX_ID_EN, RGMII_IO_MACRO_CONFIG);
+	rgmii_clrmask(ethqos, RGMII_CONFIG_POS_NEG_DATA_SEL, RGMII_IO_MACRO_CONFIG);
+	rgmii_clrmask(ethqos, RGMII_CONFIG_PROG_SWAP, RGMII_IO_MACRO_CONFIG);
+
+	if (ethqos->data->has_emac_ge_3)
+		rgmii_clrmask(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL,
+			      RGMII_IO_MACRO_CONFIG2);
+	else
+		rgmii_setmask(ethqos, RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL,
+			      RGMII_IO_MACRO_CONFIG2);
+
+	rgmii_clrmask(ethqos, RGMII_CONFIG2_TX_CLK_PHASE_SHIFT_EN,
+		      RGMII_IO_MACRO_CONFIG2);
+
+	if (speed == SPEED_1000)
+		rgmii_clrmask(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, RGMII_IO_MACRO_CONFIG2);
+	else
+		rgmii_setmask(ethqos, RGMII_CONFIG2_RSVD_CONFIG15, RGMII_IO_MACRO_CONFIG2);
+
+	if (ethqos->data->rgmii_config_loopback_en)
+		rgmii_setmask(ethqos, RGMII_CONFIG_LOOPBACK_EN, RGMII_IO_MACRO_CONFIG);
+	else
+		rgmii_clrmask(ethqos, RGMII_CONFIG_LOOPBACK_EN, RGMII_IO_MACRO_CONFIG);
+
+	rgmii_setmask(ethqos, RGMII_CONFIG2_RX_PROG_SWAP, RGMII_IO_MACRO_CONFIG2);
+}
+
+static void ethqos_configure_rgmii_id(struct qcom_ethqos *ethqos, int speed)
+{
+	ethqos_set_func_clk_en(ethqos);
+
+	/* For rgmii-id mode, the PHY should add the required delays.
+	 * Therefore, power down the DLL and program it in bypass mode.
+	 * Program the IO_MACRO as per the settings recommended by the
+	 * programming guide for bypass mode. This will ensure that the
+	 * MAC core doesn't add any additional delays.
+	 */
+	rgmii_setmask(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_HC_REG_DLL_CONFIG);
+	rgmii_setmask(ethqos, SDCC_USR_CTL_DDR_BYPASS, SDCC_USR_CTL);
+
+	ethqos_rgmii_id_macro_init(ethqos, speed);
+}
+
 static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
 				       phy_interface_t interface, int speed,
 				       unsigned int mode)
@@ -524,6 +588,12 @@ static void ethqos_fix_mac_speed_rgmii(void *bsp_priv,
 	unsigned int i;
 	u32 val;
 
+	if (ethqos->data->phy_managed_delays &&
+	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
+		ethqos_configure_rgmii_id(ethqos, speed);
+		return;
+	}
+
 	dev = &ethqos->pdev->dev;
 
 	/* Reset to POR values and enable clk */

-- 
2.34.1


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

* [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (4 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18  9:13   ` Lorenzo Bianconi
  2026-11-17  8:45 ` [PATCH net-next v4 07/10] net: stmmac: qcom-ethqos: share common GMAC4 address table Mohd Ayaan Anwar
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

On probe the RGMII link clock is initialised at SPEED_1000, which
translates to a 250 MHz source clock even when no PHY link is present,
drawing unnecessary power.

Initialise at SPEED_10 instead; set_clk_tx_rate updates the rate once
a link is established.

The DLL locking is not affected by the current clock rate. This has
been confirmed with actual hardware testing as well as the fact that
the existing code performs the DLL lock first before changing the clock
rate when the link speed changes.

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: add some details in the commit message to address concerns raised
by Sashiko.
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 99ea7e0cfb00..192788e00dfa 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -828,7 +828,7 @@ static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
 	if (ret)
 		return ret;
 
-	ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, SPEED_1000);
+	ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, SPEED_10);
 	qcom_ethqos_set_sgmii_loopback(ethqos, true);
 	ethqos_set_func_clk_en(ethqos);
 

-- 
2.34.1


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

* [PATCH net-next v4 07/10] net: stmmac: qcom-ethqos: share common GMAC4 address table
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (5 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

Several ETHQOS versions use identical GMAC4 DMA and MTL address offsets.
Store the descriptor once and let per-compatible data reference it.

Use its presence, rather than has_emac_ge_3, when passing it to stmmac
core. This keeps address-table ownership independent of the feature
flag.

No functional change intended.

Suggested-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    | 74 +++++++---------------
 1 file changed, 23 insertions(+), 51 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 192788e00dfa..bc443793539b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -100,7 +100,7 @@ struct ethqos_emac_driver_data {
 	bool has_emac_ge_3;
 	u8 dma_addr_width;
 	const char *link_clk_name;
-	struct dwmac4_addrs dwmac4_addrs;
+	const struct dwmac4_addrs *dwmac4_addrs;
 	bool needs_sgmii_loopback;
 	/* Fixed PTP reference clock rate, used on SCMI platforms where
 	 * firmware does not implement the clock protocol allowing linux to
@@ -262,6 +262,23 @@ static const struct ethqos_emac_driver_data emac_v2_1_0_data = {
 	.setup = ethqos_hlos_setup,
 };
 
+static const struct dwmac4_addrs ethqos_dwmac4_addrs = {
+	.dma_chan = 0x00008100,
+	.dma_chan_offset = 0x1000,
+	.mtl_chan = 0x00008000,
+	.mtl_chan_offset = 0x1000,
+	.mtl_ets_ctrl = 0x00008010,
+	.mtl_ets_ctrl_offset = 0x1000,
+	.mtl_txq_weight = 0x00008018,
+	.mtl_txq_weight_offset = 0x1000,
+	.mtl_send_slp_cred = 0x0000801c,
+	.mtl_send_slp_cred_offset = 0x1000,
+	.mtl_high_cred = 0x00008020,
+	.mtl_high_cred_offset = 0x1000,
+	.mtl_low_cred = 0x00008024,
+	.mtl_low_cred_offset = 0x1000,
+};
+
 static const struct ethqos_emac_por emac_v3_0_0_por[] = {
 	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40c01343 },
 	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642c },
@@ -276,22 +293,7 @@ static const struct ethqos_emac_driver_data emac_v3_0_0_data = {
 	.num_rgmii_por = ARRAY_SIZE(emac_v3_0_0_por),
 	.rgmii_config_loopback_en = false,
 	.has_emac_ge_3 = true,
-	.dwmac4_addrs = {
-		.dma_chan = 0x00008100,
-		.dma_chan_offset = 0x1000,
-		.mtl_chan = 0x00008000,
-		.mtl_chan_offset = 0x1000,
-		.mtl_ets_ctrl = 0x00008010,
-		.mtl_ets_ctrl_offset = 0x1000,
-		.mtl_txq_weight = 0x00008018,
-		.mtl_txq_weight_offset = 0x1000,
-		.mtl_send_slp_cred = 0x0000801c,
-		.mtl_send_slp_cred_offset = 0x1000,
-		.mtl_high_cred = 0x00008020,
-		.mtl_high_cred_offset = 0x1000,
-		.mtl_low_cred = 0x00008024,
-		.mtl_low_cred_offset = 0x1000,
-	},
+	.dwmac4_addrs = &ethqos_dwmac4_addrs,
 	.setup = ethqos_hlos_setup,
 };
 
@@ -312,22 +314,7 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_data = {
 	.link_clk_name = "phyaux",
 	.needs_sgmii_loopback = true,
 	.dma_addr_width = 36,
-	.dwmac4_addrs = {
-		.dma_chan = 0x00008100,
-		.dma_chan_offset = 0x1000,
-		.mtl_chan = 0x00008000,
-		.mtl_chan_offset = 0x1000,
-		.mtl_ets_ctrl = 0x00008010,
-		.mtl_ets_ctrl_offset = 0x1000,
-		.mtl_txq_weight = 0x00008018,
-		.mtl_txq_weight_offset = 0x1000,
-		.mtl_send_slp_cred = 0x0000801c,
-		.mtl_send_slp_cred_offset = 0x1000,
-		.mtl_high_cred = 0x00008020,
-		.mtl_high_cred_offset = 0x1000,
-		.mtl_low_cred = 0x00008024,
-		.mtl_low_cred_offset = 0x1000,
-	},
+	.dwmac4_addrs = &ethqos_dwmac4_addrs,
 	.setup = ethqos_hlos_setup,
 };
 
@@ -336,22 +323,7 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_scmi_data = {
 	.needs_sgmii_loopback = true,
 	.dma_addr_width = 36,
 	.ptp_clk_rate = 230400000,
-	.dwmac4_addrs = {
-		.dma_chan = 0x00008100,
-		.dma_chan_offset = 0x1000,
-		.mtl_chan = 0x00008000,
-		.mtl_chan_offset = 0x1000,
-		.mtl_ets_ctrl = 0x00008010,
-		.mtl_ets_ctrl_offset = 0x1000,
-		.mtl_txq_weight = 0x00008018,
-		.mtl_txq_weight_offset = 0x1000,
-		.mtl_send_slp_cred = 0x0000801c,
-		.mtl_send_slp_cred_offset = 0x1000,
-		.mtl_high_cred = 0x00008020,
-		.mtl_high_cred_offset = 0x1000,
-		.mtl_low_cred = 0x00008024,
-		.mtl_low_cred_offset = 0x1000,
-	},
+	.dwmac4_addrs = &ethqos_dwmac4_addrs,
 	.setup = ethqos_scmi_setup,
 };
 
@@ -999,8 +971,8 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 	plat_dat->bsp_priv = ethqos;
 	plat_dat->ptp_clk_freq_config = ethqos_ptp_clk_freq_config;
 	plat_dat->core_type = DWMAC_CORE_GMAC4;
-	if (data->has_emac_ge_3)
-		plat_dat->dwmac4_addrs = &data->dwmac4_addrs;
+	if (data->dwmac4_addrs)
+		plat_dat->dwmac4_addrs = data->dwmac4_addrs;
 	plat_dat->pmt = true;
 	if (of_property_read_bool(np, "snps,tso"))
 		plat_dat->flags |= STMMAC_FLAG_TSO_EN;

-- 
2.34.1


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

* [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (6 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 07/10] net: stmmac: qcom-ethqos: share common GMAC4 address table Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18  9:40   ` Lorenzo Bianconi
  2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
  2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
  9 siblings, 1 reply; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

Some SoCs gate the EMAC DMA path behind dedicated AXI clocks. Add
per-platform clock-name lists and configure them as a single
multi-clock OPP. The OPP core programs every clock rate and propagates
the required power state.

Select PM_OPP because DWMAC_QCOM_ETHQOS calls PM OPP APIs for
compatibles that describe AXI OPP clocks.

No functional change for existing compatibles. This will help us when
we add support for Shikra.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
 drivers/net/ethernet/stmicro/stmmac/Kconfig        |   1 +
 .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    | 103 +++++++++++++++++++++
 2 files changed, 104 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index c6559e749c0c..15639666e837 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -146,6 +146,7 @@ config DWMAC_QCOM_ETHQOS
 	tristate "Qualcomm ETHQOS support"
 	default ARCH_QCOM
 	depends on OF && (ARCH_QCOM || COMPILE_TEST)
+	select PM_OPP
 	help
 	  Support for the Qualcomm ETHQOS core.
 
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index bc443793539b..15385750b3e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -6,6 +6,7 @@
 #include <linux/of_net.h>
 #include <linux/platform_device.h>
 #include <linux/pm_domain.h>
+#include <linux/pm_opp.h>
 #include <linux/phy.h>
 #include <linux/phy/phy.h>
 
@@ -102,6 +103,8 @@ struct ethqos_emac_driver_data {
 	const char *link_clk_name;
 	const struct dwmac4_addrs *dwmac4_addrs;
 	bool needs_sgmii_loopback;
+	const char * const *noc_clk_names;
+	unsigned int num_noc_clks;
 	/* Fixed PTP reference clock rate, used on SCMI platforms where
 	 * firmware does not implement the clock protocol allowing linux to
 	 * query it.
@@ -119,6 +122,8 @@ struct qcom_ethqos {
 	phy_interface_t phy_mode;
 	struct dev_pm_domain_list *pds;
 	const struct ethqos_emac_driver_data *data;
+	struct clk_bulk_data *noc_clks;
+	unsigned int num_noc_clks;
 };
 
 static u32 rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset)
@@ -725,18 +730,61 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv,
 	return ret;
 }
 
+static int qcom_ethqos_set_opp(struct qcom_ethqos *ethqos)
+{
+	struct device *dev = &ethqos->pdev->dev;
+	unsigned long freq = ULONG_MAX;
+	struct dev_pm_opp *opp;
+	int ret;
+
+	opp = dev_pm_opp_find_freq_floor_indexed(dev, &freq, 0);
+	if (IS_ERR(opp)) {
+		ret = PTR_ERR(opp);
+		dev_err(dev, "Failed to find AXI NOC OPP: %d\n", ret);
+		return ret;
+	}
+
+	ret = dev_pm_opp_set_opp(dev, opp);
+	dev_pm_opp_put(opp);
+
+	return ret;
+}
+
 static int ethqos_clks_config(void *priv, bool enabled)
 {
 	struct qcom_ethqos *ethqos = priv;
 	int ret = 0;
 
 	if (enabled) {
+		if (ethqos->num_noc_clks) {
+			ret = qcom_ethqos_set_opp(ethqos);
+			if (ret) {
+				dev_err(&ethqos->pdev->dev,
+					"NOC OPP set failed: %d\n", ret);
+				return ret;
+			}
+		}
+
 		ret = clk_prepare_enable(ethqos->link_clk);
 		if (ret) {
 			dev_err(&ethqos->pdev->dev, "link_clk enable failed\n");
+			if (ethqos->num_noc_clks)
+				dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
 			return ret;
 		}
 
+		if (ethqos->num_noc_clks) {
+			ret = clk_bulk_prepare_enable(ethqos->num_noc_clks,
+						      ethqos->noc_clks);
+			if (ret) {
+				dev_err(&ethqos->pdev->dev,
+					"NOC clocks enable failed: %d\n", ret);
+				clk_disable_unprepare(ethqos->link_clk);
+				dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
+				return ret;
+			}
+		}
+
 		/* Enable functional clock to prevent DMA reset to timeout due
 		 * to lacking PHY clock after the hardware block has been power
 		 * cycled. The actual configuration will be adjusted once
@@ -745,7 +793,12 @@ static int ethqos_clks_config(void *priv, bool enabled)
 		qcom_ethqos_set_sgmii_loopback(ethqos, true);
 		ethqos_set_func_clk_en(ethqos);
 	} else {
+		if (ethqos->num_noc_clks)
+			clk_bulk_disable_unprepare(ethqos->num_noc_clks,
+						   ethqos->noc_clks);
 		clk_disable_unprepare(ethqos->link_clk);
+		if (ethqos->num_noc_clks)
+			dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
 	}
 
 	return ret;
@@ -773,6 +826,52 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
 	netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
 }
 
+static void qcom_ethqos_noc_opp_cleanup(void *dev)
+{
+	dev_pm_opp_set_rate(dev, 0);
+}
+
+/* Some SoCs gate NOC access behind dedicated clocks. Acquire them here
+ * and set up an OPP table to vote for the required rate and power.
+ */
+static int qcom_ethqos_init_noc_clks(struct qcom_ethqos *ethqos,
+				     const struct ethqos_emac_driver_data *data)
+{
+	struct dev_pm_opp_config config = {
+		.clk_names = data->noc_clk_names,
+		.config_clks = dev_pm_opp_config_clks_simple,
+	};
+	struct device *dev = &ethqos->pdev->dev;
+	unsigned int i;
+	int ret;
+
+	if (!data->num_noc_clks)
+		return 0;
+
+	ethqos->noc_clks = devm_kcalloc(dev, data->num_noc_clks,
+					sizeof(*ethqos->noc_clks), GFP_KERNEL);
+	if (!ethqos->noc_clks)
+		return -ENOMEM;
+
+	for (i = 0; i < data->num_noc_clks; i++)
+		ethqos->noc_clks[i].id = data->noc_clk_names[i];
+	ethqos->num_noc_clks = data->num_noc_clks;
+
+	ret = devm_clk_bulk_get(dev, ethqos->num_noc_clks, ethqos->noc_clks);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to get NOC clocks\n");
+
+	ret = devm_pm_opp_set_config(dev, &config);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to configure OPP clocks\n");
+
+	ret = devm_pm_opp_of_add_table(dev);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to add OPP table\n");
+
+	return devm_add_action_or_reset(dev, qcom_ethqos_noc_opp_cleanup, dev);
+}
+
 static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
 			     struct plat_stmmacenet_data *plat_dat)
 {
@@ -780,6 +879,10 @@ static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
 	struct device *dev = &pdev->dev;
 	int ret;
 
+	ret = qcom_ethqos_init_noc_clks(ethqos, ethqos->data);
+	if (ret)
+		return ret;
+
 	ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii");
 	if (IS_ERR(ethqos->rgmii_base))
 		return dev_err_probe(dev, PTR_ERR(ethqos->rgmii_base),

-- 
2.34.1


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

* [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (7 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18  9:43   ` Lorenzo Bianconi
  2026-11-20 11:46   ` netdev-bot+sashiko
  2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
  9 siblings, 2 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

Shikra integrates two Qualcomm ETHQOS controllers based on the Synopsys
GMAC IP, similar to previous platforms. Register qcom,shikra-ethqos
backed by a new shikra_data descriptor that enables the three NOC clocks
required for DMA memory access (stmmaceth, axi-noc, pcie-tile-axi-noc),
and the 36-bit DMA address width.

Set the NOC clock rates through an OPP table to ensure proper voting of
the VDD_CX power domain. The stmmac core enables stmmaceth before the
glue driver applies the OPP vote, both at probe and on resume. This is
safe because VDD_CX only needs to be voted while DMA traffic is
ongoing, which cannot start until the glue driver applies the vote.

Shikra's intended rgmii-id configuration supplies both TX and RX delays
in the PHY. Therefore, enable phy_managed_delays to select the
DLL-bypass sequence. No POR table is needed for this intended bypass
operation.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: set phy_managed_delays to true for Shikra and reworded the commit
message to clarify concerns raised by Sashiko.
---
 .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c   | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index 15385750b3e6..a7fdba73da2b 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -332,6 +332,24 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_scmi_data = {
 	.setup = ethqos_scmi_setup,
 };
 
+static const char * const shikra_noc_clk_names[] = {
+	"stmmaceth",
+	"axi-noc",
+	"pcie-tile-axi-noc",
+	NULL,
+};
+
+static const struct ethqos_emac_driver_data shikra_data = {
+	.dma_addr_width = 36,
+	.has_emac_ge_3 = true,
+	.noc_clk_names = shikra_noc_clk_names,
+	.num_noc_clks = ARRAY_SIZE(shikra_noc_clk_names) - 1,
+	.rgmii_config_loopback_en = false,
+	.phy_managed_delays = true,
+	.dwmac4_addrs = &ethqos_dwmac4_addrs,
+	.setup = ethqos_hlos_setup,
+};
+
 static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
 {
 	struct device *dev = &ethqos->pdev->dev;
@@ -1101,6 +1119,7 @@ static const struct of_device_id qcom_ethqos_match[] = {
 	{ .compatible = "qcom,sa8255p-ethqos", .data = &emac_v4_0_0_scmi_data},
 	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
 	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
+	{ .compatible = "qcom,shikra-ethqos", .data = &shikra_data},
 	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
 	{ }
 };

-- 
2.34.1


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

* [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 EMAC support
  2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
                   ` (8 preceding siblings ...)
  2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-11-17  8:45 ` Mohd Ayaan Anwar
  2026-11-18  9:44   ` Lorenzo Bianconi
  2026-11-20 11:46   ` netdev-bot+sashiko
  9 siblings, 2 replies; 22+ messages in thread
From: Mohd Ayaan Anwar @ 2026-11-17  8:45 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi
  Cc: netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel, Mohd Ayaan Anwar

QCS615 (Talos) uses an ETHQOS controller which is extremely similar to
the QCS404 version, but unlike QCS404 its RGMII clock source supports
the 25 MHz and 2.5 MHz rates used at 100M and 10M with PHY-managed
delays.

Add a dedicated qcom,qcs615-ethqos match and descriptor and enable
phy_managed_delays so rgmii-id uses the DLL-bypass configuration.

The bypass sequence has been tested on three QCS615 board designs,
two with a Micrel KSZ9031 PHY and one with a TI DP83867 PHY. The
existing compatible binding and qcom,qcs404-ethqos fallback remain
unchanged.

Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
---
v4: this is a new commit which ensures that the phy managed delays only
affect actually tested hardware (Shikra and QCS615).
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
index a7fdba73da2b..790159ae1be7 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
@@ -250,6 +250,13 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = {
 	.setup = ethqos_hlos_setup,
 };
 
+static const struct ethqos_emac_driver_data qcs615_data = {
+	.rgmii_config_loopback_en = true,
+	.phy_managed_delays = true,
+	.has_emac_ge_3 = false,
+	.setup = ethqos_hlos_setup,
+};
+
 static const struct ethqos_emac_por emac_v2_1_0_por[] = {
 	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40C01343 },
 	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },
@@ -1116,6 +1123,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
 
 static const struct of_device_id qcom_ethqos_match[] = {
 	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
+	{ .compatible = "qcom,qcs615-ethqos", .data = &qcs615_data},
 	{ .compatible = "qcom,sa8255p-ethqos", .data = &emac_v4_0_0_scmi_data},
 	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
 	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},

-- 
2.34.1


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

* Re: [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed
  2026-11-17  8:45 ` [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
@ 2026-11-18  9:13   ` Lorenzo Bianconi
  0 siblings, 0 replies; 22+ messages in thread
From: Lorenzo Bianconi @ 2026-11-18  9:13 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, netdev, devicetree, linux-kernel, linux-arm-msm,
	linux-stm32, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 1660 bytes --]

> On probe the RGMII link clock is initialised at SPEED_1000, which
> translates to a 250 MHz source clock even when no PHY link is present,
> drawing unnecessary power.
> 
> Initialise at SPEED_10 instead; set_clk_tx_rate updates the rate once
> a link is established.
> 
> The DLL locking is not affected by the current clock rate. This has
> been confirmed with actual hardware testing as well as the fact that
> the existing code performs the DLL lock first before changing the clock
> rate when the link speed changes.
> 
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>

Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

> ---
> v4: add some details in the commit message to address concerns raised
> by Sashiko.
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 99ea7e0cfb00..192788e00dfa 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -828,7 +828,7 @@ static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
>  	if (ret)
>  		return ret;
>  
> -	ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, SPEED_1000);
> +	ethqos_set_clk_tx_rate(ethqos, NULL, plat_dat->phy_interface, SPEED_10);
>  	qcom_ethqos_set_sgmii_loopback(ethqos, true);
>  	ethqos_set_func_clk_en(ethqos);
>  
> 
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting
  2026-11-17  8:45 ` [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
@ 2026-11-18  9:40   ` Lorenzo Bianconi
  0 siblings, 0 replies; 22+ messages in thread
From: Lorenzo Bianconi @ 2026-11-18  9:40 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, netdev, devicetree, linux-kernel, linux-arm-msm,
	linux-stm32, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 7327 bytes --]

> Some SoCs gate the EMAC DMA path behind dedicated AXI clocks. Add
> per-platform clock-name lists and configure them as a single
> multi-clock OPP. The OPP core programs every clock rate and propagates
> the required power state.
> 
> Select PM_OPP because DWMAC_QCOM_ETHQOS calls PM OPP APIs for
> compatibles that describe AXI OPP clocks.
> 
> No functional change for existing compatibles. This will help us when
> we add support for Shikra.
> 
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>

Hi Mohd,

just a nit inline. Fixing it:
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

Regards,
Lorenzo

> ---
>  drivers/net/ethernet/stmicro/stmmac/Kconfig        |   1 +
>  .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c    | 103 +++++++++++++++++++++
>  2 files changed, 104 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> index c6559e749c0c..15639666e837 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
> +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
> @@ -146,6 +146,7 @@ config DWMAC_QCOM_ETHQOS
>  	tristate "Qualcomm ETHQOS support"
>  	default ARCH_QCOM
>  	depends on OF && (ARCH_QCOM || COMPILE_TEST)
> +	select PM_OPP
>  	help
>  	  Support for the Qualcomm ETHQOS core.
>  
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index bc443793539b..15385750b3e6 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -6,6 +6,7 @@
>  #include <linux/of_net.h>
>  #include <linux/platform_device.h>
>  #include <linux/pm_domain.h>
> +#include <linux/pm_opp.h>
>  #include <linux/phy.h>
>  #include <linux/phy/phy.h>
>  
> @@ -102,6 +103,8 @@ struct ethqos_emac_driver_data {
>  	const char *link_clk_name;
>  	const struct dwmac4_addrs *dwmac4_addrs;
>  	bool needs_sgmii_loopback;
> +	const char * const *noc_clk_names;
> +	unsigned int num_noc_clks;
>  	/* Fixed PTP reference clock rate, used on SCMI platforms where
>  	 * firmware does not implement the clock protocol allowing linux to
>  	 * query it.
> @@ -119,6 +122,8 @@ struct qcom_ethqos {
>  	phy_interface_t phy_mode;
>  	struct dev_pm_domain_list *pds;
>  	const struct ethqos_emac_driver_data *data;
> +	struct clk_bulk_data *noc_clks;
> +	unsigned int num_noc_clks;
>  };
>  
>  static u32 rgmii_readl(struct qcom_ethqos *ethqos, unsigned int offset)
> @@ -725,18 +730,61 @@ static int ethqos_mac_finish_serdes(struct net_device *ndev, void *priv,
>  	return ret;
>  }
>  
> +static int qcom_ethqos_set_opp(struct qcom_ethqos *ethqos)

is it clearer to have an utility routine to set a specific freq and then call it
with freq = ULONG_MAX? Something like:

static in t qcom_ethqos_set_opp(struct qcom_ethqos *ethqos, unsigned long *freq)
{
	....
}

> +{
> +	struct device *dev = &ethqos->pdev->dev;
> +	unsigned long freq = ULONG_MAX;
> +	struct dev_pm_opp *opp;
> +	int ret;
> +
> +	opp = dev_pm_opp_find_freq_floor_indexed(dev, &freq, 0);
> +	if (IS_ERR(opp)) {
> +		ret = PTR_ERR(opp);
> +		dev_err(dev, "Failed to find AXI NOC OPP: %d\n", ret);
> +		return ret;
> +	}
> +
> +	ret = dev_pm_opp_set_opp(dev, opp);
> +	dev_pm_opp_put(opp);
> +
> +	return ret;
> +}
> +
>  static int ethqos_clks_config(void *priv, bool enabled)
>  {
>  	struct qcom_ethqos *ethqos = priv;
>  	int ret = 0;
>  
>  	if (enabled) {
> +		if (ethqos->num_noc_clks) {
> +			ret = qcom_ethqos_set_opp(ethqos);
> +			if (ret) {
> +				dev_err(&ethqos->pdev->dev,
> +					"NOC OPP set failed: %d\n", ret);
> +				return ret;
> +			}
> +		}
> +
>  		ret = clk_prepare_enable(ethqos->link_clk);
>  		if (ret) {
>  			dev_err(&ethqos->pdev->dev, "link_clk enable failed\n");
> +			if (ethqos->num_noc_clks)
> +				dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
>  			return ret;
>  		}
>  
> +		if (ethqos->num_noc_clks) {
> +			ret = clk_bulk_prepare_enable(ethqos->num_noc_clks,
> +						      ethqos->noc_clks);
> +			if (ret) {
> +				dev_err(&ethqos->pdev->dev,
> +					"NOC clocks enable failed: %d\n", ret);
> +				clk_disable_unprepare(ethqos->link_clk);
> +				dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
> +				return ret;
> +			}
> +		}
> +
>  		/* Enable functional clock to prevent DMA reset to timeout due
>  		 * to lacking PHY clock after the hardware block has been power
>  		 * cycled. The actual configuration will be adjusted once
> @@ -745,7 +793,12 @@ static int ethqos_clks_config(void *priv, bool enabled)
>  		qcom_ethqos_set_sgmii_loopback(ethqos, true);
>  		ethqos_set_func_clk_en(ethqos);
>  	} else {
> +		if (ethqos->num_noc_clks)
> +			clk_bulk_disable_unprepare(ethqos->num_noc_clks,
> +						   ethqos->noc_clks);
>  		clk_disable_unprepare(ethqos->link_clk);
> +		if (ethqos->num_noc_clks)
> +			dev_pm_opp_set_rate(&ethqos->pdev->dev, 0);
>  	}
>  
>  	return ret;
> @@ -773,6 +826,52 @@ static void ethqos_ptp_clk_freq_config(struct stmmac_priv *priv)
>  	netdev_dbg(priv->dev, "PTP rate %lu\n", plat_dat->clk_ptp_rate);
>  }
>  
> +static void qcom_ethqos_noc_opp_cleanup(void *dev)
> +{
> +	dev_pm_opp_set_rate(dev, 0);
> +}
> +
> +/* Some SoCs gate NOC access behind dedicated clocks. Acquire them here
> + * and set up an OPP table to vote for the required rate and power.
> + */
> +static int qcom_ethqos_init_noc_clks(struct qcom_ethqos *ethqos,
> +				     const struct ethqos_emac_driver_data *data)
> +{
> +	struct dev_pm_opp_config config = {
> +		.clk_names = data->noc_clk_names,
> +		.config_clks = dev_pm_opp_config_clks_simple,
> +	};
> +	struct device *dev = &ethqos->pdev->dev;
> +	unsigned int i;
> +	int ret;
> +
> +	if (!data->num_noc_clks)
> +		return 0;
> +
> +	ethqos->noc_clks = devm_kcalloc(dev, data->num_noc_clks,
> +					sizeof(*ethqos->noc_clks), GFP_KERNEL);
> +	if (!ethqos->noc_clks)
> +		return -ENOMEM;
> +
> +	for (i = 0; i < data->num_noc_clks; i++)
> +		ethqos->noc_clks[i].id = data->noc_clk_names[i];
> +	ethqos->num_noc_clks = data->num_noc_clks;
> +
> +	ret = devm_clk_bulk_get(dev, ethqos->num_noc_clks, ethqos->noc_clks);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to get NOC clocks\n");
> +
> +	ret = devm_pm_opp_set_config(dev, &config);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to configure OPP clocks\n");
> +
> +	ret = devm_pm_opp_of_add_table(dev);
> +	if (ret)
> +		return dev_err_probe(dev, ret, "Failed to add OPP table\n");
> +
> +	return devm_add_action_or_reset(dev, qcom_ethqos_noc_opp_cleanup, dev);
> +}
> +
>  static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
>  			     struct plat_stmmacenet_data *plat_dat)
>  {
> @@ -780,6 +879,10 @@ static int ethqos_hlos_setup(struct qcom_ethqos *ethqos,
>  	struct device *dev = &pdev->dev;
>  	int ret;
>  
> +	ret = qcom_ethqos_init_noc_clks(ethqos, ethqos->data);
> +	if (ret)
> +		return ret;
> +
>  	ethqos->rgmii_base = devm_platform_ioremap_resource_byname(pdev, "rgmii");
>  	if (IS_ERR(ethqos->rgmii_base))
>  		return dev_err_probe(dev, PTR_ERR(ethqos->rgmii_base),
> 
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support
  2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
@ 2026-11-18  9:43   ` Lorenzo Bianconi
  2026-11-20 11:46   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: Lorenzo Bianconi @ 2026-11-18  9:43 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, netdev, devicetree, linux-kernel, linux-arm-msm,
	linux-stm32, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2907 bytes --]

On Nov 17, Mohd Ayaan Anwar wrote:
> Shikra integrates two Qualcomm ETHQOS controllers based on the Synopsys
> GMAC IP, similar to previous platforms. Register qcom,shikra-ethqos
> backed by a new shikra_data descriptor that enables the three NOC clocks
> required for DMA memory access (stmmaceth, axi-noc, pcie-tile-axi-noc),
> and the 36-bit DMA address width.
> 
> Set the NOC clock rates through an OPP table to ensure proper voting of
> the VDD_CX power domain. The stmmac core enables stmmaceth before the
> glue driver applies the OPP vote, both at probe and on resume. This is
> safe because VDD_CX only needs to be voted while DMA traffic is
> ongoing, which cannot start until the glue driver applies the vote.
> 
> Shikra's intended rgmii-id configuration supplies both TX and RX delays
> in the PHY. Therefore, enable phy_managed_delays to select the
> DLL-bypass sequence. No POR table is needed for this intended bypass
> operation.
> 
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
> ---
> v4: set phy_managed_delays to true for Shikra and reworded the commit
> message to clarify concerns raised by Sashiko.
> ---
>  .../net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c   | 19 +++++++++++++++++++
>  1 file changed, 19 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 15385750b3e6..a7fdba73da2b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -332,6 +332,24 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_scmi_data = {
>  	.setup = ethqos_scmi_setup,
>  };
>  
> +static const char * const shikra_noc_clk_names[] = {
> +	"stmmaceth",
> +	"axi-noc",
> +	"pcie-tile-axi-noc",
> +	NULL,

do you really need it?

Regards,
Lorenzo

> +};
> +
> +static const struct ethqos_emac_driver_data shikra_data = {
> +	.dma_addr_width = 36,
> +	.has_emac_ge_3 = true,
> +	.noc_clk_names = shikra_noc_clk_names,
> +	.num_noc_clks = ARRAY_SIZE(shikra_noc_clk_names) - 1,
> +	.rgmii_config_loopback_en = false,
> +	.phy_managed_delays = true,
> +	.dwmac4_addrs = &ethqos_dwmac4_addrs,
> +	.setup = ethqos_hlos_setup,
> +};
> +
>  static int ethqos_dll_configure(struct qcom_ethqos *ethqos)
>  {
>  	struct device *dev = &ethqos->pdev->dev;
> @@ -1101,6 +1119,7 @@ static const struct of_device_id qcom_ethqos_match[] = {
>  	{ .compatible = "qcom,sa8255p-ethqos", .data = &emac_v4_0_0_scmi_data},
>  	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
>  	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
> +	{ .compatible = "qcom,shikra-ethqos", .data = &shikra_data},
>  	{ .compatible = "qcom,sm8150-ethqos", .data = &emac_v2_1_0_data},
>  	{ }
>  };
> 
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 EMAC support
  2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
@ 2026-11-18  9:44   ` Lorenzo Bianconi
  2026-11-20 11:46   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: Lorenzo Bianconi @ 2026-11-18  9:44 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Andrew Davis, Andrew Lunn, Heiner Kallweit, Russell King,
	Richard Cochran, Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, netdev, devicetree, linux-kernel, linux-arm-msm,
	linux-stm32, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2365 bytes --]

> QCS615 (Talos) uses an ETHQOS controller which is extremely similar to
> the QCS404 version, but unlike QCS404 its RGMII clock source supports
> the 25 MHz and 2.5 MHz rates used at 100M and 10M with PHY-managed
> delays.
> 
> Add a dedicated qcom,qcs615-ethqos match and descriptor and enable
> phy_managed_delays so rgmii-id uses the DLL-bypass configuration.
> 
> The bypass sequence has been tested on three QCS615 board designs,
> two with a Micrel KSZ9031 PHY and one with a TI DP83867 PHY. The
> existing compatible binding and qcom,qcs404-ethqos fallback remain
> unchanged.
> 
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>

Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>

> ---
> v4: this is a new commit which ensures that the phy managed delays only
> affect actually tested hardware (Shikra and QCS615).
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index a7fdba73da2b..790159ae1be7 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -250,6 +250,13 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = {
>  	.setup = ethqos_hlos_setup,
>  };
>  
> +static const struct ethqos_emac_driver_data qcs615_data = {
> +	.rgmii_config_loopback_en = true,
> +	.phy_managed_delays = true,
> +	.has_emac_ge_3 = false,
> +	.setup = ethqos_hlos_setup,
> +};
> +
>  static const struct ethqos_emac_por emac_v2_1_0_por[] = {
>  	{ .offset = RGMII_IO_MACRO_CONFIG,	.value = 0x40C01343 },
>  	{ .offset = SDCC_HC_REG_DLL_CONFIG,	.value = 0x2004642C },
> @@ -1116,6 +1123,7 @@ static int qcom_ethqos_probe(struct platform_device *pdev)
>  
>  static const struct of_device_id qcom_ethqos_match[] = {
>  	{ .compatible = "qcom,qcs404-ethqos", .data = &emac_v2_3_0_data},
> +	{ .compatible = "qcom,qcs615-ethqos", .data = &qcs615_data},
>  	{ .compatible = "qcom,sa8255p-ethqos", .data = &emac_v4_0_0_scmi_data},
>  	{ .compatible = "qcom,sa8775p-ethqos", .data = &emac_v4_0_0_data},
>  	{ .compatible = "qcom,sc8280xp-ethqos", .data = &emac_v3_0_0_data},
> 
> -- 
> 2.34.1
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

* Re: [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties
  2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
@ 2026-11-18 18:58   ` Rob Herring (Arm)
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Herring (Arm) @ 2026-11-18 18:58 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Eric Dumazet, Bjorn Andersson, Maxime Chevallier, Andrew Davis,
	David S. Miller, Lorenzo Bianconi, Giuseppe Cavallaro,
	linux-stm32, Alexandre Torgue, Maxime Coquelin, Paolo Abeni,
	linux-arm-msm, Richard Cochran, Andrew Lunn, Andrew Lunn,
	Jose Abreu, devicetree, Conor Dooley, Russell King, netdev,
	Konrad Dybcio, Jakub Kicinski, linux-kernel, Krzysztof Kozlowski,
	linux-arm-kernel, Heiner Kallweit


On Tue, 17 Nov 2026 14:15:21 +0530, Mohd Ayaan Anwar wrote:
> The DP83867 PHY has four distinct power supplies:
> 
>   VDDA2P5 -- 2.5V analog supply
>   VDD1P0  -- 1.0V digital supply
>   VDDA1P8 -- 1.8V analog supply
>   VDDIO   -- I/O supply, which can be 3.3V or 2.5V or 1.8V
> 
> The DP83867E/IS/CS datasheet (section 8.3) describes two power supply
> configurations - "two-supply" and "three-supply".
> 
>   1. Two-Supply Configuration: VDDA2P5 and VDD1P0 connected, and the
>      VDDA1P8 pins are left unconnected.
>   2. Three-Supply Configuration: VDDA2P5, VDD1P0 and VDDA1P8 are all
>      connected.
> 
> VDDIO is a separate fourth supply present in both configurations. The
> datasheet specifies that it can either be 1.8V or 2.5V or 3.3V.
> 
> Some embedded board design expose a GPIO-controlled regulator to control
> any one or more of these supplies. Therefore, document all four of the
> available supply properties.
> 
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
> ---
> v4: This patch was accidentally dropped in v3. It has been re-added
> as-is from v2.
> ---
>  Documentation/devicetree/bindings/net/ti,dp83867.yaml | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible
  2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
@ 2026-11-18 19:07   ` Rob Herring
  2026-11-20 11:45   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: Rob Herring @ 2026-11-18 19:07 UTC (permalink / raw)
  To: Mohd Ayaan Anwar
  Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Krzysztof Kozlowski, Conor Dooley, Andrew Davis,
	Andrew Lunn, Heiner Kallweit, Russell King, Richard Cochran,
	Bjorn Andersson, Konrad Dybcio, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Maxime Chevallier,
	Maxime Coquelin, Lorenzo Bianconi, netdev, devicetree,
	linux-kernel, linux-arm-msm, linux-stm32, linux-arm-kernel

On Tue, Nov 17, 2026 at 02:15:23PM +0530, Mohd Ayaan Anwar wrote:
> Shikra's EMAC requires two additional clocks for NOC interconnect
> access (axi-noc, pcie-tile-axi-noc) beyond the standard four, and an
> OPP table with required-opps to vote VDD_CX to SVS when the NOC clocks
> are enabled.
> 
> Add qcom,shikra-ethqos to the compatible enum and use an if/else
> block to constrain Shikra to exactly six clocks and require
> operating-points-v2 and power-domains, while leaving existing
> compatibles unchanged.
> 
> Add the relevant compatible to the binding document for snps,dwmac as
> well.
> 
> Signed-off-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
> ---
> v4: moved operating-points description to the top-level, and added
> power-domains as a required property for Shikra.
> ---
>  .../devicetree/bindings/net/qcom,ethqos.yaml       | 54 ++++++++++++++++++++--
>  .../devicetree/bindings/net/snps,dwmac.yaml        |  2 +
>  2 files changed, 52 insertions(+), 4 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> index ef520f810577..6bd4bded650a 100644
> --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> @@ -14,9 +14,6 @@ description:
>    dwmmac based Qualcomm ethernet devices which support Gigabit
>    ethernet (version v2.3.0 and onwards).
>  
> -allOf:
> -  - $ref: snps,dwmac.yaml#
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -32,6 +29,7 @@ properties:
>            - qcom,qcs404-ethqos
>            - qcom,sa8775p-ethqos
>            - qcom,sc8280xp-ethqos
> +          - qcom,shikra-ethqos
>            - qcom,sm8150-ethqos
>  
>    reg:
> @@ -57,9 +55,11 @@ properties:
>        - const: sfty
>  
>    clocks:
> -    maxItems: 4
> +    minItems: 4
> +    maxItems: 6
>  
>    clock-names:
> +    minItems: 4
>      items:
>        - const: stmmaceth
>        - const: pclk
> @@ -67,6 +67,8 @@ properties:
>        - enum:
>            - rgmii
>            - phyaux
> +      - const: axi-noc
> +      - const: pcie-tile-axi-noc

These sound like inter-connect clocks. Shouldn't they be controlled by 
a interconnect driver?

>  
>    iommus:
>      maxItems: 1
> @@ -81,6 +83,14 @@ properties:
>        - const: cpu-mac
>        - const: mac-mem
>  
> +  operating-points-v2:
> +    description: |
> +      For Shikra, the OPP table specifies the rates for the NOC access
> +      clocks in "stmmaceth", "axi-noc", "pcie-tile-axi-noc" order.
> +
> +  opp-table:
> +    type: object
> +
>    phys: true
>  
>    phy-names:
> @@ -95,6 +105,42 @@ required:
>    - clock-names
>    - reg-names
>  
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,shikra-ethqos
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 6
> +        clock-names:
> +          items:
> +            - const: stmmaceth
> +            - const: pclk
> +            - const: ptp_ref
> +            - const: rgmii
> +            - const: axi-noc
> +            - const: pcie-tile-axi-noc

No need to repeat the names here. Just 'minItems: 6'. I suppose you 
might also want:

contains:
  const: rgmii

> +      required:
> +        - operating-points-v2
> +        - power-domains
> +    else:
> +      properties:
> +        clocks:
> +          maxItems: 4
> +        clock-names:
> +          items:
> +            - const: stmmaceth
> +            - const: pclk
> +            - const: ptp_ref
> +            - enum:
> +                - rgmii
> +                - phyaux

Just 'minItems: 4'

Rob

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

* Re: [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management
  2026-11-17  8:45 ` [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
@ 2026-11-20 11:45   ` netdev-bot+sashiko
  0 siblings, 0 replies; 22+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 11:45 UTC (permalink / raw)
  To: mohd.anwar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, afd, andrew, hkallweit1, linux, richardcochran,
	andersson, konradybcio, alexandre.torgue, peppe.cavallaro,
	joabreu, maxime.chevallier, mcoquelin.stm32, lorenzo.bianconi,
	netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 1 · Low: 2

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] The supplies are only enabled from the phy_driver probe
  (dp83867_probe() -> dp83867_power_on(), drivers/net/phy/dp83867.c:769…
- [Low] The commit message says "When any supply is newly enabled the
  driver sleeps for 200 ms".
- [Low] dp83867_power_on() turns on the DP83867 rails after phylib has
  already released the PHY's reset GPIO.

--

net: phy: dp83867: add regulator supply management

This adds dp83867_power_on(), called at the start of dp83867_probe(). It
enables up to four optional supplies (vdda-2p5, vdd-1p0, vdda-1p8, vddio)
with devm_regulator_get_enable_optional(). If any supply is described, the
driver then sleeps 200 ms for the post power-up stabilisation time given
in datasheet section 6.6.

> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
> index b4b4931c6f8ce..ed8b3089e8e0b 100644
> --- a/drivers/net/phy/dp83867.c
> +++ b/drivers/net/phy/dp83867.c

[ ... ]

> @@ -730,11 +731,45 @@ static int dp83867_resume(struct phy_device *phydev)
>  	return 0;
>  }
>  
> +static int dp83867_power_on(struct phy_device *phydev)
> +{
> +	static const char * const supply_names[] = {
> +		"vdda-2p5", "vdd-1p0", "vdda-1p8", "vddio",
> +	};
> +	struct device *dev = &phydev->mdio.dev;
> +	bool supplies_enabled = false;
> +	int i, ret;
> +
> +	if (!IS_ENABLED(CONFIG_REGULATOR))
> +		return 0;
> +
> +	for (i = 0; i < ARRAY_SIZE(supply_names); i++) {
> +		ret = devm_regulator_get_enable_optional(dev, supply_names[i]);

[Severity: Low]
How does this interact with boards that describe both reset-gpios and
these switched rails? By the time dp83867_probe() runs, phylib has already
released the PHY reset line twice:

phy_device_register()
    phy_device_reset(phydev, 0);

phy_probe()
    phy_device_reset(phydev, 0);
    ...
    err = phydev->drv->probe(phydev);
        dp83867_probe()
            dp83867_power_on()
                devm_regulator_get_enable_optional()

So the reset pulse and its reset-deassert-us wait happen while the PHY is
unpowered. The rails then come up with RESET_N already high, and the PHY
depends on its internal power-on reset. That may well be tolerated, but
the reset pulse described for the board has no effect.

There is also the gap between phy_device_register() and the supply enable
in probe, which can be long if the regulator provider defers. During that
time the deasserted reset GPIO drives a high level into a chip whose VDDIO
domain may still be off. Could that back-power the chip through its pin
protection diodes?

Would it make sense to call phy_device_reset(phydev, 1) before enabling
the supplies and phy_device_reset(phydev, 0) after the stabilisation
delay?

> +		if (ret == -ENODEV)
> +			continue;
> +		if (ret)
> +			return dev_err_probe(dev, ret,
> +					     "failed to enable %s supply\n",
> +					     supply_names[i]);
> +		supplies_enabled = true;
> +	}
> +
> +	/* Datasheet section 6.6 suggests a 200ms post power-up stabilization */
> +	if (supplies_enabled)
> +		fsleep(200000);

[Severity: Low]
The commit message says:

    When any supply is newly enabled the driver sleeps for 200 ms before
    returning.

Is that accurate? supplies_enabled is set for every described supply where
devm_regulator_get_enable_optional() returns 0. The regulator core returns
0 whether or not the rail was already on, for example with
regulator-always-on, regulator-boot-on, a rail shared with another
consumer, or a rail left on by the bootloader.

So the 200 ms sleep runs on every probe of any board that describes at
least one supply. It also runs again on each re-probe after a later
-EPROBE_DEFER from dp83867_of_init(), such as the nvmem cell lookup in
dp83867_of_init_io_impedance().

Should the code check regulator_is_enabled() before enabling? Or should
the commit message say the delay applies whenever any supply is
described?

> +
> +	return 0;
> +}
> +
>  static int dp83867_probe(struct phy_device *phydev)
>  {
>  	struct dp83867_private *dp83867;
>  	int ret;
>  
> +	ret = dp83867_power_on(phydev);
> +	if (ret)
> +		return ret;

[Severity: Medium]
Is this reached when the rails start out off? dp83867_probe() only runs
after the MDIO core has created a phy_device and matched it by PHY ID.

If the PHY node has no ethernet-phy-idXXXX.XXXX compatible, that ID is
read from the PHY over MDIO before any driver code runs:

of_mdiobus_register()
  __of_mdiobus_parse_phys()
    of_mdiobus_register_phy()
      fwnode_mdiobus_register_phy()
        if (is_c45 || fwnode_get_phy_id(child, &phy_id))
            phy = get_phy_device(bus, addr, is_c45);
          get_phy_c22_id()
            if ((*phy_id & 0x1fffffff) == 0x1fffffff)
                return -ENODEV;

The GPIO-controlled rails can be off at scan time, either because the
hardware defaults them off or because a non-boot-on fixed regulator has
already driven its enable GPIO low. In that case the ID reads back as all
ones and __of_mdiobus_parse_phys() only logs:

    "MDIO device at address %d is missing.\n"

No phy_device is created. dp83867_probe() and dp83867_power_on() never
run, so the supplies are never enabled and the PHY is never detected.

The companion binding patch "dt-bindings: net: ti,dp83867: add supply
properties" allows the four supply properties on a node that only
requires reg, and its example has no compatible. With the ID compatible,
fwnode_mdiobus_register_phy() calls phy_device_create() and skips the
MDIO read.

Should the binding require, or at least document, the
ethernet-phy-id2000.a231 compatible when supplies are described?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

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

* Re: [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible
  2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
  2026-11-18 19:07   ` Rob Herring
@ 2026-11-20 11:45   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 11:45 UTC (permalink / raw)
  To: mohd.anwar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, afd, andrew, hkallweit1, linux, richardcochran,
	andersson, konradybcio, alexandre.torgue, peppe.cavallaro,
	joabreu, maxime.chevallier, mcoquelin.stm32, lorenzo.bianconi,
	netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] The commit message says the if/else block constrains Shikra
  "while leaving existing compatibles unchanged", but the schema now…
- [Low] The Shikra `then:` block (lines 116-130 of qcom,ethqos.yaml)
  requires exactly six clocks ending in `axi-noc`, `pcie-tile-axi-noc`…
- [Low] For Shikra, the `then:` branch of qcom,ethqos.yaml fixes clock
  index 3 to `const: rgmii` (line 125).

--

dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible

This adds a qcom,shikra-ethqos compatible to the qcom,ethqos and
snps,dwmac bindings. Shikra's EMAC needs two extra NOC clocks (axi-noc,
pcie-tile-axi-noc) and an OPP table to vote VDD_CX. An if/else block
limits Shikra to six clocks and requires operating-points-v2 and
power-domains.

> diff --git a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> index ef520f8105773..6bd4bded650a4 100644
> --- a/Documentation/devicetree/bindings/net/qcom,ethqos.yaml
> +++ b/Documentation/devicetree/bindings/net/qcom,ethqos.yaml

[ ... ]

> @@ -81,6 +83,14 @@ properties:
>        - const: cpu-mac
>        - const: mac-mem
>  
> +  operating-points-v2:
> +    description: |
> +      For Shikra, the OPP table specifies the rates for the NOC access
> +      clocks in "stmmaceth", "axi-noc", "pcie-tile-axi-noc" order.
> +
> +  opp-table:
> +    type: object
> +

[Severity: Low]
The commit message says the if/else block constrains Shikra "while
leaving existing compatibles unchanged". Is that true for these two
properties?

operating-points-v2 and opp-table are added to the top-level properties
without any compatible gating. The else branch further down only narrows
clocks and clock-names.

At the baseline, neither snps,dwmac.yaml nor any other binding under
bindings/net/ defined these properties, and this file ends with
unevaluatedProperties: false. An OPP table on a qcs404, qcs615, sa8775p,
qcs8300, sc8280xp or sm8150 ethqos node used to fail dtbs_check. With
this patch it passes.

The property description says it applies to Shikra. Later in the series,
the driver reads the OPP table only when num_noc_clks is set, which is
only the case for shikra_data.

Could the else branch add operating-points-v2: false and opp-table:
false? Or should the commit message be adjusted?

[ ... ]

> @@ -95,6 +105,42 @@ required:
>    - clock-names
>    - reg-names
>  
> +allOf:
> +  - $ref: snps,dwmac.yaml#
> +
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: qcom,shikra-ethqos
> +    then:
> +      properties:
> +        clocks:
> +          minItems: 6
> +        clock-names:
> +          items:
> +            - const: stmmaceth
> +            - const: pclk
> +            - const: ptp_ref
> +            - const: rgmii

[Severity: Low]
Does fixing the fourth clock to rgmii mean SGMII/serdes boards can't be
described on Shikra?

The top-level schema still allows phys and phy-names = serdes for
Shikra, but phyaux is rejected here.

The Shikra GCC exposes PHY AUX and SGMIIPHY RX/TX clocks for both EMACs:

drivers/clk/qcom/gcc-shikra.c:gcc_shikra_clocks[] {
    ...
	[GCC_EMAC0_PHY_AUX_CLK] = &gcc_emac0_phy_aux_clk.clkr,
    ...
}

The SGMII-capable ethqos SoCs (sa8775p and qcs8300, with link_clk_name =
"phyaux" in emac_v4_0_0_data) use these clocks for the serdes path.

On a Shikra board wired for SGMII through the serdes, a phyaux link
clock would fail dtbs_check. ethqos_hlos_setup() would also fetch
"rgmii", because shikra_data sets no link_clk_name:

	ethqos->link_clk = devm_clk_get(dev, ethqos->data->link_clk_name ?: "rgmii");

If SGMII is intentionally unsupported on Shikra, could the commit
message say so? If not, should this be an enum of rgmii and phyaux, as
it is for the other compatibles? Bindings are expected to describe the
hardware even where the driver lacks support.

> +            - const: axi-noc
> +            - const: pcie-tile-axi-noc

[Severity: Low]
Does every Shikra EMAC instance really need pcie-tile-axi-noc?

This then block requires all six clocks on every qcom,shikra-ethqos node
and does not distinguish the two EMAC instances.

In gcc-shikra.c, gcc_pcie_tile_axi_sys_noc_clk has gcc_emac0_axi_clk_src
as its only parent, with CLK_SET_RATE_PARENT:

	.name = "gcc_pcie_tile_axi_sys_noc_clk",
	.parent_hws = (const struct clk_hw*[]) {
		&gcc_emac0_axi_clk_src.clkr.hw,
	},
	.num_parents = 1,
	.flags = CLK_SET_RATE_PARENT,

EMAC1's own clocks, gcc_emac1_axi_clk and gcc_emac1_axi_sys_noc_clk, come
from a separate RCG, gcc_emac1_axi_clk_src.

To pass the schema, an EMAC1 node therefore has to reference a clock in
EMAC0's tree. Later in the series, qcom_ethqos_set_opp() calls
dev_pm_opp_set_opp() for EMAC1, and dev_pm_opp_config_clks_simple()
calls clk_set_rate() on that clock. The rate would propagate to EMAC0's
AXI RCG, and EMAC1 would keep that RCG enabled.

If EMAC1 has no PCIe-tile NOC path in hardware, should it be allowed
five clocks? If it does have one, could the commit message mention it?
This series adds no Shikra ethernet node to shikra.dtsi, so the intended
EMAC1 wiring can't be checked.

> +      required:
> +        - operating-points-v2
> +        - power-domains

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

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

* Re: [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays
  2026-11-17  8:45 ` [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays Mohd Ayaan Anwar
@ 2026-11-20 11:45   ` netdev-bot+sashiko
  0 siblings, 0 replies; 22+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 11:45 UTC (permalink / raw)
  To: mohd.anwar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, afd, andrew, hkallweit1, linux, richardcochran,
	andersson, konradybcio, alexandre.torgue, peppe.cavallaro,
	joabreu, maxime.chevallier, mcoquelin.stm32, lorenzo.bianconi,
	netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 1 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] In ethqos_set_clk_tx_rate()
  (drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c), the new…
- [Medium] Speculative: the new RGMII_ID DLL-bypass path returns before
  the POR reset loop in ethqos_fix_mac_speed_rgmii().

--

net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays

This adds a DLL-bypass programming path for RGMII_ID, where the PHY
supplies both TX and RX delays. The path is guarded by a new
phy_managed_delays flag in the platform descriptors. It also changes
ethqos_set_clk_tx_rate() so the link clock is not doubled at 100M/10M in
RGMII_ID mode.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index f2428f0467bbb..99ea7e0cfb00d 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

[ ... ]

> @@ -189,7 +193,15 @@ static int ethqos_set_clk_tx_rate(void *bsp_priv, struct clk *clk_tx_i,
>  	if (rate < 0)
>  		return rate;
>  
> -	return clk_set_rate(ethqos->link_clk, rate * 2);
> +	/* Clock Rate Requirements:
> +	 * MAC added delay: 250/50/5 MHz for 1G/100M/10M
> +	 * No MAC delay (DLL bypass): 250/25/2.5 MHz for 1G/100M/10M
> +	 */
> +	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
> +	    speed == SPEED_1000)
> +		rate *= 2;

[Severity: High]
Should this check also look at ethqos->data->phy_managed_delays?

In ethqos_fix_mac_speed_rgmii(), the bypass programming only runs when
both conditions are true:

	if (ethqos->data->phy_managed_delays &&
	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {

The existing descriptors don't set the flag. That covers emac_v2_3_0_data
(qcs404), emac_v2_1_0_data (sm8150), emac_v3_0_0_data (sc8280xp) and
emac_v4_0_0_data (sa8775p). With phy-mode "rgmii-id", these still take
the legacy POR/DLL path and call ethqos_rgmii_macro_init(). That function
always sets RGMII_CONFIG_DDR_MODE and programs the MAX_SPD_PRG_2/9
dividers.

The comment above says the MAC-delay setup needs 50/5 MHz. After this
patch, these boards would get 25/2.5 MHz at 100M/10M. Doesn't that
contradict this part of the commit message?

  "This new programming is guarded by a boolean set by the platform
  descriptors. No change intended on existing platforms."

A later patch in the series, "add QCS615 EMAC support", notes that unlike
QCS404, the QCS615 RGMII clock source supports the 25 MHz and 2.5 MHz
rates. So on QCS404 with rgmii-id, this could request rates the clock
source can't produce.

Another later patch, "set initial RGMII link clock to lowest speed",
changes the probe-time call to SPEED_10. Non-flagged rgmii-id platforms
would then also get the halved 2.5 MHz rate at probe. The issue is still
present at the end of the series.

Would it work to use the same predicate as the bypass path? For example:

	if (!(ethqos->data->phy_managed_delays &&
	      ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) ||
	    speed == SPEED_1000)
		rate *= 2;

> +
> +	return clk_set_rate(ethqos->link_clk, rate);
>  }

[ ... ]

> @@ -515,6 +527,58 @@ static void ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)

[ ... ]

> +static void ethqos_configure_rgmii_id(struct qcom_ethqos *ethqos, int speed)
> +{
> +	ethqos_set_func_clk_en(ethqos);
> +
> +	/* For rgmii-id mode, the PHY should add the required delays.
> +	 * Therefore, power down the DLL and program it in bypass mode.
> +	 * Program the IO_MACRO as per the settings recommended by the
> +	 * programming guide for bypass mode. This will ensure that the
> +	 * MAC core doesn't add any additional delays.
> +	 */
> +	rgmii_setmask(ethqos, SDCC_DLL_CONFIG_PDN, SDCC_HC_REG_DLL_CONFIG);
> +	rgmii_setmask(ethqos, SDCC_USR_CTL_DDR_BYPASS, SDCC_USR_CTL);

[Severity: Medium]
Can leftover MAC-side delay state still affect RX timing here?

The early return in ethqos_fix_mac_speed_rgmii() skips the POR reset
loop. The descriptors that use this path later in the series,
qcs615_data and shikra_data, have no rgmii_por table anyway.

This function only sets SDCC_DLL_CONFIG_PDN and SDCC_USR_CTL_DDR_BYPASS.
ethqos_rgmii_id_macro_init() only does partial read-modify-writes of
RGMII_IO_MACRO_CONFIG and RGMII_IO_MACRO_CONFIG2.

Nothing on this path does any of the following:

  - writes SDCC_HC_REG_DDR_CONFIG (PRG_DLY_EN, PRG_RCLK_DLY,
    EXT_PRG_RCLK_DLY_EN/CODE)
  - clears SDCC_DLL_CONFIG_DLL_EN or SDCC_DLL_CONFIG_CK_OUT_EN
  - programs RGMII_CONFIG_INTF_SEL or RGMII_CONFIG_MAX_SPD_PRG_2/9

These fields keep whatever hardware reset or an earlier boot stage left.
For example, UEFI may have brought the MAC up in DLL/MAC-delay mode for
network boot.

The has_emac_ge_3 POR value for SDCC_HC_REG_DDR_CONFIG (0x80040800) has
PRG_DLY_EN set, and Shikra is has_emac_ge_3.

If these fields still matter with the DLL powered down and DDR_BYPASS
set, wouldn't the MAC add RX delay on top of the PHY's delay? The result
would then depend on boot history. Would it be safer to clear them
explicitly here?

> +
> +	ethqos_rgmii_id_macro_init(ethqos, speed);
> +}

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

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

* Re: [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support
  2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
  2026-11-18  9:43   ` Lorenzo Bianconi
@ 2026-11-20 11:46   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 11:46 UTC (permalink / raw)
  To: mohd.anwar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, afd, andrew, hkallweit1, linux, richardcochran,
	andersson, konradybcio, alexandre.torgue, peppe.cavallaro,
	joabreu, maxime.chevallier, mcoquelin.stm32, lorenzo.bianconi,
	netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel

Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

Critical: 0 · High: 0 · Medium: 2 (1) · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [Medium] On Shikra, the DLL-bypass path is only used for phy-mode
  "rgmii-id", but nothing stops a DT from using another RGMII mode, and…
- [Medium] Putting "stmmaceth" in shikra_noc_clk_names (dwmac-qcom-
  ethqos.c:335-340) puts the stmmac-core-owned clock under OPP rate and…

Pre-existing issues:
- [Medium] This problem wasn't introduced by this patch, but by the
  earlier commit in this series "net: stmmac: qcom-ethqos: add DLL-…

--

net: stmmac: qcom-ethqos: add Shikra EMAC support

This adds the qcom,shikra-ethqos compatible and a new shikra_data
descriptor. The descriptor enables three NOC clocks whose rates are set
through an OPP table, sets a 36-bit DMA address width, and sets
phy_managed_delays so rgmii-id uses the DLL-bypass sequence.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index 15385750b3e6e..a7fdba73da2ba 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -332,6 +332,24 @@ static const struct ethqos_emac_driver_data emac_v4_0_0_scmi_data = {
>  	.setup = ethqos_scmi_setup,
>  };
>  
> +static const char * const shikra_noc_clk_names[] = {
> +	"stmmaceth",

[Severity: Medium]
Putting "stmmaceth" in this list places a clock that the stmmac core owns
under OPP rate and VDD_CX control. Is the enable ordering on resume safe?

ethqos_clks_config(false) drops the vote with dev_pm_opp_set_rate(dev, 0).
In drivers/opp/core.c, _set_opp() with a NULL opp goes to
_disable_opp_table(). That removes the bandwidth, level and required-opps
votes, but it never lowers the clock rates. So stmmaceth stays at its OPP
maximum rate after the CX vote is gone.

On resume, stmmac_bus_clks_config() enables that same clock before the
glue callback puts the vote back:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:stmmac_bus_clks_config() {
    ...
		ret = clk_prepare_enable(plat_dat->stmmac_clk);
    ...
		ret = clk_prepare_enable(plat_dat->pclk);
    ...
		if (plat_dat->clks_config) {
			ret = plat_dat->clks_config(plat_dat->bsp_priv, enabled);
    ...
}

ethqos_clks_config()->qcom_ethqos_set_opp() only runs after that. At
probe, stmmac_probe_config_dt() also enables stmmaceth before
ethqos_hlos_setup() votes.

The commit message says this is safe because "VDD_CX only needs to be
voted while DMA traffic is ongoing". However, the OPP required-opps
describe the CX corner a given clock frequency needs, whether or not
traffic is running.

Could stmmaceth be ungated at its OPP fmax while CX is at a lower corner?

For axi-noc and pcie-tile-axi-noc, the glue driver applies the vote
before enabling the clocks. Would it be better to do one of these
instead?

  - keep stmmaceth out of the OPP-managed set
  - lower its rate before dropping the vote
  - make sure the vote is in place before the core enables stmmac_clk

> +	"axi-noc",
> +	"pcie-tile-axi-noc",
> +	NULL,
> +};
> +
> +static const struct ethqos_emac_driver_data shikra_data = {
> +	.dma_addr_width = 36,
> +	.has_emac_ge_3 = true,
> +	.noc_clk_names = shikra_noc_clk_names,
> +	.num_noc_clks = ARRAY_SIZE(shikra_noc_clk_names) - 1,
> +	.rgmii_config_loopback_en = false,
> +	.phy_managed_delays = true,

[Severity: Medium]
This descriptor has phy_managed_delays but no rgmii_por table. What
happens if a Shikra DT uses phy-mode "rgmii", "rgmii-rxid" or
"rgmii-txid"?

ethqos_fix_mac_speed_rgmii() only takes the bypass for RGMII_ID:

	if (ethqos->data->phy_managed_delays &&
	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
		ethqos_configure_rgmii_id(ethqos, speed);
		return;
	}

Nothing limits Shikra to that mode:

  - qcom_ethqos_probe() accepts all four RGMII variants for every
    compatible.
  - ethqos_hlos_setup() installs ethqos_fix_mac_speed_rgmii() for all
    four.
  - The qcom,shikra-ethqos block in qcom,ethqos.yaml does not constrain
    phy-mode.

In those modes the generic DLL/IO-macro sequence runs. Its reset loop
does nothing, because num_rgmii_por is 0:

	/* Reset to POR values and enable clk */
	for (i = 0; i < ethqos->data->num_rgmii_por; i++)
		rgmii_writel(ethqos, ethqos->data->rgmii_por[i].value,
			     ethqos->data->rgmii_por[i].offset);

Every other HLOS RGMII descriptor has a 6-entry POR table. The
read-modify-write steps that follow depend on that reset:

  - ethqos_rgmii_macro_init() sets SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY and
    SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_EN at 10/100M, and
    SDCC_DDR_CONFIG_PRG_DLY_EN at 1G. Neither path clears the other's
    bits.
  - ethqos_dll_configure() sets DLL_EN/CDR_EN/CDR_EXT_EN at 1G, and the
    10/100 path does not clear them.

After a speed renegotiation, can both RX delay mechanisms end up enabled,
so the result depends on link-speed history?

The 1G prg_rclk_dly value of 115 also assumes a TCXO_CYCLES_CNT that
comes from the v3/v4 POR value 0x80040800. Shikra never writes that
value.

The commit message says "No POR table is needed for this intended bypass
operation", but neither the binding nor the driver enforces rgmii-id.
Would one of these be appropriate?

  - constrain phy-mode to rgmii-id for qcom,shikra-ethqos in the binding
  - reject the non-ID RGMII modes in the driver for descriptors without
    a POR table
  - add a Shikra POR table

The later patch in this series, "net: stmmac: qcom-ethqos: add QCS615
EMAC support", uses the same pattern for qcs615_data.

[Severity: Medium]
This is a pre-existing issue and was not introduced by this patch. It
comes from the earlier commit in this series, "net: stmmac: qcom-ethqos:
add DLL-bypass for PHY-managed RGMII delays".

ethqos_set_clk_tx_rate() picks the link clock rate from phy_mode alone:

	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
	    speed == SPEED_1000)
		rate *= 2;

ethqos_fix_mac_speed_rgmii() also requires data->phy_managed_delays
before it takes the bypass. Take a descriptor without phy_managed_delays
(emac_v2_1_0, v2_3_0, v3_0_0, v4_0_0) and phy-mode "rgmii-id". At
100M/10M, doesn't the MAC-delay sequence then run with a 25/2.5 MHz link
clock instead of the 50/5 MHz it expects?

That would not match "No change intended on existing platforms" in the
earlier commit. No in-tree qcom DT uses rgmii-id with these compatibles
today. Shikra sets phy_managed_delays, so this patch is consistent with
the clock-rate logic. Checking ethqos->data->phy_managed_delays in
ethqos_set_clk_tx_rate() would probably belong in the earlier commit.

> +	.dwmac4_addrs = &ethqos_dwmac4_addrs,
> +	.setup = ethqos_hlos_setup,
> +};

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

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

* Re: [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 EMAC support
  2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
  2026-11-18  9:44   ` Lorenzo Bianconi
@ 2026-11-20 11:46   ` netdev-bot+sashiko
  1 sibling, 0 replies; 22+ messages in thread
From: netdev-bot+sashiko @ 2026-11-20 11:46 UTC (permalink / raw)
  To: mohd.anwar
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, afd, andrew, hkallweit1, linux, richardcochran,
	andersson, konradybcio, alexandre.torgue, peppe.cavallaro,
	joabreu, maxime.chevallier, mcoquelin.stm32, lorenzo.bianconi,
	netdev, devicetree, linux-kernel, linux-arm-msm, linux-stm32,
	linux-arm-kernel

Thank you for your contribution! Sashiko AI review found 3 potential
issue(s) to consider.

Critical: 0 · High: 1 · Medium: 2 · Low: 0

If you believe none of the issues are legitimate, please reply to each
issue of Medium severity or higher and explain why the AI is wrong.
If any of them are legitimate and you plan to respin, please let patchwork
know by including "pw-bot: cr" as a separate line at the end of your reply
(one such reply per series is enough).

- [High] In drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c,
  ethqos_set_clk_tx_rate() decides whether to double the RGMII link…
- [Medium] In drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c,
  the new qcs615_data descriptor has no .rgmii_por/.num_rgmii_por,…
- [Medium] net: stmmac: qcom-ethqos: missing delay check in
  ethqos_set_clk_tx_rate()

--

net: stmmac: qcom-ethqos: add QCS615 EMAC support

This adds a qcom,qcs615-ethqos match entry and a qcs615_data descriptor
with phy_managed_delays enabled, so rgmii-id on QCS615 uses the
DLL-bypass configuration. Before this patch, QCS615 nodes bound to the
QCS404 descriptor through the qcom,qcs404-ethqos fallback compatible.

> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> index a7fdba73da2ba..790159ae1be7a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c
> @@ -250,6 +250,13 @@ static const struct ethqos_emac_driver_data emac_v2_3_0_data = {
>  	.setup = ethqos_hlos_setup,
>  };
>  
> +static const struct ethqos_emac_driver_data qcs615_data = {
> +	.rgmii_config_loopback_en = true,
> +	.phy_managed_delays = true,

[Severity: Medium]
This flag is meant to confine the new behaviour to tested hardware,
but does the link clock rate follow it as well?
ethqos_set_clk_tx_rate() decides whether to double the rate from
phy_mode alone:

	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
	    speed == SPEED_1000)
		rate *= 2;

ethqos_fix_mac_speed_rgmii(), by contrast, only takes the DLL-bypass
path when ethqos->data->phy_managed_delays is also set:

	if (ethqos->data->phy_managed_delays &&
	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
		ethqos_configure_rgmii_id(ethqos, speed);
		return;
	}

Take a descriptor without the flag (qcs404, sm8150, sc8280xp, sa8775p)
and phy-mode = "rgmii-id". The IO macro is still programmed through
ethqos_rgmii_macro_init() for the MAC-delay path, with
RGMII_CONFIG_DDR_MODE set and RGMII_CONFIG2_DATA_DIVIDE_CLK_SEL
cleared. That path wants 50/5 MHz at 100M/10M, but the link clock is
asked for 25/2.5 MHz instead.

As far as I can see this is also hit at probe, where
ethqos_hlos_setup() requests the SPEED_10 rate before any link comes
up.

This commit message says the QCS404 RGMII clock source cannot provide
those rates. ftbl_emac_clk_src in drivers/clk/qcom/gcc-qcs404.c only
lists 5, 50, 125 and 250 MHz. On SM8150, link_clk would end up at half
the rate the non-bypass configuration expects.

Shouldn't the doubling be skipped only under the same condition that
ethqos_fix_mac_speed_rgmii() uses, i.e. phy_managed_delays set and
phy_mode == PHY_INTERFACE_MODE_RGMII_ID? Or is there a reason the
earlier DLL-bypass patch in this series made the rate depend on
phy_mode only?

[Severity: High]
The v4 note says phy-managed delays should only affect tested hardware
(Shikra and QCS615). Does that also hold for the link clock rate?

ethqos_set_clk_tx_rate() chooses the bypass rate from phy_mode alone. It
never checks phy_managed_delays:

drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c:ethqos_set_clk_tx_rate() {
    ...
	/* Clock Rate Requirements:
	 * MAC added delay: 250/50/5 MHz for 1G/100M/10M
	 * No MAC delay (DLL bypass): 250/25/2.5 MHz for 1G/100M/10M
	 */
	if (ethqos->phy_mode != PHY_INTERFACE_MODE_RGMII_ID ||
	    speed == SPEED_1000)
		rate *= 2;
    ...
}

ethqos_fix_mac_speed_rgmii() takes the bypass only when the flag is set:

	if (ethqos->data->phy_managed_delays &&
	    ethqos->phy_mode == PHY_INTERFACE_MODE_RGMII_ID) {
		ethqos_configure_rgmii_id(ethqos, speed);
		return;
	}

Take a descriptor without the flag (emac_v2_3_0_data, emac_v2_1_0_data,
emac_v3_0_0_data, emac_v4_0_0_data) and phy-mode = "rgmii-id". At 100M
and 10M, the IO macro is programmed for the DLL/MAC-delay path. The link
clock, though, is set to 25/2.5 MHz, not the 50/5 MHz that the comment
says this path needs.

This commit's message also says the QCS404 RGMII clock source does not
support 25 MHz and 2.5 MHz.

The unconditional halving came from the earlier commit in this series,
"net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays".
That commit said "No change intended on existing platforms". Before it,
clk_set_rate(link_clk, rate * 2) was always used.

Could the rate check also be gated on ethqos->data->phy_managed_delays,
using the same condition as ethqos_fix_mac_speed_rgmii()?

> +	.has_emac_ge_3 = false,
> +	.setup = ethqos_hlos_setup,
> +};

[Severity: Medium]
Should qcs615_data also carry the POR table from emac_v2_3_0_data?

static const struct ethqos_emac_driver_data emac_v2_3_0_data = {
	.rgmii_por = emac_v2_3_0_por,
	.num_rgmii_por = ARRAY_SIZE(emac_v2_3_0_por),
	...

The binding requires QCS615 nodes to use "qcom,qcs615-ethqos",
"qcom,qcs404-ethqos". Until now they matched emac_v2_3_0_data through the
fallback. The new, more specific qcom_ethqos_match entry now binds them
to qcs615_data, where num_rgmii_por == 0.

Only phy-mode = "rgmii-id" takes the bypass early return. For "rgmii",
"rgmii-txid" and "rgmii-rxid", ethqos_fix_mac_speed_rgmii() still runs
the full DLL/MAC-delay sequence, but this loop now does nothing:

	/* Reset to POR values and enable clk */
	for (i = 0; i < ethqos->data->num_rgmii_por; i++)
		rgmii_writel(ethqos, ethqos->data->rgmii_por[i].value,
			     ethqos->data->rgmii_por[i].offset);

That leaves RGMII_IO_MACRO_CONFIG, SDCC_HC_REG_DLL_CONFIG,
SDCC_HC_REG_DDR_CONFIG, SDCC_HC_REG_DLL_CONFIG2, SDCC_USR_CTL and
RGMII_IO_MACRO_CONFIG2 to be read-modify-written on top of whatever the
bootloader or the previous link-up left in them.

The rest of the sequence sets bits for one speed and does not clear the
other speed's bits:

- ethqos_rgmii_macro_init() sets SDCC_DDR_CONFIG_EXT_PRG_RCLK_DLY_EN at
  10/100 and SDCC_DDR_CONFIG_PRG_DLY_EN at 1G.
- The 1G path also sets DLL_EN and CK_OUT_EN in DLL_CONFIG, bit 26 of
  USR_CTL, and DDR_CAL_EN, MCLK_FREQ_CALC and TRAFFIC_INIT in
  DLL_CONFIG2.

Only the POR write clears these bits.

After a renegotiation from 1G to 100M (or from 100M to 1G), wouldn't both
RX delay enables stay set, along with the 1G DLL settings?

The commit message says:

    The existing compatible binding and qcom,qcs404-ethqos fallback
    remain unchanged.

But the descriptor those DTs bind to does change, and only the rgmii-id
bypass path was tested.

Would adding the following to qcs615_data keep the previous behaviour for
the non-bypass modes?

	.rgmii_por = emac_v2_3_0_por,
	.num_rgmii_por = ARRAY_SIZE(emac_v2_3_0_por),

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261117-shikra_ethernet-v4-0-c41902e5f2fa%40oss.qualcomm.com

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

end of thread, other threads:[~2026-11-20 11:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-17  8:45 [PATCH net-next v4 00/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 01/10] dt-bindings: net: ti,dp83867: add supply properties Mohd Ayaan Anwar
2026-11-18 18:58   ` Rob Herring (Arm)
2026-11-17  8:45 ` [PATCH net-next v4 02/10] net: phy: dp83867: add regulator supply management Mohd Ayaan Anwar
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 03/10] dt-bindings: net: qcom,ethqos: add qcom,shikra-ethqos compatible Mohd Ayaan Anwar
2026-11-18 19:07   ` Rob Herring
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 04/10] net: stmmac: qcom-ethqos: convert ethqos_rgmii_macro_init() to void Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 05/10] net: stmmac: qcom-ethqos: add DLL-bypass for PHY-managed RGMII delays Mohd Ayaan Anwar
2026-11-20 11:45   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 06/10] net: stmmac: qcom-ethqos: set initial RGMII link clock to lowest speed Mohd Ayaan Anwar
2026-11-18  9:13   ` Lorenzo Bianconi
2026-11-17  8:45 ` [PATCH net-next v4 07/10] net: stmmac: qcom-ethqos: share common GMAC4 address table Mohd Ayaan Anwar
2026-11-17  8:45 ` [PATCH net-next v4 08/10] net: stmmac: qcom-ethqos: add per-platform NOC clock voting Mohd Ayaan Anwar
2026-11-18  9:40   ` Lorenzo Bianconi
2026-11-17  8:45 ` [PATCH net-next v4 09/10] net: stmmac: qcom-ethqos: add Shikra EMAC support Mohd Ayaan Anwar
2026-11-18  9:43   ` Lorenzo Bianconi
2026-11-20 11:46   ` netdev-bot+sashiko
2026-11-17  8:45 ` [PATCH net-next v4 10/10] net: stmmac: qcom-ethqos: add QCS615 " Mohd Ayaan Anwar
2026-11-18  9:44   ` Lorenzo Bianconi
2026-11-20 11:46   ` netdev-bot+sashiko

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