* [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs
@ 2026-10-01 15:43 Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 01/12] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
` (11 more replies)
0 siblings, 12 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Hi All,
This series of patches adds support for the Renesas RZ/T2H and RZ/N2H SoCs
which integrate an Ethernet switch IP variant called ETHSW. The ETHSW is
largely compatible with the A5PSW switch found on RZ/N1 SoCs, but has
several key differences in register layout and hardware configuration. The
series includes updates to the DSA driver, device tree bindings, and
Kconfig to enable support for these SoCs.
v1->v2:
- Added RB tag
- Fixed review comments from Vladimir.
- Added info about the IP issue and the workaround
v1: https://lore.kernel.org/all/20251121113553.2955854-1-prabhakar.mahadev-lad.rj@bp.renesas.com/
Cheers,
Prabhakar
Lad Prabhakar (12):
net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition
net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support
net: dsa: Kconfig: Expand config description to cover RZ/T2H and
RZ/N2H ETHSW
dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW
support
net: dsa: rzn1-a5psw: Add support for optional reset control
net: dsa: rzn1-a5psw: Add support for optional timestamp clock
net: dsa: rzn1-a5psw: Make use dev_err_probe()
net: dsa: rzn1-a5psw: Get switch info via OF data
net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible
string
net: dsa: rzn1-a5psw: Add fixed frame length workaround for management
port
net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch
net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs
.../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 154 +++++++++++++++---
drivers/net/dsa/Kconfig | 9 +-
drivers/net/dsa/rzn1_a5psw.c | 79 +++++++--
drivers/net/dsa/rzn1_a5psw.h | 25 ++-
include/net/dsa.h | 2 +
include/uapi/linux/if_ether.h | 2 +-
net/dsa/Kconfig | 9 +-
net/dsa/tag_rzn1_a5psw.c | 22 ++-
8 files changed, 250 insertions(+), 52 deletions(-)
--
2.55.0
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH net-next v2 01/12] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 02/12] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
` (10 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Remove the locally defined ETH_P_DSA_A5PSW protocol value from
tag_rzn1_a5psw.c. The macro is already provided by <linux/if_ether.h>,
which is included by this file, making the local definition redundant.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
---
v1->v2:
- Added RB tag
---
net/dsa/tag_rzn1_a5psw.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/net/dsa/tag_rzn1_a5psw.c b/net/dsa/tag_rzn1_a5psw.c
index 734910156dc3..aab0ec143c77 100644
--- a/net/dsa/tag_rzn1_a5psw.c
+++ b/net/dsa/tag_rzn1_a5psw.c
@@ -24,7 +24,6 @@
#define A5PSW_NAME "a5psw"
-#define ETH_P_DSA_A5PSW 0xE001
#define A5PSW_TAG_LEN 8
#define A5PSW_CTRL_DATA_FORCE_FORWARD BIT(0)
/* This is both used for xmit tag and rcv tagging */
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 02/12] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 01/12] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 03/12] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Prabhakar
` (9 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Add a distinct DSA tag protocol for the RZ/T2H ETHSW to separate its
semantics from the RZ/N1 A5PSW, even though both use the same tagged
frame structure. The on wire layout is identical, but the ControlData
bit assignments differ between the two switch families.
The common tagged frame format is:
+----------------------+-------------------------------+
| Field | Size (octets) |
+----------------------+-------------------------------+
| Preamble | 7 |
| SFD | 1 |
| Destination Address | 6 |
| Source Address | 6 |
| ControlTag (0xE001) | 2 |
| ControlData | 2 |
| ControlData2 | 4 (timestamp, portmask) |
| Type/Length | 2 |
| Payload | 0..1500 / 0..9000 |
| Pad | 0..42 |
| FCS | 4 |
+----------------------+-------------------------------+
The differences arise in the ControlData interpretation:
ControlData field (bits):
+---------+-----------------------------+
| SoC | Meaning |
+---------+-----------------------------+
| RZ/N1 | [0-3]: ingress port |
| | [4-15]: reserved |
+---------+-----------------------------+
| RZ/T2H | [0-3]: ingress port |
| | [4]: timestamp timer select |
| | [5]: reserved |
| | [6]: RED period indicator |
| | [7-15]: reserved |
+---------+-----------------------------+
Because these semantics diverge, register a new
DSA_TAG_PROTO_RZT2H_ETHSW protocol and corresponding tag driver.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Updated commit message
---
include/net/dsa.h | 2 ++
include/uapi/linux/if_ether.h | 2 +-
net/dsa/tag_rzn1_a5psw.c | 21 +++++++++++++++++++--
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/include/net/dsa.h b/include/net/dsa.h
index 5d12191b6f6f..57143cf52f89 100644
--- a/include/net/dsa.h
+++ b/include/net/dsa.h
@@ -62,6 +62,7 @@ struct tc_action;
#define DSA_TAG_PROTO_KSZ8463_VALUE 34
#define DSA_TAG_PROTO_MT7628_VALUE 35
#define DSA_TAG_PROTO_KS8995_VALUE 36
+#define DSA_TAG_PROTO_RZT2H_ETHSW_VALUE 37
enum dsa_tag_protocol {
DSA_TAG_PROTO_NONE = DSA_TAG_PROTO_NONE_VALUE,
@@ -101,6 +102,7 @@ enum dsa_tag_protocol {
DSA_TAG_PROTO_KSZ8463 = DSA_TAG_PROTO_KSZ8463_VALUE,
DSA_TAG_PROTO_MT7628 = DSA_TAG_PROTO_MT7628_VALUE,
DSA_TAG_PROTO_KS8995 = DSA_TAG_PROTO_KS8995_VALUE,
+ DSA_TAG_PROTO_RZT2H_ETHSW = DSA_TAG_PROTO_RZT2H_ETHSW_VALUE,
};
struct dsa_switch;
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h
index 1ffac52c39df..9fd25c5d96c9 100644
--- a/include/uapi/linux/if_ether.h
+++ b/include/uapi/linux/if_ether.h
@@ -121,7 +121,7 @@
#define ETH_P_YT921X 0x9988 /* Motorcomm YT921x DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_DSA_8021Q 0xDADB /* Fake VLAN Header for DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
-#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW Tag Value [ NOT AN OFFICIALLY REGISTERED ID ] */
+#define ETH_P_DSA_A5PSW 0xE001 /* A5PSW/ETHSW Tag Value [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */
#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
#define ETH_P_NXP_NETC 0xFD3A /* NXP NETC DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
diff --git a/net/dsa/tag_rzn1_a5psw.c b/net/dsa/tag_rzn1_a5psw.c
index aab0ec143c77..3dff661fa58c 100644
--- a/net/dsa/tag_rzn1_a5psw.c
+++ b/net/dsa/tag_rzn1_a5psw.c
@@ -23,6 +23,7 @@
*/
#define A5PSW_NAME "a5psw"
+#define ETHSW_NAME "ethsw"
#define A5PSW_TAG_LEN 8
#define A5PSW_CTRL_DATA_FORCE_FORWARD BIT(0)
@@ -111,8 +112,24 @@ static const struct dsa_device_ops a5psw_netdev_ops = {
.rcv = a5psw_tag_rcv,
.needed_headroom = A5PSW_TAG_LEN,
};
+MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_A5PSW, A5PSW_NAME);
+DSA_TAG_DRIVER(a5psw_netdev_ops);
+
+static const struct dsa_device_ops ethsw_netdev_ops = {
+ .name = ETHSW_NAME,
+ .proto = DSA_TAG_PROTO_RZT2H_ETHSW,
+ .xmit = a5psw_tag_xmit,
+ .rcv = a5psw_tag_rcv,
+ .needed_headroom = A5PSW_TAG_LEN,
+};
+MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_RZT2H_ETHSW, ETHSW_NAME);
+DSA_TAG_DRIVER(ethsw_netdev_ops);
+
+static struct dsa_tag_driver *dsa_tag_driver_array[] = {
+ &DSA_TAG_DRIVER_NAME(a5psw_netdev_ops),
+ &DSA_TAG_DRIVER_NAME(ethsw_netdev_ops),
+};
+module_dsa_tag_drivers(dsa_tag_driver_array);
MODULE_DESCRIPTION("DSA tag driver for Renesas RZ/N1 A5PSW switch");
MODULE_LICENSE("GPL v2");
-MODULE_ALIAS_DSA_TAG_DRIVER(DSA_TAG_PROTO_A5PSW, A5PSW_NAME);
-module_dsa_tag_driver(a5psw_netdev_ops);
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 03/12] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 01/12] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 02/12] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
` (8 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Update the Kconfig entry for the RZN1 A5PSW tag driver to reflect that
the same tagging format is also used by the ETHSW blocks found in Renesas
RZ/T2H and RZ/N2H SoCs.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Updated description for Kconfig entry to cover RZ/T2H and RZ/N2H ETHSW
---
net/dsa/Kconfig | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/net/dsa/Kconfig b/net/dsa/Kconfig
index 4f44bf3ede23..88e181ad4cc3 100644
--- a/net/dsa/Kconfig
+++ b/net/dsa/Kconfig
@@ -188,11 +188,12 @@ config NET_DSA_TAG_RTL8_4
switches with 8 byte protocol 4 tags, such as the Realtek RTL8365MB-VC.
config NET_DSA_TAG_RZN1_A5PSW
- tristate "Tag driver for Renesas RZ/N1 A5PSW switch"
+ tristate "Tag driver for Renesas RZ/N1 A5PSW and RZ/T2H, RZ/N2H ETHSW"
help
- Say Y or M if you want to enable support for tagging frames for
- Renesas RZ/N1 embedded switch that uses an 8 byte tag located after
- destination MAC address.
+ Say Y or M if you want to enable frame tagging support for embedded
+ switches found on Renesas RZ/N1 (A5PSW) and RZ/T2H, RZ/N2H (ETHSW)
+ SoCs. These switches use an 8-byte tag located after the destination
+ MAC address.
config NET_DSA_TAG_LAN9303
tristate "Tag driver for SMSC/Microchip LAN9303 family of switches"
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (2 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 03/12] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-03 1:33 ` sashiko-bot
2026-10-01 15:43 ` [PATCH net-next v2 05/12] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
` (7 subsequent siblings)
11 siblings, 1 reply; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Extend the A5PSW DSA binding to cover the ETHSW variant used on newer
Renesas RZ/T2H and RZ/N2H SoCs. ETHSW is derived from the A5PSW switch
found on RZ/N1 but differs in register layout, clocking and interrupt
topology, and exposes four ports in total (including the CPU/management
port) instead of five.
Update the schema to describe these differences by adding dedicated
compatible strings for RZ/T2H and RZ/N2H.
Use the RZ/T2H compatible string as the fallback for RZ/N2H, reflecting
that both SoCs integrate the same ETHSW IP.
Add myself as a co-maintainer of the binding to support ongoing work on
the ETHSW family across RZ/T2H and RZ/N2H devices.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Added full names for SoCs
---
.../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 154 +++++++++++++++---
1 file changed, 130 insertions(+), 24 deletions(-)
diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
index fab6aa6237e9..863633185912 100644
--- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
@@ -4,43 +4,108 @@
$id: http://devicetree.org/schemas/net/dsa/renesas,rzn1-a5psw.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Renesas RZ/N1 Advanced 5 ports ethernet switch
+title: Renesas RZ/N1 A5PSW and RZ/T2H, RZ/N2H ETHSW Ethernet Switch
maintainers:
- Clément Léger <clement.leger@bootlin.com>
+ - Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
-description: |
- The advanced 5 ports switch is present on the Renesas RZ/N1 SoC family and
- handles 4 ports + 1 CPU management port.
+description: >
+ This binding describes the Ethernet switch IPs used on Renesas SoCs:
-allOf:
- - $ref: dsa.yaml#/$defs/ethernet-ports
+ - The A5PSW (Advanced 5-Port Switch) found on the RZ/N1 family, which
+ provides 4 external ports and 1 CPU/management port.
+ - The ETHSW (Ethernet Switch) found on the RZ/T2H and RZ/N2H families,
+ which is derived from the A5PSW IP with some register layout
+ differences, additional timestamping support, and a total of 4 ports
+ including the CPU/management port.
properties:
compatible:
- items:
- - enum:
- - renesas,r9a06g032-a5psw
- - const: renesas,rzn1-a5psw
+ oneOf:
+ - items:
+ - enum:
+ - renesas,r9a06g032-a5psw
+ - const: renesas,rzn1-a5psw
+
+ - const: renesas,r9a09g077-ethsw
+
+ - items:
+ - const: renesas,r9a09g087-ethsw
+ - const: renesas,r9a09g077-ethsw
reg:
maxItems: 1
interrupts:
- items:
- - description: Device Level Ring (DLR) interrupt
- - description: Switch interrupt
- - description: Parallel Redundancy Protocol (PRP) interrupt
- - description: Integrated HUB module interrupt
- - description: Receive Pattern Match interrupt
+ oneOf:
+ - items:
+ - description: Device Level Ring (DLR) interrupt
+ - description: Switch interrupt
+ - description: Parallel Redundancy Protocol (PRP) interrupt
+ - description: Integrated HUB module interrupt
+ - description: Receive Pattern Match interrupt
+
+ - items:
+ - description: Switch interrupt
+ - description: Device Level Ring (DLR) interrupt
+ - description: Parallel Redundancy Protocol (PRP) interrupt
+ - description: Integrated HUB module interrupt
+ - description: Receive Pattern Match interrupt 0
+ - description: Receive Pattern Match interrupt 1
+ - description: Receive Pattern Match interrupt 2
+ - description: Receive Pattern Match interrupt 3
+ - description: Receive Pattern Match interrupt 4
+ - description: Receive Pattern Match interrupt 5
+ - description: Receive Pattern Match interrupt 6
+ - description: Receive Pattern Match interrupt 7
+ - description: Receive Pattern Match interrupt 8
+ - description: Receive Pattern Match interrupt 9
+ - description: Receive Pattern Match interrupt 10
+ - description: Receive Pattern Match interrupt 11
+ - description: Switch timer pulse output interrupt 0
+ - description: Switch timer pulse output interrupt 1
+ - description: Switch timer pulse output interrupt 2
+ - description: Switch timer pulse output interrupt 3
+ - description: Switch TDMA timer output interrupt 0
+ - description: Switch TDMA timer output interrupt 1
+ - description: Switch TDMA timer output interrupt 2
+ - description: Switch TDMA timer output interrupt 3
interrupt-names:
- items:
- - const: dlr
- - const: switch
- - const: prp
- - const: hub
- - const: ptrn
+ oneOf:
+ - items:
+ - const: dlr
+ - const: switch
+ - const: prp
+ - const: hub
+ - const: ptrn
+
+ - items:
+ - const: switch
+ - const: dlr
+ - const: prp
+ - const: hub
+ - const: ptrn0
+ - const: ptrn1
+ - const: ptrn2
+ - const: ptrn3
+ - const: ptrn4
+ - const: ptrn5
+ - const: ptrn6
+ - const: ptrn7
+ - const: ptrn8
+ - const: ptrn9
+ - const: ptrn10
+ - const: ptrn11
+ - const: tp0
+ - const: tp1
+ - const: tp2
+ - const: tp3
+ - const: tdma0
+ - const: tdma1
+ - const: tdma2
+ - const: tdma3
power-domains:
maxItems: 1
@@ -50,14 +115,21 @@ properties:
unevaluatedProperties: false
clocks:
+ minItems: 2
items:
- description: AHB clock used for the switch register interface
- description: Switch system clock
+ - description: Timestamp clock
clock-names:
+ minItems: 2
items:
- const: hclk
- const: clk
+ - const: ts
+
+ resets:
+ maxItems: 1
ethernet-ports:
type: object
@@ -73,14 +145,48 @@ properties:
phandle pointing to a PCS sub-node compatible with
renesas,rzn1-miic.yaml#
-unevaluatedProperties: false
-
required:
- compatible
- reg
- clocks
- clock-names
- power-domains
+ - interrupts
+ - interrupt-names
+
+allOf:
+ - $ref: dsa.yaml#/$defs/ethernet-ports
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: renesas,r9a09g077-ethsw
+ then:
+ properties:
+ interrupts:
+ minItems: 24
+ interrupt-names:
+ minItems: 24
+ clocks:
+ minItems: 3
+ clock-names:
+ minItems: 3
+ required:
+ - resets
+ else:
+ properties:
+ interrupts:
+ maxItems: 5
+ interrupt-names:
+ maxItems: 5
+ clocks:
+ maxItems: 2
+ clock-names:
+ maxItems: 2
+ resets: false
+
+unevaluatedProperties: false
examples:
- |
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 05/12] net: dsa: rzn1-a5psw: Add support for optional reset control
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (3 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 06/12] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
` (6 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Add support for an optional reset control to the RZN1 A5PSW driver.
Obtain the reset line using
devm_reset_control_get_optional_exclusive_deasserted() during probe
to ensure that the Ethernet switch (ETHSW) block is properly released
from reset before initialization.
This change prepares the driver for use on Renesas RZ/T2H and RZ/N2H
SoCs, where the ETHSW IP block is connected to a dedicated reset line
that must be controlled by software.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
---
v1->v2:
- Added RB tags
---
drivers/net/dsa/rzn1_a5psw.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 85ff1fd2bbfb..9daa5d8245df 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_mdio.h>
+#include <linux/reset.h>
#include <net/dsa.h>
#include "rzn1_a5psw.h"
@@ -1207,6 +1208,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw)
static int a5psw_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
+ struct reset_control *reset;
struct device_node *mdio;
struct dsa_switch *ds;
struct a5psw *a5psw;
@@ -1243,6 +1245,12 @@ static int a5psw_probe(struct platform_device *pdev)
goto free_pcs;
}
+ reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
+ if (IS_ERR(reset)) {
+ ret = PTR_ERR(reset);
+ goto free_pcs;
+ }
+
mdio = of_get_available_child_by_name(dev->of_node, "mdio");
if (mdio) {
ret = a5psw_probe_mdio(a5psw, mdio);
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 06/12] net: dsa: rzn1-a5psw: Add support for optional timestamp clock
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (4 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 05/12] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 07/12] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
` (5 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Add support for an optional "ts" (timestamp) clock to the RZN1 A5PSW
driver. Some SoC variants provide a dedicated clock source for
timestamping or time synchronization features within the Ethernet
switch IP.
Request and enable this clock during probe if defined in the device tree.
If the clock is not present, the driver continues to operate normally.
This change prepares the driver for Renesas RZ/T2H and RZ/N2H SoCs, where
the Ethernet switch includes a timestamp clock input.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- No change
---
drivers/net/dsa/rzn1_a5psw.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 9daa5d8245df..846216f22bc3 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -1212,6 +1212,7 @@ static int a5psw_probe(struct platform_device *pdev)
struct device_node *mdio;
struct dsa_switch *ds;
struct a5psw *a5psw;
+ struct clk *ts;
int ret;
a5psw = devm_kzalloc(dev, sizeof(*a5psw), GFP_KERNEL);
@@ -1245,6 +1246,13 @@ static int a5psw_probe(struct platform_device *pdev)
goto free_pcs;
}
+ ts = devm_clk_get_optional_enabled(dev, "ts");
+ if (IS_ERR(ts)) {
+ ret = PTR_ERR(ts);
+ dev_err_probe(dev, ret, "failed get ts clock\n");
+ goto free_pcs;
+ }
+
reset = devm_reset_control_get_optional_exclusive_deasserted(dev, NULL);
if (IS_ERR(reset)) {
ret = PTR_ERR(reset);
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 07/12] net: dsa: rzn1-a5psw: Make use dev_err_probe()
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (5 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 06/12] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 08/12] net: dsa: rzn1-a5psw: Get switch info via OF data Prabhakar
` (4 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Replace dev_err() with dev_err_probe() when reporting failures from
devm_clk_get_enabled(). Clock retrieval may legitimately return
-EPROBE_DEFER, and the current use of dev_err() incorrectly reports
such cases as hard errors.
Suggested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- New patch
---
drivers/net/dsa/rzn1_a5psw.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 846216f22bc3..bdfa84745eda 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -1234,15 +1234,15 @@ static int a5psw_probe(struct platform_device *pdev)
a5psw->hclk = devm_clk_get_enabled(dev, "hclk");
if (IS_ERR(a5psw->hclk)) {
- dev_err(dev, "failed get hclk clock\n");
ret = PTR_ERR(a5psw->hclk);
+ dev_err_probe(dev, ret, "failed get hclk clock\n");
goto free_pcs;
}
a5psw->clk = devm_clk_get_enabled(dev, "clk");
if (IS_ERR(a5psw->clk)) {
- dev_err(dev, "failed get clk_switch clock\n");
ret = PTR_ERR(a5psw->clk);
+ dev_err_probe(dev, ret, "failed get clk_switch clock\n");
goto free_pcs;
}
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 08/12] net: dsa: rzn1-a5psw: Get switch info via OF data
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (6 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 07/12] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 09/12] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string Prabhakar
` (3 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
The driver previously assumed a fixed 5-port layout and derived the CPU
port and number of PCS instances from this. Newer Renesas variants use
different port counts. Although the CPU port remains the last port, the
fixed port/PCS topology hard coded in the driver no longer matches all
hardware.
Introduce an a5psw_of_data struct holding the per SoC swicth info, and
use this match data in place of the previously embedded constants. This
makes the port loops, PCS allocation, management-port setup, and other
topology dependent code reflect the switch layout selected by the
compatible string.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Updated commit message
- Renamed A5PSW_MAX_PORTS macro to A5PSW_MAX_NUM_PCS
---
drivers/net/dsa/rzn1_a5psw.c | 27 ++++++++++++++++++---------
drivers/net/dsa/rzn1_a5psw.h | 20 +++++++++++++++++---
2 files changed, 35 insertions(+), 12 deletions(-)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index bdfa84745eda..c8197ef62fd2 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -382,13 +382,14 @@ static void a5psw_port_bridge_leave(struct dsa_switch *ds, int port,
struct dsa_bridge bridge)
{
struct a5psw *a5psw = ds->priv;
+ unsigned int cpu_port = a5psw->of_data->cpu_port;
a5psw->bridged_ports &= ~BIT(port);
a5psw_port_set_standalone(a5psw, port, true);
/* No more ports bridged */
- if (a5psw->bridged_ports == BIT(A5PSW_CPU_PORT))
+ if (a5psw->bridged_ports == BIT(cpu_port))
a5psw->br_dev = NULL;
}
@@ -924,20 +925,21 @@ static void a5psw_vlan_setup(struct a5psw *a5psw, int port)
static int a5psw_setup(struct dsa_switch *ds)
{
struct a5psw *a5psw = ds->priv;
+ unsigned int cpu_port = a5psw->of_data->cpu_port;
int port, vlan, ret;
struct dsa_port *dp;
u32 reg;
- /* Validate that there is only 1 CPU port with index A5PSW_CPU_PORT */
+ /* Validate that there is only 1 CPU port with index matching cpu_port */
dsa_switch_for_each_cpu_port(dp, ds) {
- if (dp->index != A5PSW_CPU_PORT) {
+ if (dp->index != cpu_port) {
dev_err(a5psw->dev, "Invalid CPU port\n");
return -EINVAL;
}
}
/* Configure management port */
- reg = A5PSW_CPU_PORT | A5PSW_MGMT_CFG_ENABLE;
+ reg = cpu_port | A5PSW_MGMT_CFG_ENABLE;
a5psw_reg_writel(a5psw, A5PSW_MGMT_CFG, reg);
/* Set pattern 0 to forward all frame to mgmt port */
@@ -1149,7 +1151,7 @@ static void a5psw_pcs_free(struct a5psw *a5psw)
{
int i;
- for (i = 0; i < ARRAY_SIZE(a5psw->pcs); i++) {
+ for (i = 0; i < a5psw->of_data->npcs; i++) {
if (a5psw->pcs[i])
miic_destroy(a5psw->pcs[i]);
}
@@ -1176,7 +1178,7 @@ static int a5psw_pcs_get(struct a5psw *a5psw)
goto free_pcs;
}
- if (reg >= ARRAY_SIZE(a5psw->pcs)) {
+ if (reg >= a5psw->of_data->npcs) {
ret = -ENODEV;
goto free_pcs;
}
@@ -1226,7 +1228,8 @@ static int a5psw_probe(struct platform_device *pdev)
if (IS_ERR(a5psw->base))
return PTR_ERR(a5psw->base);
- a5psw->bridged_ports = BIT(A5PSW_CPU_PORT);
+ a5psw->of_data = of_device_get_match_data(dev);
+ a5psw->bridged_ports = BIT(a5psw->of_data->cpu_port);
ret = a5psw_pcs_get(a5psw);
if (ret)
@@ -1271,7 +1274,7 @@ static int a5psw_probe(struct platform_device *pdev)
ds = &a5psw->ds;
ds->dev = dev;
- ds->num_ports = A5PSW_PORTS_NUM;
+ ds->num_ports = a5psw->of_data->nports;
ds->ops = &a5psw_switch_ops;
ds->phylink_mac_ops = &a5psw_phylink_mac_ops;
ds->priv = a5psw;
@@ -1313,8 +1316,14 @@ static void a5psw_shutdown(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
}
+static const struct a5psw_of_data rzn1_of_data = {
+ .nports = 5,
+ .npcs = 4,
+ .cpu_port = 4,
+};
+
static const struct of_device_id a5psw_of_mtable[] = {
- { .compatible = "renesas,rzn1-a5psw", },
+ { .compatible = "renesas,rzn1-a5psw", .data = &rzn1_of_data },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, a5psw_of_mtable);
diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h
index d54acedac194..197ff5916578 100644
--- a/drivers/net/dsa/rzn1_a5psw.h
+++ b/drivers/net/dsa/rzn1_a5psw.h
@@ -195,8 +195,8 @@
#define A5PSW_aCarrierSenseErrors 0x924
#define A5PSW_VLAN_TAG(prio, id) (((prio) << 12) | (id))
-#define A5PSW_PORTS_NUM 5
-#define A5PSW_CPU_PORT (A5PSW_PORTS_NUM - 1)
+/* Maximum number of PCS instances (excludes CPU port) */
+#define A5PSW_MAX_NUM_PCS 4
#define A5PSW_MDIO_DEF_FREQ 2500000
#define A5PSW_MDIO_TIMEOUT 100
#define A5PSW_JUMBO_LEN (10 * SZ_1K)
@@ -231,12 +231,25 @@ union lk_data {
struct fdb_entry entry;
};
+/**
+ * struct a5psw_of_data - OF data structure
+ * @nports: Number of ports in the switch
+ * @npcs: Number of PCS connected to the switch
+ * @cpu_port: CPU port number
+ */
+struct a5psw_of_data {
+ unsigned int nports;
+ unsigned int npcs;
+ unsigned int cpu_port;
+};
+
/**
* struct a5psw - switch struct
* @base: Base address of the switch
* @hclk: hclk_switch clock
* @clk: clk_switch clock
* @dev: Device associated to the switch
+ * @of_data: Pointer to OF data
* @mii_bus: MDIO bus struct
* @mdio_freq: MDIO bus frequency requested
* @pcs: Array of PCS connected to the switch ports (not for the CPU)
@@ -252,8 +265,9 @@ struct a5psw {
struct clk *hclk;
struct clk *clk;
struct device *dev;
+ const struct a5psw_of_data *of_data;
struct mii_bus *mii_bus;
- struct phylink_pcs *pcs[A5PSW_PORTS_NUM - 1];
+ struct phylink_pcs *pcs[A5PSW_MAX_NUM_PCS];
struct dsa_switch ds;
struct mutex lk_lock;
spinlock_t reg_lock;
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 09/12] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (7 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 08/12] net: dsa: rzn1-a5psw: Get switch info via OF data Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
` (2 subsequent siblings)
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Prepare the A5PSW driver for forthcoming RZ/T2H ETHSW support by making
the DSA tag protocol selectable through SoC match data. The RZ/N1 A5PSW
and RZ/T2H ETHSW share the same tagged frame layout, but interpret the
ControlData field differently, so the tag protocol cannot remain fixed.
The common tagged frame structure is:
+----------------------+-------------------------------+
| Field | Size (octets) |
+----------------------+-------------------------------+
| Preamble | 7 |
| SFD | 1 |
| Destination Address | 6 |
| Source Address | 6 |
| ControlTag (0xE001) | 2 |
| ControlData | 2 |
| ControlData2 | 4 (timestamp, portmask) |
| Type/Length | 2 |
| Payload | 0..1500 / 0..9000 |
| Pad | 0..42 |
| FCS | 4 |
+----------------------+-------------------------------+
The ControlData semantics diverge between the two switch families:
+---------+----------------------------------------------+
| SoC | ControlData bits |
+---------+----------------------------------------------+
| RZ/N1 | [0-3]: ingress port |
| | [4-15]: reserved |
+---------+----------------------------------------------+
| RZ/T2H | [0-3]: ingress port |
| | [4]: timestamp timer select |
| | [5]: reserved |
| | [6]: RED period indicator |
| | [7-15]: reserved |
+---------+----------------------------------------------+
Because these differences affect protocol semantics, select the tag
format through compatible specific data. This allows the driver to
choose the appropriate tagging protocol for each SoC while preserving
the existing RZ/N1 behaviour.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Updated commit message
---
drivers/net/dsa/rzn1_a5psw.c | 5 ++++-
drivers/net/dsa/rzn1_a5psw.h | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index c8197ef62fd2..0b0b4055e615 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -97,7 +97,9 @@ static enum dsa_tag_protocol a5psw_get_tag_protocol(struct dsa_switch *ds,
int port,
enum dsa_tag_protocol mp)
{
- return DSA_TAG_PROTO_RZN1_A5PSW;
+ struct a5psw *a5psw = ds->priv;
+
+ return a5psw->of_data->tag_proto;
}
static void a5psw_port_pattern_set(struct a5psw *a5psw, int port, int pattern,
@@ -1320,6 +1322,7 @@ static const struct a5psw_of_data rzn1_of_data = {
.nports = 5,
.npcs = 4,
.cpu_port = 4,
+ .tag_proto = DSA_TAG_PROTO_RZN1_A5PSW,
};
static const struct of_device_id a5psw_of_mtable[] = {
diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h
index 197ff5916578..e952afd95dca 100644
--- a/drivers/net/dsa/rzn1_a5psw.h
+++ b/drivers/net/dsa/rzn1_a5psw.h
@@ -236,11 +236,13 @@ union lk_data {
* @nports: Number of ports in the switch
* @npcs: Number of PCS connected to the switch
* @cpu_port: CPU port number
+ * @tag_proto: DSA tag protocol used by the switch
*/
struct a5psw_of_data {
unsigned int nports;
unsigned int npcs;
unsigned int cpu_port;
+ enum dsa_tag_protocol tag_proto;
};
/**
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (8 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 09/12] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-03 1:33 ` sashiko-bot
2026-10-09 1:44 ` Jakub Kicinski
2026-10-01 15:43 ` [PATCH net-next v2 11/12] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 12/12] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Prabhakar
11 siblings, 2 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
The ETHSW IP used in SoCs such as RZ/T2H and RZ/N2H has a hardware issue
where the internal mgmt_tag_vld signal is asserted as a level instead of
a single-cycle pulse. This causes the frame length counter on the
management (CPU) port to over-increment, so valid frames are falsely
detected as oversized and dropped.
The recommended workaround is to program the maximum frame length
register (FRM_LENGTH) of the management port with a fixed, large value.
Add a management_port_fixed_frame_len member to struct a5psw_of_data to
hold the SoC-specific value. When it is set, program A5PSW_FRM_LENGTH
for the CPU port with this value in a5psw_setup(), and skip updating
FRM_LENGTH for the CPU port in a5psw_port_change_mtu() so that MTU
changes do not override the workaround.
No functional change for existing SoCs, which leave the value unset.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- Added info about the IP issue and the workaround.
- Updated commit message
---
drivers/net/dsa/rzn1_a5psw.c | 18 +++++++++++++++++-
drivers/net/dsa/rzn1_a5psw.h | 3 +++
2 files changed, 20 insertions(+), 1 deletion(-)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index 0b0b4055e615..ce931442d49f 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -209,8 +209,13 @@ static int a5psw_port_enable(struct dsa_switch *ds, int port,
static int a5psw_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
{
struct a5psw *a5psw = ds->priv;
+ struct a5psw_of_data *of_data = a5psw->of_data;
+
+ if (dsa_is_cpu_port(ds, port) && of_data->management_port_fixed_frame_len)
+ return 0;
new_mtu += ETH_HLEN + A5PSW_EXTRA_MTU_LEN + ETH_FCS_LEN;
+
a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port), new_mtu);
return 0;
@@ -990,8 +995,19 @@ static int a5psw_setup(struct dsa_switch *ds)
if (dsa_port_is_unused(dp))
continue;
- /* Enable egress flooding and learning for CPU port */
if (dsa_port_is_cpu(dp)) {
+ /*
+ * Workaround for ETHSW IP issue, mgmt_tag_vld is asserted as a level
+ * instead of a single-cycle pulse, causing the frame length counter
+ * to over-increment and trigger false oversize frame drops.
+ * The recommended workaround is to set the maximum frame
+ * length on the management port.
+ */
+ if (a5psw->of_data->management_port_fixed_frame_len)
+ a5psw_reg_writel(a5psw, A5PSW_FRM_LENGTH(port),
+ a5psw->of_data->management_port_fixed_frame_len);
+
+ /* Enable egress flooding and learning for CPU port */
a5psw_flooding_set_resolution(a5psw, port, true);
a5psw_port_learning_set(a5psw, port, true);
}
diff --git a/drivers/net/dsa/rzn1_a5psw.h b/drivers/net/dsa/rzn1_a5psw.h
index e952afd95dca..5bec33b23079 100644
--- a/drivers/net/dsa/rzn1_a5psw.h
+++ b/drivers/net/dsa/rzn1_a5psw.h
@@ -237,12 +237,15 @@ union lk_data {
* @npcs: Number of PCS connected to the switch
* @cpu_port: CPU port number
* @tag_proto: DSA tag protocol used by the switch
+ * @management_port_fixed_frame_len: Fixed frame length for the management
+ * port to account for the HW issue.
*/
struct a5psw_of_data {
unsigned int nports;
unsigned int npcs;
unsigned int cpu_port;
enum dsa_tag_protocol tag_proto;
+ unsigned int management_port_fixed_frame_len;
};
/**
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 11/12] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (9 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 12/12] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Prabhakar
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Add device tree match data and configuration for the Renesas RZ/T2H
SoC Ethernet switch. The RZ/T2H uses the same A5PSW switch IP as RZ/N1
but with four ports, the DSA tagging protocol `DSA_TAG_PROTO_RZT2H_ETHSW`,
and an additional 8-byte management port frame length adjustment.
This prepares the driver to handle RZ/T2H and compatible RZ/N2H
Ethernet switch instances.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2:
- No change
---
drivers/net/dsa/rzn1_a5psw.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
index ce931442d49f..1d5ce18b560c 100644
--- a/drivers/net/dsa/rzn1_a5psw.c
+++ b/drivers/net/dsa/rzn1_a5psw.c
@@ -1334,6 +1334,14 @@ 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,
+};
+
static const struct a5psw_of_data rzn1_of_data = {
.nports = 5,
.npcs = 4,
@@ -1342,6 +1350,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.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH net-next v2 12/12] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
` (10 preceding siblings ...)
2026-10-01 15:43 ` [PATCH net-next v2 11/12] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
@ 2026-10-01 15:43 ` Prabhakar
11 siblings, 0 replies; 16+ messages in thread
From: Prabhakar @ 2026-10-01 15:43 UTC (permalink / raw)
To: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Simon Horman,
Philipp Zabel, Russell King, Geert Uytterhoeven, Magnus Damm
Cc: linux-renesas-soc, netdev, devicetree, linux-kernel, Prabhakar,
Biju Das, Fabrizio Castro, Lad Prabhakar
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Update the Kconfig entry for the Renesas RZ/N1 A5PSW Ethernet switch
driver to depend on ARCH_RENESAS instead of ARCH_RZN1. This allows
the driver to be built for other Renesas SoCs that integrate a similar
Ethernet switch IP, such as RZ/T2H and RZ/N2H.
Also update the help text and prompt to reflect support for the ETHSW
variant used on these SoCs.
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
---
v1->v2:
- Added RB tag
---
drivers/net/dsa/Kconfig | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
index fe8cd5338fda..f6894495b9ed 100644
--- a/drivers/net/dsa/Kconfig
+++ b/drivers/net/dsa/Kconfig
@@ -101,13 +101,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"
--
2.55.0
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support
2026-10-01 15:43 ` [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
@ 2026-10-03 1:33 ` sashiko-bot
0 siblings, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-10-03 1:33 UTC (permalink / raw)
To: Prabhakar; +Cc: conor+dt, robh, devicetree, wsa+renesas
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] dt-bindings: net: dsa: a5psw: globally requiring interrupts breaks backward ABI
- [Low] dt-bindings: net: dsa: a5psw: missing port count restriction for ETHSW variant
--
commit ac61e34c73e390592b92437f35f98d8807997f55
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support
This commit extends the A5PSW DSA binding to cover the ETHSW variant used on
newer Renesas SoCs. It updates the schema with new compatible strings, modifies
interrupt and clock properties, and accounts for the 4-port topology.
> diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> index fab6aa6237e93..863633185912f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml
[ ... ]
> @@ -73,14 +145,48 @@ properties:
> phandle pointing to a PCS sub-node compatible with
> renesas,rzn1-miic.yaml#
>
> -unevaluatedProperties: false
> -
> required:
> - compatible
> - reg
> - clocks
> - clock-names
> - power-domains
> + - interrupts
> + - interrupt-names
[Severity: Medium]
Does adding interrupts and interrupt-names to the top-level required array
cause a regression by breaking backward compatibility for legacy device trees?
Existing device trees for the older renesas,rzn1-a5psw hardware that do not
specify the interrupts property will now fail validation. Since the Linux
driver does not currently utilize interrupts, it is perfectly valid and
functional for older device trees to omit them.
Should these properties only be required conditionally within the then block
for the new hardware variant?
> +
> +allOf:
> + - $ref: dsa.yaml#/$defs/ethernet-ports
> +
> + - if:
> + properties:
> + compatible:
> + contains:
> + const: renesas,r9a09g077-ethsw
> + then:
> + properties:
> + interrupts:
> + minItems: 24
> + interrupt-names:
> + minItems: 24
> + clocks:
> + minItems: 3
> + clock-names:
> + minItems: 3
> + required:
> + - resets
[Severity: Low]
Does this conditional block need to restrict the port count for the new
ETHSW variant?
The global patternProperties for ethernet-ports allows
"^(ethernet-)?port@[0-4]$", which globally permits up to 5 ports. This is
correct for the older A5PSW variant but incorrect for the new 4-port ETHSW
variant.
Without a port count restriction here (e.g., overriding and disabling port@4),
device trees with invalid 5-port configurations for the new variant will
silently pass schema validation.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001154326.754314-1-prabhakar.mahadev-lad.rj@bp.renesas.com?part=4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
2026-10-01 15:43 ` [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
@ 2026-10-03 1:33 ` sashiko-bot
2026-10-09 1:44 ` Jakub Kicinski
1 sibling, 0 replies; 16+ messages in thread
From: sashiko-bot @ 2026-10-03 1:33 UTC (permalink / raw)
To: Prabhakar; +Cc: robh, conor+dt, wsa+renesas, devicetree
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] build: -Wdiscarded-qualifiers on of_data assignment
--
commit c1982503d53e92d2bb0e481c0cef9b75fe397c5c
Author: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
This commit adds a workaround for an ETHSW IP issue in SoCs like RZ/T2H where
the internal mgmt_tag_vld signal is asserted as a level instead of a pulse.
It provides a way to set a fixed maximum frame length on the management port
to prevent valid frames from being dropped.
> diff --git a/drivers/net/dsa/rzn1_a5psw.c b/drivers/net/dsa/rzn1_a5psw.c
> index 0b0b4055e6155..ce931442d49fd 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -209,8 +209,13 @@ static int a5psw_port_enable(struct dsa_switch *ds, int port,
> static int a5psw_port_change_mtu(struct dsa_switch *ds, int port, int new_mtu)
> {
> struct a5psw *a5psw = ds->priv;
> + struct a5psw_of_data *of_data = a5psw->of_data;
[Severity: Low]
Does this assignment cause a compiler warning for discarding qualifiers?
In struct a5psw, of_data is defined as const:
struct a5psw {
...
const struct a5psw_of_data *of_data;
...
};
Assigning it to a non-const local pointer here causes a -Wdiscarded-qualifiers
warning, which might break builds that treat warnings as errors. Should this
local pointer be declared as const?
> +
> + if (dsa_is_cpu_port(ds, port) && of_data->management_port_fixed_frame_len)
> + return 0;
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261001154326.754314-1-prabhakar.mahadev-lad.rj@bp.renesas.com?part=10
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port
2026-10-01 15:43 ` [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
2026-10-03 1:33 ` sashiko-bot
@ 2026-10-09 1:44 ` Jakub Kicinski
1 sibling, 0 replies; 16+ messages in thread
From: Jakub Kicinski @ 2026-10-09 1:44 UTC (permalink / raw)
To: Prabhakar
Cc: Clément Léger, Andrew Lunn, Vladimir Oltean,
David S. Miller, Eric Dumazet, Paolo Abeni, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Simon Horman, Philipp Zabel,
Russell King, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
netdev, devicetree, linux-kernel, Prabhakar, Biju Das,
Fabrizio Castro, Lad Prabhakar
On Thu, 1 Oct 2026 16:43:23 +0100 Prabhakar wrote:
> From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
>
> The ETHSW IP used in SoCs such as RZ/T2H and RZ/N2H has a hardware issue
> where the internal mgmt_tag_vld signal is asserted as a level instead of
> a single-cycle pulse. This causes the frame length counter on the
> management (CPU) port to over-increment, so valid frames are falsely
> detected as oversized and dropped.
>
> The recommended workaround is to program the maximum frame length
> register (FRM_LENGTH) of the management port with a fixed, large value.
>
> Add a management_port_fixed_frame_len member to struct a5psw_of_data to
> hold the SoC-specific value. When it is set, program A5PSW_FRM_LENGTH
> for the CPU port with this value in a5psw_setup(), and skip updating
> FRM_LENGTH for the CPU port in a5psw_port_change_mtu() so that MTU
> changes do not override the workaround.
>
> No functional change for existing SoCs, which leave the value unset.
drivers/net/dsa/rzn1_a5psw.c:212:24: error: initializing 'struct a5psw_of_data *' with an expression of type 'const struct a5psw_of_data *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
212 | struct a5psw_of_data *of_data = a5psw->of_data;
| ^ ~~~~~~~~~~~~~~
--
pw-bot: cr
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2026-10-09 1:44 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-01 15:43 [PATCH net-next v2 00/12] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 01/12] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 02/12] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 03/12] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 04/12] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
2026-10-03 1:33 ` sashiko-bot
2026-10-01 15:43 ` [PATCH net-next v2 05/12] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 06/12] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 07/12] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 08/12] net: dsa: rzn1-a5psw: Get switch info via OF data Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 09/12] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 10/12] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
2026-10-03 1:33 ` sashiko-bot
2026-10-09 1:44 ` Jakub Kicinski
2026-10-01 15:43 ` [PATCH net-next v2 11/12] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
2026-10-01 15:43 ` [PATCH net-next v2 12/12] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Prabhakar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox