From: Lad Prabhakar <prab…@bp.renesas.com>
Add OF match data for the Ethernet switch (ETHSW) found on the Renesas
RZ/T2H SoC. The ETHSW is based on the same A5PSW IP as the RZ/N1, but
has a different port configuration and register layout.
Configure the driver for the RZ/T2H variant with:
- 4 ports (3 external and 1 management), with the management port
at port 3.
- DSA_TAG_PROTO_RZT2H_ETHSW tagging protocol.
- A fixed management port frame length of 0x3fff.
- Pattern matcher register offsets of 0x3f00 and 0x3f40.
- VLAN_RES fields using VLANID[15:4] and PORTMASK[3:0].
- 4096 lookup table entries.
- Keep MAC TX enabled, gating transmission through PORT_ENA.TXENA.
Add the renesas,r9a09g077-ethsw compatible string to the OF match
table. The RZ/N2H SoC uses this compatible as a fallback.
Update the Kconfig prompt and help text to reflect support for the
RZ/T2H and RZ/N2H ETHSW variants.
Signed-off-by: Lad Prabhakar <prab…@bp.renesas.com>
---
v6:
- Squashed patches #21 and #24 to limit the number of patches in the series
- Updated commit message
v5: https://lore.kernel.org/all/2026…@bp.renesas.com/
https://lore.kernel.org/all/2026…@bp.renesas.com/
https://lore.kernel.org/all/2026…@bp.renesas.com/
- No change
v4: https://lore.kernel.org/all/2026…@bp.renesas.com/
- No change
v3: https://lore.kernel.org/all/2026…@bp.renesas.com/
- No change
v2: https://lore.kernel.org/all/2026…@bp.renesas.com/
- Added reviewed-by tag
v1: https://lore.kernel.org/all/2025…@bp.renesas.com/
---
drivers/net/dsa/Kconfig | 9 +++++----
drivers/net/dsa/rzn1_a5psw.c | 20 ++++++++++++++++++--
2 files changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index d62f0cccf13d..5af8bc1a4dce 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -103,13 +103,14 @@ source "drivers/net/dsa/xrs700x/Kconfig"
source "drivers/net/dsa/realtek/Kconfig"
config NET_DSA_RZN1_A5PSW
- tristate "Renesas RZ/N1 A5PSW Ethernet switch support"
- depends on OF && (ARCH_RZN1 || COMPILE_TEST)
+ tristate "Renesas RZ/N1 A5PSW and RZ/{T2H,N2H} ETHSW Ethernet switch support"
+ depends on OF && (ARCH_RENESAS || COMPILE_TEST)
select NET_DSA_TAG_RZN1_A5PSW
select PCS_RZN1_MIIC
help
- This driver supports the A5PSW switch, which is embedded in Renesas
- RZ/N1 SoC.
+ This driver supports the Advanced 5-Port Switch (A5PSW) found on
+ Renesas RZ/N1 SoCs, and the Ethernet Switch (ETHSW) found on
+ Renesas RZ/T2H and RZ/N2H SoCs.
config NET_DSA_KS8995
tristate "Micrel KS8995 family 5-ports 10/100 Ethernet switches"
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index e4fd4425f52e..3114268e009c 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -272,8 +272,9 @@ static void a5psw_phylink_get_caps(struct dsa_switch *ds, int port,
config->mac_capabilities = MAC_1000FD;
if (dsa_is_cpu_port(ds, port)) {
- /* GMII is used internally and GMAC2 is connected to the switch
- * using 1000Mbps Full-Duplex mode only (cf ethernet manual)
+ /* GMII is used internally and the conduit GMAC (GMAC2 on RZ/N1,
+ * GMAC0 on RZ/T2H and RZ/N2H) is connected to the switch using
+ * 1000Mbps Full-Duplex mode only (cf ethernet manual)
*/
__set_bit(PHY_INTERFACE_MODE_GMII, intf);
} else {
@@ -1410,6 +1411,20 @@ static void a5psw_shutdown(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
}
+static const struct a5psw_of_data rzt2h_of_data = {
+ .nports = 4,
+ .npcs = 3,
+ .cpu_port = 3,
+ .tag_proto = DSA_TAG_PROTO_RZT2H_ETHSW,
+ .management_port_fixed_frame_len = 0x3fff,
+ .rxmatch_config_base = 0x3f00,
+ .pattern_ctrl_base = 0x3f40,
+ .vlan_res_vlanid = GENMASK(15, 4),
+ .vlan_res_portmask = GENMASK(3, 0),
+ .lk_table_entries = 4096,
+ .keep_mac_tx_enabled = true,
+};
+
static const struct a5psw_of_data rzn1_of_data = {
.nports = 5,
.npcs = 4,
@@ -1423,6 +1438,7 @@ static const struct a5psw_of_data rzn1_of_data = {
};
static const struct of_device_id a5psw_of_mtable[] = {
+ { .compatible = "renesas,r9a09g077-ethsw", .data = &rzt2h_of_data },
{ .compatible = "renesas,rzn1-a5psw", .data = &rzn1_of_data },
{ /* sentinel */ }
};
--
2.56.1