🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
3 messages
3 total messages Started by Cunhao Lu via B4 Relay Mon, 16 Nov 2026 07:39
[PATCH net-next v3 1/2] dt-bindings: net: rockchip-dwmac: Add RK3572
#16984
Author: Cunhao Lu via B4 Relay
Date: Mon, 16 Nov 2026 07:39
95 lines
13371 bytes
From: Cunhao Lu <1579567540@qq.com>

Add the rockchip,rk3572-gmac compatible with the snps,dwmac-4.20a
fallback and require rockchip,php-grf.

Mark tx_delay and rx_delay as deprecated and disallow them for RK3572
so new designs do not use the legacy delay properties.

Signed-off-by: Cunhao Lu <1579567540@qq.com>
---
Changes in v3:
- Deprecate tx_delay and rx_delay and disallow them for RK3572.

Changes in v2:
- Add RK3572 to the shared Synopsys compatible list for consistency.
---
 Documentation/devicetree/bindings/net/rockchip-dwmac.yaml | 15 +++++++++++++++
 Documentation/devicetree/bindings/net/snps,dwmac.yaml     |  1 +
 2 files changed, 16 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
index e8dda1961ab3..d7b7bb008235 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
@@ -27,6 +27,7 @@ select:
           - rockchip,rk3506-gmac
           - rockchip,rk3528-gmac
           - rockchip,rk3568-gmac
+          - rockchip,rk3572-gmac
           - rockchip,rk3576-gmac
           - rockchip,rk3588-gmac
           - rockchip,rv1108-gmac
@@ -54,6 +55,7 @@ properties:
               - rockchip,rk3506-gmac
               - rockchip,rk3528-gmac
               - rockchip,rk3568-gmac
+              - rockchip,rk3572-gmac
               - rockchip,rk3576-gmac
               - rockchip,rk3588-gmac
               - rockchip,rv1126-gmac
@@ -112,6 +114,7 @@ properties:
     minimum: 0
     maximum: 0x7F
     default: 0x30
+    deprecated: true
 
   rx_delay:
     description: Delay value for RXD timing.
@@ -119,6 +122,7 @@ properties:
     minimum: 0
     maximum: 0x7F
     default: 0x10
+    deprecated: true
 
   pcs-handle:
     description:
@@ -141,11 +145,22 @@ required:
 allOf:
   - $ref: snps,dwmac.yaml#
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: rockchip,rk3572-gmac
+    then:
+      properties:
+        rx_delay: false
+        tx_delay: false
+
   - if:
       properties:
         compatible:
           contains:
             enum:
+              - rockchip,rk3572-gmac
               - rockchip,rk3576-gmac
               - rockchip,rk3588-gmac
     then:
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 2c4842404bf6..80d3b43e2889 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -94,6 +94,7 @@ properties:
         - rockchip,rk3506-gmac
         - rockchip,rk3528-gmac
         - rockchip,rk3568-gmac
+        - rockchip,rk3572-gmac
         - rockchip,rk3576-gmac
         - rockchip,rk3588-gmac
         - rockchip,rv1108-gmac

-- 
2.34.1
Re: [PATCH net-next v3 1/2] dt-bindings: net: rockchip-dwmac: Add RK3572
#17177
Author: Andrew Lunn
Date: Mon, 16 Nov 2026 13:44
15 lines
9253 bytes
On Mon, Nov 16, 2026 at 03:39:14PM +0800, Cunhao Lu via B4 Relay wrote:
> From: Cunhao Lu <1579567540@qq.com>
> 
> Add the rockchip,rk3572-gmac compatible with the snps,dwmac-4.20a
> fallback and require rockchip,php-grf.
> 
> Mark tx_delay and rx_delay as deprecated and disallow them for RK3572
> so new designs do not use the legacy delay properties.
> 
> Signed-off-by: Cunhao Lu <1579567540@qq.com>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew
Re: [PATCH net-next v3 1/2] dt-bindings: net: rockchip-dwmac: Add RK3572
#18463
Author: netdev-bot+sashiko
Date: Wed, 18 Nov 2026 10:41
159 lines
13816 bytes
Thank you for your contribution! Sashiko AI review found 2 potential
issue(s) to consider.

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

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] In rockchip-dwmac.yaml, this patch adds an allOf block that
  sets `rx_delay: false` and `tx_delay: false` for rockchip,rk3572-gmac.
- [Low] Under the subject "Add RK3572", the patch adds `deprecated: true`
  to the top-level tx_delay and rx_delay definitions in rockchip-…

--

dt-bindings: net: rockchip-dwmac: Add RK3572

This adds the rockchip,rk3572-gmac compatible, with snps,dwmac-4.20a as
the fallback, and requires rockchip,php-grf for it. It also marks
tx_delay and rx_delay as deprecated and disallows them for RK3572.

> diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> index e8dda1961ab31..d7b7bb0082357 100644
> --- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
> +++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml

[ ... ]

> @@ -112,6 +114,7 @@ properties:
>      minimum: 0
>      maximum: 0x7F
>      default: 0x30
> +    deprecated: true
>  
>    rx_delay:
>      description: Delay value for RXD timing.
> @@ -119,6 +122,7 @@ properties:
>      minimum: 0
>      maximum: 0x7F
>      default: 0x10
> +    deprecated: true

[Severity: Low]
These deprecated: true lines are on the top-level tx_delay and rx_delay
definitions. Doesn't that deprecate them for every Rockchip GMAC compatible
(px30, rk3128 through rk3588, rv1108, rv1126), and not only for RK3572?

The binding doesn't name a replacement. dwmac-rk.c also doesn't read any
standard alternative such as rx-internal-delay-ps or tx-internal-delay-ps.
On the older SoCs, a board that needs MAC-side RGMII delay has no
non-deprecated way to describe it.

If a DT leaves the properties out, rk_gmac_setup() logs errors and falls
back to hidden defaults:

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:rk_gmac_setup() {
    ...
	ret = of_property_read_u32(dev->of_node, "tx_delay", &value);
	if (ret) {
		bsp_priv->tx_delay = 0x30;
		dev_err(dev, "Can not read property: tx_delay.");
    ...
}

Could this binding-wide deprecation go in a separate patch with a rationale
and a successor that the driver supports? Alternatively, could it be limited
to compatibles where a replacement exists?

> @@ -141,11 +145,22 @@ required:
>  allOf:
>    - $ref: snps,dwmac.yaml#
>  
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: rockchip,rk3572-gmac
> +    then:
> +      properties:
> +        rx_delay: false
> +        tx_delay: false

[Severity: Medium]
With rx_delay and tx_delay set to false, how does an RK3572 board control
the MAC-side RGMII delay? phy-mode isn't restricted, so "rgmii",
"rgmii-rxid" and "rgmii-txid" still pass validation.

The companion commit "net: stmmac: dwmac-rk: Add RK3572 support" binds
rockchip,rk3572-gmac to rk3572_ops. That uses the shared rk_gmac_setup()
and rk_gmac_powerup() paths. rk_gmac_setup() always reads both properties.
On a valid RK3572 DT they are always missing, so it falls back to 0x30/0x10:

drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c:rk_gmac_setup() {
    ...
	ret = of_property_read_u32(dev->of_node, "tx_delay", &value);
	if (ret) {
		bsp_priv->tx_delay = 0x30;
		dev_err(dev, "Can not read property: tx_delay.");
		dev_err(dev, "set tx_delay to 0x%x\n",
			bsp_priv->tx_delay);
    ...
	ret = of_property_read_u32(dev->of_node, "rx_delay", &value);
	if (ret) {
		bsp_priv->rx_delay = 0x10;
    ...
}

That gives four dev_err() lines on every probe of every RK3572 GMAC,
rgmii-id included.

Then the set_mode switch in rk_gmac_powerup() passes those fallbacks into
ops->set_to_rgmii():

	case PHY_INTERFACE_MODE_RGMII:
		...
			bsp_priv->ops->set_to_rgmii(bsp_priv,
						    bsp_priv->tx_delay,
						    bsp_priv->rx_delay);
	...
	case PHY_INTERFACE_MODE_RGMII_RXID:
		...
						    bsp_priv->tx_delay, 0);
	...
	case PHY_INTERFACE_MODE_RGMII_TXID:
		...
						    0, bsp_priv->rx_delay);

In the companion commit, rk3572_set_to_rgmii() does:

	u32 val = GRF_FIELD(14, 8, rx_delay) | GRF_FIELD(6, 0, tx_delay) |
		  GRF_FIELD(15, 15, !!rx_delay) | GRF_FIELD(7, 7, !!tx_delay);

So the non-zero fallbacks switch on the php_grf IOC delay lines. The delay
values are fixed, and the DT can't tune them or turn them off. Before this
change, tx_delay = <0> was how to turn the delay off, and the schema now
rejects that. Only phy-mode = "rgmii-id" ends up with zero MAC delay.

The commit message says the goal is "so new designs do not use the legacy
delay properties". The schema does that, but the driver still applies
legacy delay values through its hidden defaults.

The standard tx-internal-delay-ps and rx-internal-delay-ps properties
validate through snps,dwmac.yaml and ethernet-controller.yaml. But
dwmac-rk.c never reads them, so setting them does nothing and gives no
error.

Would it make sense to either restrict RK3572 to rgmii-id (with the driver
skipping the reads and dev_err() calls for RK3572), or to add driver
support for tx-internal-delay-ps and rx-internal-delay-ps before banning
the legacy properties?

[ ... ]

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261116-add-board-ok3572-c-net-v3-0-a957fdcd9c7a%40qq.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads