* [PATCH v2 1/5] dt-bindings: net: snps,dwmac: move rk3399 line to its correct position
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
@ 2025-10-23 11:12 ` Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 2/5] dt-bindings: net: snps,dwmac: Sync list of Rockchip compatibles Heiko Stuebner
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 11:12 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni
Cc: robh, krzk+dt, conor+dt, heiko, netdev, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, jonas,
Andrew Lunn, Conor Dooley
Move the rk3399 compatible to its alphabetically correct position.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 658c004e6a5c..28113ac5e11a 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -86,9 +86,9 @@ properties:
- rockchip,rk3328-gmac
- rockchip,rk3366-gmac
- rockchip,rk3368-gmac
+ - rockchip,rk3399-gmac
- rockchip,rk3576-gmac
- rockchip,rk3588-gmac
- - rockchip,rk3399-gmac
- rockchip,rv1108-gmac
- snps,dwmac
- snps,dwmac-3.40a
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 2/5] dt-bindings: net: snps,dwmac: Sync list of Rockchip compatibles
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 1/5] dt-bindings: net: snps,dwmac: move rk3399 line to its correct position Heiko Stuebner
@ 2025-10-23 11:12 ` Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 3/5] dt-bindings: net: rockchip-dwmac: Add compatible string for RK3506 Heiko Stuebner
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 11:12 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni
Cc: robh, krzk+dt, conor+dt, heiko, netdev, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, jonas,
Andrew Lunn, Conor Dooley
A number of dwmac variants from Rockchip SoCs have turned up in the
Rockchip-specific binding, but not in the main list in snps,dwmac.yaml
which as the comment indicates is needed for accurate matching.
So add the missing rk3528, rk3568 and rv1126 to the main list.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 28113ac5e11a..1a0d6789a59b 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -87,9 +87,12 @@ properties:
- rockchip,rk3366-gmac
- rockchip,rk3368-gmac
- rockchip,rk3399-gmac
+ - rockchip,rk3528-gmac
+ - rockchip,rk3568-gmac
- rockchip,rk3576-gmac
- rockchip,rk3588-gmac
- rockchip,rv1108-gmac
+ - rockchip,rv1126-gmac
- snps,dwmac
- snps,dwmac-3.40a
- snps,dwmac-3.50a
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 3/5] dt-bindings: net: rockchip-dwmac: Add compatible string for RK3506
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 1/5] dt-bindings: net: snps,dwmac: move rk3399 line to its correct position Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 2/5] dt-bindings: net: snps,dwmac: Sync list of Rockchip compatibles Heiko Stuebner
@ 2025-10-23 11:12 ` Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 4/5] ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support Heiko Stuebner
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 11:12 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni
Cc: robh, krzk+dt, conor+dt, heiko, netdev, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, jonas,
Andrew Lunn, Conor Dooley
Rockchip RK3506 has two Ethernet controllers based on Synopsys DWC
Ethernet QoS IP.
Add compatible string for the RK3506 variant.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
Documentation/devicetree/bindings/net/rockchip-dwmac.yaml | 3 +++
Documentation/devicetree/bindings/net/snps,dwmac.yaml | 1 +
2 files changed, 4 insertions(+)
diff --git a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
index 0ac7c4b47d6b..d17112527dab 100644
--- a/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/rockchip-dwmac.yaml
@@ -24,6 +24,7 @@ select:
- rockchip,rk3366-gmac
- rockchip,rk3368-gmac
- rockchip,rk3399-gmac
+ - rockchip,rk3506-gmac
- rockchip,rk3528-gmac
- rockchip,rk3568-gmac
- rockchip,rk3576-gmac
@@ -50,6 +51,7 @@ properties:
- rockchip,rv1108-gmac
- items:
- enum:
+ - rockchip,rk3506-gmac
- rockchip,rk3528-gmac
- rockchip,rk3568-gmac
- rockchip,rk3576-gmac
@@ -148,6 +150,7 @@ allOf:
compatible:
contains:
enum:
+ - rockchip,rk3506-gmac
- rockchip,rk3528-gmac
then:
properties:
diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
index 1a0d6789a59b..dd3c72e8363e 100644
--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
+++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
@@ -87,6 +87,7 @@ properties:
- rockchip,rk3366-gmac
- rockchip,rk3368-gmac
- rockchip,rk3399-gmac
+ - rockchip,rk3506-gmac
- rockchip,rk3528-gmac
- rockchip,rk3568-gmac
- rockchip,rk3576-gmac
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 4/5] ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
` (2 preceding siblings ...)
2025-10-23 11:12 ` [PATCH v2 3/5] dt-bindings: net: rockchip-dwmac: Add compatible string for RK3506 Heiko Stuebner
@ 2025-10-23 11:12 ` Heiko Stuebner
2025-10-23 11:12 ` [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry Heiko Stuebner
2025-10-25 2:10 ` [PATCH v2 0/5] DWMAC support for Rockchip RK3506 patchwork-bot+netdevbpf
5 siblings, 0 replies; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 11:12 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni
Cc: robh, krzk+dt, conor+dt, heiko, netdev, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, jonas, David Wu
From: David Wu <david.wu@rock-chips.com>
Add the needed glue blocks for the RK3506-specific setup.
The RK3506 dwmac only supports up to 100MBit with a RMII PHY,
but no RGMII.
Signed-off-by: David Wu <david.wu@rock-chips.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
.../net/ethernet/stmicro/stmmac/dwmac-rk.c | 64 +++++++++++++++++++
1 file changed, 64 insertions(+)
diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
index 51ea0caf16c1..73330afa4353 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
@@ -827,6 +827,69 @@ static const struct rk_gmac_ops rk3399_ops = {
.set_speed = rk3399_set_speed,
};
+#define RK3506_GRF_SOC_CON8 0x0020
+#define RK3506_GRF_SOC_CON11 0x002c
+
+#define RK3506_GMAC_RMII_MODE GRF_BIT(1)
+
+#define RK3506_GMAC_CLK_RMII_DIV2 GRF_BIT(3)
+#define RK3506_GMAC_CLK_RMII_DIV20 GRF_CLR_BIT(3)
+
+#define RK3506_GMAC_CLK_SELECT_CRU GRF_CLR_BIT(5)
+#define RK3506_GMAC_CLK_SELECT_IO GRF_BIT(5)
+
+#define RK3506_GMAC_CLK_RMII_GATE GRF_BIT(2)
+#define RK3506_GMAC_CLK_RMII_NOGATE GRF_CLR_BIT(2)
+
+static void rk3506_set_to_rmii(struct rk_priv_data *bsp_priv)
+{
+ unsigned int id = bsp_priv->id, offset;
+
+ offset = (id == 1) ? RK3506_GRF_SOC_CON11 : RK3506_GRF_SOC_CON8;
+ regmap_write(bsp_priv->grf, offset, RK3506_GMAC_RMII_MODE);
+}
+
+static const struct rk_reg_speed_data rk3506_reg_speed_data = {
+ .rmii_10 = RK3506_GMAC_CLK_RMII_DIV20,
+ .rmii_100 = RK3506_GMAC_CLK_RMII_DIV2,
+};
+
+static int rk3506_set_speed(struct rk_priv_data *bsp_priv,
+ phy_interface_t interface, int speed)
+{
+ unsigned int id = bsp_priv->id, offset;
+
+ offset = (id == 1) ? RK3506_GRF_SOC_CON11 : RK3506_GRF_SOC_CON8;
+ return rk_set_reg_speed(bsp_priv, &rk3506_reg_speed_data,
+ offset, interface, speed);
+}
+
+static void rk3506_set_clock_selection(struct rk_priv_data *bsp_priv,
+ bool input, bool enable)
+{
+ unsigned int value, offset, id = bsp_priv->id;
+
+ offset = (id == 1) ? RK3506_GRF_SOC_CON11 : RK3506_GRF_SOC_CON8;
+
+ value = input ? RK3506_GMAC_CLK_SELECT_IO :
+ RK3506_GMAC_CLK_SELECT_CRU;
+ value |= enable ? RK3506_GMAC_CLK_RMII_NOGATE :
+ RK3506_GMAC_CLK_RMII_GATE;
+ regmap_write(bsp_priv->grf, offset, value);
+}
+
+static const struct rk_gmac_ops rk3506_ops = {
+ .set_to_rmii = rk3506_set_to_rmii,
+ .set_speed = rk3506_set_speed,
+ .set_clock_selection = rk3506_set_clock_selection,
+ .regs_valid = true,
+ .regs = {
+ 0xff4c8000, /* gmac0 */
+ 0xff4d0000, /* gmac1 */
+ 0x0, /* sentinel */
+ },
+};
+
#define RK3528_VO_GRF_GMAC_CON 0x0018
#define RK3528_VO_GRF_MACPHY_CON0 0x001c
#define RK3528_VO_GRF_MACPHY_CON1 0x0020
@@ -1808,6 +1871,7 @@ static const struct of_device_id rk_gmac_dwmac_match[] = {
{ .compatible = "rockchip,rk3366-gmac", .data = &rk3366_ops },
{ .compatible = "rockchip,rk3368-gmac", .data = &rk3368_ops },
{ .compatible = "rockchip,rk3399-gmac", .data = &rk3399_ops },
+ { .compatible = "rockchip,rk3506-gmac", .data = &rk3506_ops },
{ .compatible = "rockchip,rk3528-gmac", .data = &rk3528_ops },
{ .compatible = "rockchip,rk3568-gmac", .data = &rk3568_ops },
{ .compatible = "rockchip,rk3576-gmac", .data = &rk3576_ops },
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
` (3 preceding siblings ...)
2025-10-23 11:12 ` [PATCH v2 4/5] ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support Heiko Stuebner
@ 2025-10-23 11:12 ` Heiko Stuebner
2025-10-23 18:57 ` Andrew Lunn
2025-10-25 2:10 ` [PATCH v2 0/5] DWMAC support for Rockchip RK3506 patchwork-bot+netdevbpf
5 siblings, 1 reply; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 11:12 UTC (permalink / raw)
To: andrew+netdev, davem, edumazet, kuba, pabeni
Cc: robh, krzk+dt, conor+dt, heiko, netdev, devicetree,
linux-arm-kernel, linux-rockchip, linux-kernel, jonas
The dwmac-rk glue driver is currently not caught by the general maintainer
entry for Rockchip SoCs, so add it explicitly, similar to the i2c driver.
The binding document in net/rockchip-dwmac.yaml already gets caught by
the wildcard match.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 545a4776795e..5b9c056b47cd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -3296,6 +3296,7 @@ F: drivers/*/*/*rockchip*
F: drivers/*/*rockchip*
F: drivers/clk/rockchip/
F: drivers/i2c/busses/i2c-rk3x.c
+F: drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
F: sound/soc/rockchip/
N: rockchip
--
2.47.2
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry
2025-10-23 11:12 ` [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry Heiko Stuebner
@ 2025-10-23 18:57 ` Andrew Lunn
2025-10-23 20:48 ` Heiko Stuebner
0 siblings, 1 reply; 9+ messages in thread
From: Andrew Lunn @ 2025-10-23 18:57 UTC (permalink / raw)
To: Heiko Stuebner
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, netdev, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, jonas
On Thu, Oct 23, 2025 at 01:12:12PM +0200, Heiko Stuebner wrote:
> The dwmac-rk glue driver is currently not caught by the general maintainer
> entry for Rockchip SoCs, so add it explicitly, similar to the i2c driver.
>
> The binding document in net/rockchip-dwmac.yaml already gets caught by
> the wildcard match.
>
> Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry
2025-10-23 18:57 ` Andrew Lunn
@ 2025-10-23 20:48 ` Heiko Stuebner
0 siblings, 0 replies; 9+ messages in thread
From: Heiko Stuebner @ 2025-10-23 20:48 UTC (permalink / raw)
To: Andrew Lunn
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, netdev, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, jonas
Hi Andrew,
Am Donnerstag, 23. Oktober 2025, 20:57:50 Mitteleuropäische Sommerzeit schrieb Andrew Lunn:
> On Thu, Oct 23, 2025 at 01:12:12PM +0200, Heiko Stuebner wrote:
> > The dwmac-rk glue driver is currently not caught by the general maintainer
> > entry for Rockchip SoCs, so add it explicitly, similar to the i2c driver.
> >
> > The binding document in net/rockchip-dwmac.yaml already gets caught by
> > the wildcard match.
> >
> > Signed-off-by: Heiko Stuebner <heiko@sntech.de>
>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
just mentioning, I wasn't sure if your review for patch4 was still
valid after I adapted the change to Jonas' suggestions, so only added
the R-b's from v1 to patches 1-3 .
Heiko
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 0/5] DWMAC support for Rockchip RK3506
2025-10-23 11:12 [PATCH v2 0/5] DWMAC support for Rockchip RK3506 Heiko Stuebner
` (4 preceding siblings ...)
2025-10-23 11:12 ` [PATCH v2 5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry Heiko Stuebner
@ 2025-10-25 2:10 ` patchwork-bot+netdevbpf
5 siblings, 0 replies; 9+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-10-25 2:10 UTC (permalink / raw)
To: Heiko Stuebner
Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt,
conor+dt, netdev, devicetree, linux-arm-kernel, linux-rockchip,
linux-kernel, jonas
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Thu, 23 Oct 2025 13:12:07 +0200 you wrote:
> Some cleanups to the DT binding for Rockchip variants of the dwmac
> and adding the RK3506 support on top.
>
> As well as the driver-glue needed for setting up the correct RMII
> speed seitings.
>
> changes in v2:
> - add Conor's Acks to dt-bindings
> - add Andrew's Reviews to first 3 patches
> I didn't add the driver Review, as I did address Jonas' comments
> - adapt to Jonas' comments in the driver
> - add a patch for a MAINTAINERS entry (Jakub)
>
> [...]
Here is the summary with links:
- [v2,1/5] dt-bindings: net: snps,dwmac: move rk3399 line to its correct position
https://git.kernel.org/netdev/net-next/c/32dd679b88d5
- [v2,2/5] dt-bindings: net: snps,dwmac: Sync list of Rockchip compatibles
https://git.kernel.org/netdev/net-next/c/e774c91dca45
- [v2,3/5] dt-bindings: net: rockchip-dwmac: Add compatible string for RK3506
https://git.kernel.org/netdev/net-next/c/4a667bec74b3
- [v2,4/5] ethernet: stmmac: dwmac-rk: Add RK3506 GMAC support
https://git.kernel.org/netdev/net-next/c/2010163a8ea4
- [v2,5/5] MAINTAINERS: add dwmac-rk glue driver to the main Rockchip entry
https://git.kernel.org/netdev/net-next/c/384d84263295
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] 9+ messages in thread