From: Clement Leger <clement.leger@linux.dev>
To: Prabhakar <prabhakar.csengg@gmail.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
Simon Horman <horms@kernel.org>,
Philipp Zabel <p.zabel@pengutronix.de>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Magnus Damm <magnus.damm@gmail.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Ralph Siemsen <ralph.siemsen@linaro.org>,
linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org,
Prabhakar <prabhakar.csengg+renesas@gmail.com>,
Biju Das <biju.das.jz@bp.renesas.com>,
Fabrizio Castro <fabrizio.castro.jz@renesas.com>,
Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Subject: Re: [PATCH net-next v5 16/24] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string
Date: Fri, 20 Nov 2026 08:03:24 +0100 [thread overview]
Message-ID: <348c15f4-529f-4d03-8362-ccac24722ebb@linux.dev> (raw)
In-Reply-To: <20261120002549.1908299-17-prabhakar.mahadev-lad.rj@bp.renesas.com>
On 11/20/26 01:25, Prabhakar wrote:
> 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>
> ---
> v4->v5:
> - No change
>
> v3->v4:
> - No change
>
> v2->v3:
> - No change
>
> 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 8d7cad90d613..c59d881ce10f 100644
> --- a/drivers/net/dsa/rzn1_a5psw.c
> +++ b/drivers/net/dsa/rzn1_a5psw.c
> @@ -99,7 +99,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,
> @@ -1330,6 +1332,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 26d201931453..58690f5f3887 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;
> };
>
> /**
Hi Prabhakar,
Reviewed-by: Clément Léger <clement.leger@linux.dev>
Thanks,
Clément
next prev parent reply other threads:[~2026-11-20 7:03 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-20 0:25 [PATCH net-next v5 00/24] Add ETHSW support for Renesas RZ/T2H and RZ/N2H SoCs Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 01/24] net: dsa: tag_rzn1_a5psw: Drop redundant ETH_P_DSA_A5PSW definition Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 02/24] net: dsa: tag_rzn1_a5psw: Add RZ/T2H ETHSW tag protocol support Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 03/24] net: dsa: Kconfig: Expand config description to cover RZ/T2H and RZ/N2H ETHSW Prabhakar
2026-11-20 9:32 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 04/24] net: pcs: rzn1-miic: Select ETHSW port speed through SWCTRL Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 05/24] dt-bindings: net: dsa: renesas,rzn1-a5psw: Reject the "ports" node Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 06/24] dt-bindings: net: dsa: renesas,rzn1-a5psw: Limit port reg values Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 07/24] dt-bindings: net: dsa: renesas,rzn1-a5psw: Add RZ/T2H and RZ/N2H ETHSW support Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 08/24] net: dsa: rzn1-a5psw: Fix LK_LEARNCOUNT write mode encoding Prabhakar
2026-11-20 3:27 ` Andrew Lunn
2026-11-20 6:01 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 09/24] net: dsa: rzn1-a5psw: Fix VLANTransmitted counter offset Prabhakar
2026-11-20 3:29 ` Andrew Lunn
2026-11-20 0:25 ` [PATCH net-next v5 10/24] net: dsa: rzn1-a5psw: Fix MDIO clock divider calculation Prabhakar
2026-11-20 6:51 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 11/24] net: dsa: rzn1-a5psw: Set driver data in probe Prabhakar
2026-11-20 6:53 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 12/24] net: dsa: rzn1-a5psw: Add support for optional reset control Prabhakar
2026-11-20 3:32 ` Andrew Lunn
2026-11-20 0:25 ` [PATCH net-next v5 13/24] net: dsa: rzn1-a5psw: Add support for optional timestamp clock Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 14/24] net: dsa: rzn1-a5psw: Make use dev_err_probe() Prabhakar
2026-11-20 6:58 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 15/24] net: dsa: rzn1-a5psw: Get switch info via OF data Prabhakar
2026-11-20 7:02 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 16/24] net: dsa: rzn1-a5psw: Choose tagging protocol based on compatible string Prabhakar
2026-11-20 7:03 ` Clement Leger [this message]
2026-11-20 0:25 ` [PATCH net-next v5 17/24] net: dsa: rzn1-a5psw: Add fixed frame length workaround for management port Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 18/24] net: dsa: rzn1-a5psw: Get pattern matcher register offsets from OF data Prabhakar
2026-11-20 9:35 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 19/24] net: dsa: rzn1-a5psw: Get VLAN_RES field layout " Prabhakar
2026-11-20 9:37 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 20/24] net: dsa: rzn1-a5psw: Get lookup table size " Prabhakar
2026-11-20 9:44 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 21/24] net: dsa: rzn1-a5psw: Update CPU port comment for RZ/T2H Prabhakar
2026-11-20 9:45 ` Clement Leger
2026-11-20 0:25 ` [PATCH net-next v5 22/24] net: dsa: rzn1-a5psw: Keep MAC TX enabled on RZ/T2H Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 23/24] net: dsa: rzn1-a5psw: Add support for RZ/T2H Ethernet switch Prabhakar
2026-11-20 0:25 ` [PATCH net-next v5 24/24] net: dsa: Kconfig: Enable support for RZ/T2H and RZ/N2H SoCs Prabhakar
2026-11-20 0:28 ` [PATCH net-next v5 00/24] Add ETHSW support for Renesas " netdev-bot+sinfo
2026-11-20 14:43 ` Lad, Prabhakar
2026-11-20 3:14 ` Jakub Kicinski
2026-11-20 14:44 ` Lad, Prabhakar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=348c15f4-529f-4d03-8362-ccac24722ebb@linux.dev \
--to=clement.leger@linux.dev \
--cc=andrew@lunn.ch \
--cc=biju.das.jz@bp.renesas.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=f.fainelli@gmail.com \
--cc=fabrizio.castro.jz@renesas.com \
--cc=geert+renesas@glider.be \
--cc=hkallweit1@gmail.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=magnus.damm@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=prabhakar.csengg+renesas@gmail.com \
--cc=prabhakar.csengg@gmail.com \
--cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
--cc=ralph.siemsen@linaro.org \
--cc=robh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.