Devicetree
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support
@ 2026-09-07  7:46 Jia Wang
  2026-09-07  7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo, Conor Dooley

The UltraRISC DP1000 integrates a Synopsys DesignWare GMAC from the 5.20
series with fixed internal delays on both TX and RX RGMII clock paths.

For boards without PCB delays, "rgmii-id" describes the link. Passing this
mode unchanged to the PHY would enable another pair of delays and break
RGMII timing.

Add TX and RX internal-delay capability flags to the common stmmac platform
data and adjust the PHY interface mode in stmmac_pltfr_probe(). Convert the
Sophgo and EIC7700 glue drivers to this common handling, then add the DP1000
binding and glue driver. The DP1000 glue driver only declares both delay
capabilities.

Tested with:

1. dt_binding_check and dtbs_check.
2. RISC-V build with CONFIG_DWMAC_ULTRARISC=m.
3. Runtime validation on Shenzhen Rongda M0 with a YT8531S PHY and
   Milk-V Titan with an RTL8211F PHY: ultrarisc-dwmac binds and
   establishes a 1000 Mb/s full-duplex link on both boards.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
Changes in v2:
- Fold the snps,dwmac compatible-list update into the DP1000 binding patch.
- Add common stmmac capability flags for MAC-provided RGMII delays.
- Convert Sophgo and EIC7700 to the common RGMII delay handling.
- Simplify the DP1000 glue driver to declare its TX and RX delay
  capabilities.
- Add Conor Dooley's Reviewed-by tag to the DP1000 binding patch.
- Link to v1: https://patch.msgid.link/20260901-dwmac-ultrarisc-v1-0-f19454814bcf@ultrarisc.com

To: Andrew Lunn <andrew+netdev@lunn.ch>
To: "David S. Miller" <davem@davemloft.net>
To: Eric Dumazet <edumazet@google.com>
To: Jakub Kicinski <kuba@kernel.org>
To: Paolo Abeni <pabeni@redhat.com>
To: Rob Herring <robh@kernel.org>
To: Krzysztof Kozlowski <krzk+dt@kernel.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Jia Wang <wangjia@ultrarisc.com>
To: Alexandre Torgue <alexandre.torgue@foss.st.com>
To: Giuseppe Cavallaro <peppe.cavallaro@st.com>
To: Jose Abreu <joabreu@synopsys.com>
To: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Maxime Coquelin <mcoquelin.stm32@gmail.com>
To: Chen Wang <chen.wang@linux.dev>
To: Inochi Amaoto <inochiama@gmail.com>
Cc: netdev@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-stm32@st-md-mailman.stormreply.com
Cc: linux-arm-kernel@lists.infradead.org
Cc: sophgo@lists.linux.dev

---
Jia Wang (5):
      net: stmmac: Add common internal RGMII delay handling
      net: stmmac: sophgo: Use common RGMII delay handling
      net: stmmac: eic7700: Use common RGMII delay handling
      dt-bindings: net: Add UltraRISC DP1000 GMAC
      net: stmmac: Add UltraRISC DP1000 GMAC support

 .../devicetree/bindings/net/snps,dwmac.yaml        |  1 +
 .../bindings/net/ultrarisc,dp1000-gmac.yaml        | 74 ++++++++++++++++++++++
 MAINTAINERS                                        |  6 ++
 drivers/net/ethernet/stmicro/stmmac/Kconfig        | 11 ++++
 drivers/net/ethernet/stmicro/stmmac/Makefile       |  1 +
 .../net/ethernet/stmicro/stmmac/dwmac-eic7700.c    | 13 +---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c | 12 ++--
 .../net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c  | 52 +++++++++++++++
 .../net/ethernet/stmicro/stmmac/stmmac_platform.c  | 11 ++++
 include/linux/stmmac.h                             |  2 +
 10 files changed, 164 insertions(+), 19 deletions(-)
---
base-commit: df2908090cda368b01ff43709f51890076c56157
change-id: 20260827-dwmac-ultrarisc-7c79f2f80fd1

Best regards,
--  
Jia Wang <wangjia@ultrarisc.com>


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

* [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
@ 2026-09-07  7:46 ` Jia Wang
  2026-09-07 11:44   ` Maxime Chevallier
  2026-09-07  7:46 ` [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common " Jia Wang
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo

Some DWMAC integrations add fixed RGMII clock delays internally.
Glue drivers need to account for these delays before passing the
interface mode to the PHY.

Add TX and RX delay capability flags to the common platform data.
Apply phy_fix_phy_mode_for_mac_delays() in stmmac_pltfr_probe() when
either capability is present.

This lets glue drivers describe the MAC capabilities without
duplicating the interface-mode validation and conversion.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +++++++++++
 include/linux/stmmac.h                                |  2 ++
 2 files changed, 13 insertions(+)

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 6128ed1bd521..93b9af203a18 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -16,6 +16,7 @@
 #include <linux/of.h>
 #include <linux/of_net.h>
 #include <linux/of_mdio.h>
+#include <linux/phy.h>
 
 #include "stmmac.h"
 #include "stmmac_platform.h"
@@ -847,6 +848,16 @@ int stmmac_pltfr_probe(struct platform_device *pdev,
 		       struct plat_stmmacenet_data *plat,
 		       struct stmmac_resources *res)
 {
+	if (plat->has_internal_tx_delay || plat->has_internal_rx_delay) {
+		plat->phy_interface =
+			phy_fix_phy_mode_for_mac_delays(plat->phy_interface,
+							plat->has_internal_tx_delay,
+							plat->has_internal_rx_delay);
+		if (plat->phy_interface == PHY_INTERFACE_MODE_NA)
+			return dev_err_probe(&pdev->dev, -EINVAL,
+					     "unsupported phy interface mode\n");
+	}
+
 	if (!plat->suspend && plat->exit)
 		plat->suspend = stmmac_plat_suspend;
 	if (!plat->resume && plat->init)
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 4430b967abde..00be2df63d22 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -242,6 +242,8 @@ struct plat_stmmacenet_data {
 	 * that phylink uses.
 	 */
 	phy_interface_t phy_interface;
+	bool has_internal_tx_delay;
+	bool has_internal_rx_delay;
 	struct stmmac_mdio_bus_data *mdio_bus_data;
 	struct device_node *phy_node;
 	struct device_node *mdio_node;

-- 
2.34.1


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

* [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common RGMII delay handling
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
  2026-09-07  7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
@ 2026-09-07  7:46 ` Jia Wang
  2026-09-07 11:45   ` Maxime Chevallier
  2026-09-07  7:46 ` [PATCH net-next v2 3/5] net: stmmac: eic7700: " Jia Wang
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo

Describe the SG2042 internal RX delay through the common stmmac
platform data and let stmmac_pltfr_probe() adjust the PHY interface
mode.

This removes the duplicated mode conversion without changing the
hardware behavior.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
index e02ad3762b5f..f62c803665ad 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c
@@ -55,14 +55,10 @@ static int sophgo_dwmac_probe(struct platform_device *pdev)
 		return ret;
 
 	data = device_get_match_data(&pdev->dev);
-	if (data && data->has_internal_rx_delay) {
-		plat_dat->phy_interface = phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface,
-									  false, true);
-		if (plat_dat->phy_interface == PHY_INTERFACE_MODE_NA)
-			return -EINVAL;
-	}
-
-	return stmmac_dvr_probe(dev, plat_dat, &stmmac_res);
+	if (data)
+		plat_dat->has_internal_rx_delay = data->has_internal_rx_delay;
+
+	return stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
 }
 
 static const struct sophgo_dwmac_data sg2042_dwmac_data = {

-- 
2.34.1


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

* [PATCH net-next v2 3/5] net: stmmac: eic7700: Use common RGMII delay handling
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
  2026-09-07  7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
  2026-09-07  7:46 ` [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common " Jia Wang
@ 2026-09-07  7:46 ` Jia Wang
  2026-09-07 11:46   ` Maxime Chevallier
  2026-09-07  7:46 ` [PATCH net-next v2 4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC Jia Wang
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo

Describe the EIC7700 inherent TX delay through the common stmmac
platform data and let stmmac_pltfr_probe() adjust the PHY interface
mode.

Keep the existing programmable TX and RX delay configuration in the
EIC7700 glue driver.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
index eab8c13fbdcc..0d654ec07f33 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-eic7700.c
@@ -198,18 +198,9 @@ static int eic7700_dwmac_probe(struct platform_device *pdev)
 	/*
 	 * The MAC silicon unconditionally adds ~2 ns TX delay; prevent
 	 * the PHY from also adding TX delay to avoid doubling it.
-	 *
-	 * DT specifies rgmii-id (TX from MAC silicon, RX from PHY);
-	 * override to rgmii-rxid so the PHY only adds its RX delay.
+	 * The common platform code adjusts the PHY interface accordingly.
 	 */
-	if (data->has_internal_tx_delay) {
-		plat_dat->phy_interface =
-				 phy_fix_phy_mode_for_mac_delays(plat_dat->phy_interface,
-								 true, false);
-		if (plat_dat->phy_interface == PHY_INTERFACE_MODE_NA)
-			return dev_err_probe(&pdev->dev, -EINVAL,
-				"phy interface mode is NA\n");
-	}
+	plat_dat->has_internal_tx_delay = data->has_internal_tx_delay;
 
 	/* Read rx-internal-delay-ps and update rx_clk delay */
 	if (!of_property_read_u32(pdev->dev.of_node,

-- 
2.34.1


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

* [PATCH net-next v2 4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
                   ` (2 preceding siblings ...)
  2026-09-07  7:46 ` [PATCH net-next v2 3/5] net: stmmac: eic7700: " Jia Wang
@ 2026-09-07  7:46 ` Jia Wang
  2026-09-07  7:46 ` [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
  2026-09-10  8:50 ` [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support patchwork-bot+netdevbpf
  5 siblings, 0 replies; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo, Conor Dooley

The DP1000 integrates a Synopsys DesignWare GMAC from the 5.20 series with
one MMIO register range, one clock and one interrupt.

It also provides fixed TX and RX RGMII clock delays that cannot be
disabled. Board connections must therefore not add either delay in PCB
traces, making "rgmii-id" the only supported phy-mode.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../devicetree/bindings/net/snps,dwmac.yaml        |  1 +
 .../bindings/net/ultrarisc,dp1000-gmac.yaml        | 74 ++++++++++++++++++++++
 MAINTAINERS                                        |  5 ++
 3 files changed, 80 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 2449311c6d28..2ed4564ae99d 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -119,6 +119,7 @@ properties:
         - starfive,jh7110-dwmac
         - tesla,fsd-ethqos
         - thead,th1520-gmac
+        - ultrarisc,dp1000-gmac
 
   reg:
     minItems: 1
diff --git a/Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml b/Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml
new file mode 100644
index 000000000000..13029302877b
--- /dev/null
+++ b/Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/net/ultrarisc,dp1000-gmac.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: UltraRISC DP1000 DWMAC Ethernet controller
+
+maintainers:
+  - Jia Wang <wangjia@ultrarisc.com>
+
+description:
+  The DP1000 integrates a Synopsys DesignWare GMAC controller from the
+  5.20 series. The SoC integration adds fixed RGMII TX and RX clock delays
+  which cannot be disabled. Consequently, a functional RGMII link requires
+  a PCB without TX or RX clock delays, represented by "rgmii-id".
+
+select:
+  properties:
+    compatible:
+      contains:
+        const: ultrarisc,dp1000-gmac
+  required:
+    - compatible
+
+properties:
+  compatible:
+    items:
+      - const: ultrarisc,dp1000-gmac
+      - const: snps,dwmac-5.20
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    const: stmmaceth
+
+  interrupts:
+    maxItems: 1
+
+  interrupt-names:
+    const: macirq
+
+  phy-mode:
+    const: rgmii-id
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+  - phy-mode
+
+allOf:
+  - $ref: snps,dwmac.yaml#
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    ethernet@38000000 {
+        compatible = "ultrarisc,dp1000-gmac", "snps,dwmac-5.20";
+        reg = <0x38000000 0x1000000>;
+        clocks = <&clk 0>;
+        clock-names = "stmmaceth";
+        interrupts = <84>;
+        interrupt-names = "macirq";
+        phy-mode = "rgmii-id";
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 6215fcb07770..01597d1df270 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -27995,6 +27995,11 @@ F:	Documentation/devicetree/bindings/clock/ultrarisc,dp1000-clk.yaml
 F:	drivers/clk/ultrarisc/*
 F:	include/dt-bindings/clock/ultrarisc,dp1000-clk.h
 
+ULTRARISC DP1000 DWMAC GLUE LAYER
+M:	Jia Wang <wangjia@ultrarisc.com>
+S:	Maintained
+F:	Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml
+
 ULTRARISC DP1000 PINCTRL DRIVER
 M:	Jia Wang <wangjia@ultrarisc.com>
 L:	linux-gpio@vger.kernel.org

-- 
2.34.1


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

* [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
                   ` (3 preceding siblings ...)
  2026-09-07  7:46 ` [PATCH net-next v2 4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC Jia Wang
@ 2026-09-07  7:46 ` Jia Wang
  2026-09-07 11:48   ` Maxime Chevallier
  2026-09-10  8:50 ` [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support patchwork-bot+netdevbpf
  5 siblings, 1 reply; 11+ messages in thread
From: Jia Wang @ 2026-09-07  7:46 UTC (permalink / raw)
  To: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	Jia Wang, sophgo

The UltraRISC DP1000 GMAC provides fixed internal delays on both TX and RX
RGMII clock paths.

Add a platform glue driver and describe both delay capabilities through
the common stmmac platform data. This lets the common RGMII delay handling
adjust the interface mode passed to the PHY and reject incompatible RGMII
modes.

Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
---
 MAINTAINERS                                        |  1 +
 drivers/net/ethernet/stmicro/stmmac/Kconfig        | 11 +++++
 drivers/net/ethernet/stmicro/stmmac/Makefile       |  1 +
 .../net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c  | 52 ++++++++++++++++++++++
 4 files changed, 65 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 01597d1df270..d6fb876227e9 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -27999,6 +27999,7 @@ ULTRARISC DP1000 DWMAC GLUE LAYER
 M:	Jia Wang <wangjia@ultrarisc.com>
 S:	Maintained
 F:	Documentation/devicetree/bindings/net/ultrarisc,dp1000-gmac.yaml
+F:	drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
 
 ULTRARISC DP1000 PINCTRL DRIVER
 M:	Jia Wang <wangjia@ultrarisc.com>
diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig
index e3dd5adda5ac..ab3c4cf96423 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Kconfig
+++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig
@@ -319,6 +319,17 @@ config DWMAC_THEAD
 	  the stmmac device driver. This driver is used for T-HEAD TH1520
 	  ethernet controller.
 
+config DWMAC_ULTRARISC
+	tristate "UltraRISC DWMAC support"
+	default ARCH_ULTRARISC
+	depends on OF && (ARCH_ULTRARISC || COMPILE_TEST)
+	help
+	  Support for the Ethernet controller on the UltraRISC DP1000 SoC.
+
+	  This selects the UltraRISC platform specific glue layer support
+	  for the stmmac device driver. This driver is used for the DP1000
+	  GMAC Ethernet controller.
+
 config DWMAC_IMX8
 	tristate "NXP IMX8 DWMAC support"
 	default ARCH_MXC
diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile
index a1cea2f57252..b16a456b730e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/Makefile
+++ b/drivers/net/ethernet/stmicro/stmmac/Makefile
@@ -36,6 +36,7 @@ obj-$(CONFIG_DWMAC_SUNXI)	+= dwmac-sunxi.o
 obj-$(CONFIG_DWMAC_SUN8I)	+= dwmac-sun8i.o
 obj-$(CONFIG_DWMAC_SUN55I)	+= dwmac-sun55i.o
 obj-$(CONFIG_DWMAC_THEAD)	+= dwmac-thead.o
+obj-$(CONFIG_DWMAC_ULTRARISC)	+= dwmac-ultrarisc.o
 obj-$(CONFIG_DWMAC_DWC_QOS_ETH)	+= dwmac-dwc-qos-eth.o
 obj-$(CONFIG_DWMAC_INTEL_PLAT)	+= dwmac-intel-plat.o
 obj-$(CONFIG_DWMAC_LOONGSON1)	+= dwmac-loongson1.o
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
new file mode 100644
index 000000000000..0b62a75b782a
--- /dev/null
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ultrarisc.c
@@ -0,0 +1,52 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * UltraRISC DWMAC platform driver
+ *
+ * Copyright (C) 2026 UltraRISC Technology (Shanghai) Co., Ltd.
+ */
+
+#include <linux/module.h>
+#include <linux/platform_device.h>
+
+#include "stmmac_platform.h"
+
+static int ultrarisc_dwmac_probe(struct platform_device *pdev)
+{
+	struct plat_stmmacenet_data *plat_dat;
+	struct stmmac_resources stmmac_res;
+	struct device *dev = &pdev->dev;
+	int ret;
+
+	ret = stmmac_get_platform_resources(pdev, &stmmac_res);
+	if (ret)
+		return dev_err_probe(dev, ret, "failed to get resources\n");
+
+	plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac);
+	if (IS_ERR(plat_dat))
+		return dev_err_probe(dev, PTR_ERR(plat_dat),
+				     "failed to parse DT parameters\n");
+
+	plat_dat->has_internal_tx_delay = true;
+	plat_dat->has_internal_rx_delay = true;
+
+	return devm_stmmac_pltfr_probe(pdev, plat_dat, &stmmac_res);
+}
+
+static const struct of_device_id ultrarisc_dwmac_match[] = {
+	{ .compatible = "ultrarisc,dp1000-gmac" },
+	{ }
+};
+MODULE_DEVICE_TABLE(of, ultrarisc_dwmac_match);
+
+static struct platform_driver ultrarisc_dwmac_driver = {
+	.probe = ultrarisc_dwmac_probe,
+	.driver = {
+		.name = "ultrarisc-dwmac",
+		.pm = &stmmac_pltfr_pm_ops,
+		.of_match_table = ultrarisc_dwmac_match,
+	},
+};
+module_platform_driver(ultrarisc_dwmac_driver);
+
+MODULE_DESCRIPTION("UltraRISC DWMAC platform driver");
+MODULE_LICENSE("GPL");

-- 
2.34.1


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

* Re: [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling
  2026-09-07  7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
@ 2026-09-07 11:44   ` Maxime Chevallier
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-07 11:44 UTC (permalink / raw)
  To: Jia Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	sophgo

Hi,

On 9/7/26 09:46, Jia Wang wrote:
> Some DWMAC integrations add fixed RGMII clock delays internally.
> Glue drivers need to account for these delays before passing the
> interface mode to the PHY.
> 
> Add TX and RX delay capability flags to the common platform data.
> Apply phy_fix_phy_mode_for_mac_delays() in stmmac_pltfr_probe() when
> either capability is present.
> 
> This lets glue drivers describe the MAC capabilities without
> duplicating the interface-mode validation and conversion.
> 
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c | 11 +++++++++++
>  include/linux/stmmac.h                                |  2 ++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> index 6128ed1bd521..93b9af203a18 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
> @@ -16,6 +16,7 @@
>  #include <linux/of.h>
>  #include <linux/of_net.h>
>  #include <linux/of_mdio.h>
> +#include <linux/phy.h>
>  
>  #include "stmmac.h"
>  #include "stmmac_platform.h"
> @@ -847,6 +848,16 @@ int stmmac_pltfr_probe(struct platform_device *pdev,
>  		       struct plat_stmmacenet_data *plat,
>  		       struct stmmac_resources *res)
>  {
> +	if (plat->has_internal_tx_delay || plat->has_internal_rx_delay) {
> +		plat->phy_interface =
> +			phy_fix_phy_mode_for_mac_delays(plat->phy_interface,
> +							plat->has_internal_tx_delay,
> +							plat->has_internal_rx_delay);
> +		if (plat->phy_interface == PHY_INTERFACE_MODE_NA)
> +			return dev_err_probe(&pdev->dev, -EINVAL,
> +					     "unsupported phy interface mode\n");
> +	}
> +

Seems good, the default values should be false hence this condition won't be taken,

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime


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

* Re: [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common RGMII delay handling
  2026-09-07  7:46 ` [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common " Jia Wang
@ 2026-09-07 11:45   ` Maxime Chevallier
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-07 11:45 UTC (permalink / raw)
  To: Jia Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	sophgo

Hi,

On 9/7/26 09:46, Jia Wang wrote:
> Describe the SG2042 internal RX delay through the common stmmac
> platform data and let stmmac_pltfr_probe() adjust the PHY interface
> mode.
> 
> This removes the duplicated mode conversion without changing the
> hardware behavior.
> 
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>
> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac-sophgo.c | 12 ++++--------
>  1 file changed, 4 insertions(+), 8 deletions(-)

Ah good :)

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime


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

* Re: [PATCH net-next v2 3/5] net: stmmac: eic7700: Use common RGMII delay handling
  2026-09-07  7:46 ` [PATCH net-next v2 3/5] net: stmmac: eic7700: " Jia Wang
@ 2026-09-07 11:46   ` Maxime Chevallier
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-07 11:46 UTC (permalink / raw)
  To: Jia Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	sophgo

Hi,

On 9/7/26 09:46, Jia Wang wrote:
> Describe the EIC7700 inherent TX delay through the common stmmac
> platform data and let stmmac_pltfr_probe() adjust the PHY interface
> mode.
> 
> Keep the existing programmable TX and RX delay configuration in the
> EIC7700 glue driver.
> 
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime


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

* Re: [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support
  2026-09-07  7:46 ` [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
@ 2026-09-07 11:48   ` Maxime Chevallier
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Chevallier @ 2026-09-07 11:48 UTC (permalink / raw)
  To: Jia Wang, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Maxime Coquelin, Alexandre Torgue,
	Giuseppe Cavallaro, Jose Abreu, Chen Wang, Inochi Amaoto
  Cc: netdev, devicetree, linux-kernel, linux-stm32, linux-arm-kernel,
	sophgo

Hi,

On 9/7/26 09:46, Jia Wang wrote:
> The UltraRISC DP1000 GMAC provides fixed internal delays on both TX and RX
> RGMII clock paths.
> 
> Add a platform glue driver and describe both delay capabilities through
> the common stmmac platform data. This lets the common RGMII delay handling
> adjust the interface mode passed to the PHY and reject incompatible RGMII
> modes.
> 
> Signed-off-by: Jia Wang <wangjia@ultrarisc.com>

Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>

Maxime


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

* Re: [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support
  2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
                   ` (4 preceding siblings ...)
  2026-09-07  7:46 ` [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
@ 2026-09-10  8:50 ` patchwork-bot+netdevbpf
  5 siblings, 0 replies; 11+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-10  8:50 UTC (permalink / raw)
  To: Jia Wang
  Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
	conor+dt, maxime.chevallier, mcoquelin.stm32, alexandre.torgue,
	peppe.cavallaro, joabreu, chen.wang, inochiama, netdev,
	devicetree, linux-kernel, linux-stm32, linux-arm-kernel, sophgo,
	conor.dooley

Hello:

This series was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Mon, 07 Sep 2026 15:46:49 +0800 you wrote:
> The UltraRISC DP1000 integrates a Synopsys DesignWare GMAC from the 5.20
> series with fixed internal delays on both TX and RX RGMII clock paths.
> 
> For boards without PCB delays, "rgmii-id" describes the link. Passing this
> mode unchanged to the PHY would enable another pair of delays and break
> RGMII timing.
> 
> [...]

Here is the summary with links:
  - [net-next,v2,1/5] net: stmmac: Add common internal RGMII delay handling
    https://git.kernel.org/netdev/net-next/c/cc54f9667188
  - [net-next,v2,2/5] net: stmmac: sophgo: Use common RGMII delay handling
    https://git.kernel.org/netdev/net-next/c/7d1cbb9ba933
  - [net-next,v2,3/5] net: stmmac: eic7700: Use common RGMII delay handling
    https://git.kernel.org/netdev/net-next/c/345d78e30980
  - [net-next,v2,4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC
    https://git.kernel.org/netdev/net-next/c/8dbfb46c233a
  - [net-next,v2,5/5] net: stmmac: Add UltraRISC DP1000 GMAC support
    https://git.kernel.org/netdev/net-next/c/c6ff098cb63a

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2026-09-10  8:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07  7:46 [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support Jia Wang
2026-09-07  7:46 ` [PATCH net-next v2 1/5] net: stmmac: Add common internal RGMII delay handling Jia Wang
2026-09-07 11:44   ` Maxime Chevallier
2026-09-07  7:46 ` [PATCH net-next v2 2/5] net: stmmac: sophgo: Use common " Jia Wang
2026-09-07 11:45   ` Maxime Chevallier
2026-09-07  7:46 ` [PATCH net-next v2 3/5] net: stmmac: eic7700: " Jia Wang
2026-09-07 11:46   ` Maxime Chevallier
2026-09-07  7:46 ` [PATCH net-next v2 4/5] dt-bindings: net: Add UltraRISC DP1000 GMAC Jia Wang
2026-09-07  7:46 ` [PATCH net-next v2 5/5] net: stmmac: Add UltraRISC DP1000 GMAC support Jia Wang
2026-09-07 11:48   ` Maxime Chevallier
2026-09-10  8:50 ` [PATCH net-next v2 0/5] net: stmmac: Add common RGMII delay handling and DP1000 support patchwork-bot+netdevbpf

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