Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=66.163.190.146 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795965154; b=rhJC3YL16RiQuv26zdVIMj0/vCYqf2DbocG+lrEEz59c64Z5T4A9coEFShnDQM7r4Xbl fIhgWCOUetbBwyV7CGMGFOTO9WDqqrpyHq1gdBdLN1sgG7D+PWUHLO9czs9SDAWKoeweH PabPHMZ4sdCZNpeTL6wVzJr3ISjMEhWzXQg2Frjsr79Ol5nZdFL5twZjPJ01gQCaBCtki J3IzYjOjtL/2tmnXNIWPd0o7SJxLPdqoPHa6PqYZL7n4EMiMntkob1FqxaC1EMWbLQd69 QgQ/uoQ4eZe2ciNGNtR0CX6vWChS02Im4T00/oCwl67L3RR5cVB7//vYMd+KYqpxrYw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795965154; h=DMARC-Filter:DKIM-Signature:X-SONIC-DKIM-SIGN:X-YMail-OSG:X-Sonic-MF: X-Sonic-ID:Received:Received:Message-ID:Date:MIME-Version:User-Agent: Subject:To:References:Content-Language:In-Reply-To:From:Content-Type: Content-Transfer-Encoding:X-Mailer; bh=KljM8TRN+o/D1mmwyLQaksr69fpAB3yynw6ChadhQXo=; b=ujkNxZQ0XagicNqZM2B/h4rJM5fNKWvuMTpAm3+gtMn3LYdIM3PgWGkdkYntFryFmV6L H8FKW126HQioSP6yoVPitEd4wgwU2di5HVFZB3w7c/E/nUFVGtEbvj7axWnfu6gEU/9KO N2NFeyVd0H9nCwVHfYFnJQ7RdAtMPhfEvo6XkGi0FWIxSqvaKln5VddaX9XtqIkrx4SRv Ji9t9gFABMlgAcD/lgziLDdbSIyu8RaA+DFHUYOzWfnTnS09Zk43Bh9wEZhiBmnQzn2Ao bXM94Tkyjlp9q1h72HVbgQpaufZcEP0aA+wCb+gH6fsdR/6JXRcOsTC/7PNKPnNFE6w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=VUcg8dAj; arc=none smtp.remote-ip=66.163.190.146 Received: from sonic315-20.consmr.mail.ne1.yahoo.com (sonic315-20.consmr.mail.ne1.yahoo.com [66.163.190.146]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15D87606A332 for ; Sun, 29 Nov 2026 15:12:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 15D87606A332 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=yahoo.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.a=rsa-sha256 header.s=s2048 header.b=VUcg8dAj DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1795965152; bh=KljM8TRN+o/D1mmwyLQaksr69fpAB3yynw6ChadhQXo=; h=Date:Subject:To:References:In-Reply-To:From:Content-Type:From:Subject:Reply-To:Content-Type; b=VUcg8dAj76X+Tsf4Fy/GQ0z+ERA6dTR/9AVzuEOyhrci+lHs3Tat71s+R3fBavjFzf+7UXENFrQfSb8SNR2DxqtSqgZuXY4hdsQT80NmaLUxIh+9K3l9qkPP6fB5Pd5O8r5zDpvQmDklVLiXkX64QgGdmntyYYjQ0SnEOHc6L4EM9VX2o/W/GG1mRmRuVE8ojthjXVkXN4EB4T5XEig3lvcYIleeIWsLB266UTO70j/mlyu+hzoE05GmO5YxocSyz9HbtuE1hYKt1Lk0ynHTuQbu0pqmQv0Ldvdc2L2DtkKINV5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_menWPikfIQUToAibezUtmt98x1Ae276CrAKmQzCF5tVABbNtY7cleJ6Cw_70gVHU5jEQ0.EJutK 6grF54twGGUp8SwwO4HpmSRfd8ofCGxdzpWwXAUmoi3JUACLyZTQurJ1EgAqB.TDhAulaf1.nMPX P3oN2CuB6HyPbJKJUpF3KbgxnXK3QgNExBxzt9c6dahwrXN0.mQcHvwLcl4OfRkPmd_Wrbjtugi6 UHSY6jmIyRSkUVMYa.gKNlge3amKSlcNtavHef3_GucUL0oG94zgMmFz6GHtwBw7VSfpKOSUMYJH DSib8j7fUxx.rfXWpm9fej1CG5LlbC9yKvbxNTkm7_kaV1kiHLERpr16c4docrCbRU_cBQnHokcI mzu9XOeBZqa1NKt98S6mz9hVOV78BJlTfbiYLXnjqAtAfi.SZx9d_s.K38m2qPCSZHxQzyqEJIJr HSxWk_osf7TZNx3MRM6TO7bKI1hJz1lNqB2pw7s2o1cd6Ko2kDpenMYkmmaiYLh9spWN_ztRgsJ6 lHxAWNMDQQ29LNY2OiT1dMc9XiZ0IdBG8Am7TT2dSRacYs1Ne4B.5B.6f58cai81q7d.oGq7cwUo bQO11FGsG9u5aKk.NI1rfm4Fm3ns7J511k8K1EbKuaV.ryhMs0ub5w4Sk7FVxwrj3pTP6pBBd9N4 KOjUeUGXD0MzIcQIRDpzDR6TQfIyOcNwYibKHQE.4HX1gldT7XCkKaNU20elqkHhWHOlye3GzY_I f_D4Z1N8mvlUvS1OIiMukpsisw8P7S9jq83Shyzq5uvckjYTP X-Sonic-MF: X-Sonic-ID: 9471d71c-de0a-4e8d-901f-f6a8c6bdfd1d Received: from sonic.gate.mail.ne1.yahoo.com by sonic315.consmr.mail.ne1.yahoo.com with HTTP; Sun, 29 Nov 2026 15:12:32 +0000 Received: by hermes--production-ir2-7c4859dc89-8w8b5 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID b2b0d02c3ea378e5da820464a02f20d3; Sun, 29 Nov 2026 15:12:26 +0000 (UTC) Message-ID: Date: Sun, 29 Nov 2026 16:12:23 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH net-next v16 15/15] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB To: linusw@kernel.org, andrew@lunn.ch, olteanv@gmail.com, kuba@kernel.org, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, linux@armlinux.org.uk, luizluca@gmail.com, maxime.chevallier@bootlin.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, alvin.sipraga@analog.com, gusfmora@gmail.com, kuncy7@gmail.com, fabianotassotti@gmail.com, gabonpivovich@gmail.com, contact@c127.dev, o.rempel@pengutronix.de References: Content-Language: pl In-Reply-To: From: Mieczyslaw Nalewaj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.27100 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Add the RTL8367S-VB (chip ID 0x6642, version 0x0010) to the chip table. It is the first chip of family D, whose handling was added in the preceding patches, so this is the patch that makes it reachable. The chip exposes seven ports, numbered 0-4, 6 and 7, which port_mask in its chip info describes, as for the other chips. The SGMII/HSGMII SerDes sits on port 6 and the MII/TMII/RMII/RGMII interface on port 7, as on family C, but the external interface indices are one lower (EXT0 and EXT1 instead of EXT1 and EXT2). rtl8365mb_family_d selects the family D implementations added in the preceding patches: the force-mode configuration, the VLAN 4k accessors, the PVID handling, the L2 entry (de)serializers and the QoS priority numbering. Unlike family C, rtl8365mb_family_d leaves jam_table unset (NULL), so no family C initialization jam sequence is run during switch setup; the subsystems touched by family D program their required registers explicitly. This matches the vendor RTL8367D API, where dal_rtl8367d_switch_init() returns without writing anything. Several addresses of the family C jam table are other registers on family D (0x1303-0x1305 and 0x13F9 port_macForceLinkExt, 0x13EB combo port media, 0x09DA mirror leaky/keep, 0x18E0 RLDP). Tests on an EX511 v2 pass the same without the jam, although 20 of the 26 jam registers then read differently than on an image that still writes it. 0x1200 and 0x0884, which the family C jam table sets, do not control the maximum frame length on family D (0x1200 is the egress threshold and IPG register there; 0x0884 does not exist in the vendor RTL8367D register map). The frame length limit is taken from 0x088C. The L2 learning limit is the same as on family C (2112 entries), as given by the Realtek rtl8367 common API (rtl8367_common V1.4.2), so RTL8365MB_LEARN_LIMIT_MAX needs no per-family handling; only its comment is updated. Tested on a TP-Link Archer AX55 v1 (RTL8367S-VB, CPU port over HSGMII (2500base-x) to an IPQ5018) with bridge VLAN filtering and per-port PVIDs, and on a TP-Link EX511 v2 (RTL8367S-VB, CPU port over 1G SGMII to an IPQ5018). On the EX511 v2, jumbo frames up to MTU 8992 pass at 1G with only 0x088C written (0x0883 = 0, 0x03FA = 0x0007 after reset). RGMII mode and throughput above 1 Gbps on the SerDes port have not been tested. See the cover letter for details. Tested-by: Gustavo Foletto Mora Signed-off-by: Mieczyslaw Nalewaj --- drivers/net/dsa/realtek/Kconfig | 3 +- drivers/net/dsa/realtek/rtl8365mb.h | 4 -- drivers/net/dsa/realtek/rtl8365mb_main.c | 59 +++++++++++++++++++++--- 3 files changed, 55 insertions(+), 11 deletions(-) diff --git a/drivers/net/dsa/realtek/Kconfig b/drivers/net/dsa/realtek/Kconfig index f1530ba..e366632 100644 --- a/drivers/net/dsa/realtek/Kconfig +++ b/drivers/net/dsa/realtek/Kconfig @@ -35,7 +35,8 @@ config NET_DSA_REALTEK_RTL8365MB depends on NET_DSA_REALTEK_SMI || NET_DSA_REALTEK_MDIO select NET_DSA_TAG_RTL8_4 help - Select to enable support for Realtek RTL8365MB-VC and RTL8367S. + Select to enable support for Realtek RTL8365MB-VC, RTL8367S and + RTL8367S-VB. config NET_DSA_REALTEK_RTL8366RB tristate "Realtek RTL8366RB switch driver" diff --git a/drivers/net/dsa/realtek/rtl8365mb.h b/drivers/net/dsa/realtek/rtl8365mb.h index 4ebc46d..e3d5b07 100644 --- a/drivers/net/dsa/realtek/rtl8365mb.h +++ b/drivers/net/dsa/realtek/rtl8365mb.h @@ -71,10 +71,6 @@ struct rtl8365mb_family_info { const struct rtl8365mb_family_info * rtl8365mb_get_family_info(struct realtek_priv *priv); -int rtl8365mb_d_ext_config_forcemode(struct realtek_priv *priv, int port, - bool link, int speed, int duplex, - bool tx_pause, bool rx_pause); - static inline bool rtl8365mb_is_d(struct realtek_priv *priv) { return rtl8365mb_get_family_info(priv)->family == RTL8365MB_FAMILY_D; diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c index 32e9dd8..e98ac83 100644 --- a/drivers/net/dsa/realtek/rtl8365mb_main.c +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c @@ -89,6 +89,18 @@ * things will work out-of-the-box for other chips, and a careful review of the * vendor driver may be needed to expand support. The RTL8365MB-VC seems to be * one of the simpler chips. + * + * The RTL8367S-VB (chip ID 0x6642) is not part of the family listed above. It + * belongs to a newer generation, which this driver calls family D. Its + * registers differ in the VLAN table, the external interface speed and RGMII + * configuration, the SerDes, the L2 lookup table (FDB/MDB entry layout, no + * EFID, LUT configuration registers) and the table access control register, + * so the code paths specific to it are selected with rtl8365mb_is_d() or + * through struct rtl8365mb_family_info. Unlike family C, it does not use an + * initialization jam table: the vendor RTL8367D driver leaves switch_init() + * empty, the max packet length is taken from 0x088C (selected by default + * through 0x0883; the alternate config at 0x088D is not used), and 0x03FA + * is left at its reset default. */ #include @@ -119,9 +131,9 @@ #define RTL8365MB_NUM_PHYREGS 32 #define RTL8365MB_PHYREGMAX (RTL8365MB_NUM_PHYREGS - 1) #define RTL8365MB_MAX_NUM_PORTS 11 -/* Valid for the whole family except RTL8370B, which has 4160 entries. - * RTL8370B is mentioned in vendor code but it might not even belong - * to the same RTL8367C family. +/* Valid for the whole RTL8367C family (and for family D, RTL8367S-VB) + * except RTL8370B, which has 4160 entries. RTL8370B is mentioned in + * vendor code but it might not even belong to the same RTL8367C family. */ #define RTL8365MB_LEARN_LIMIT_MAX 2112 #define RTL8365MB_MAX_NUM_EXTINTS 3 @@ -824,6 +836,10 @@ static int rtl8365mb_c_ext_config_forcemode(struct realtek_priv *priv, int port, bool link, int speed, int duplex, bool tx_pause, bool rx_pause); +static int rtl8365mb_d_ext_config_forcemode(struct realtek_priv *priv, int port, + bool link, int speed, int duplex, + bool tx_pause, bool rx_pause); + static const struct rtl8365mb_family_info rtl8365mb_family_c = { .family = RTL8365MB_FAMILY_C, .jam_table = rtl8365mb_c_init_jam, @@ -845,6 +861,24 @@ static const struct rtl8365mb_family_info rtl8365mb_family_c = { .qos_set_untag_pcp = rtl8365mb_c_qos_set_untag_pcp, }; +static const struct rtl8365mb_family_info rtl8365mb_family_d = { + .family = RTL8365MB_FAMILY_D, + .ext_config_forcemode = rtl8365mb_d_ext_config_forcemode, + .vlan_4k_read = rtl8365mb_d_vlan_4k_read, + .vlan_4k_write = rtl8365mb_d_vlan_4k_write, + .vlan_port_get_pvid = rtl8365mb_d_vlan_port_get_pvid, + .vlan_port_reset_pvid = rtl8365mb_d_vlan_port_reset_pvid, + .vlan_pvid_port_set = rtl8365mb_d_vlan_pvid_port_set, + .vlan_pvid_port_clear = rtl8365mb_d_vlan_pvid_port_clear, + .l2_entry_size = RTL8365MB_D_L2_ENTRY_SIZE, + .l2_data_to_uc = rtl8365mb_d_l2_data_to_uc, + .l2_uc_to_data = rtl8365mb_d_l2_uc_to_data, + .l2_data_to_mc = rtl8365mb_d_l2_data_to_mc, + .l2_mc_to_data = rtl8365mb_d_l2_mc_to_data, + .qos_iprio_to_hw = rtl8365mb_d_qos_iprio_to_hw, + .qos_hw_to_iprio = rtl8365mb_d_qos_hw_to_iprio, +}; + /** * struct rtl8365mb_chip_info - static chip-specific info * @name: human-readable chip name @@ -935,6 +969,19 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = { }, .num_tx_queues = 8, }, + { + .name = "RTL8367S-VB", + .chip_id = 0x6642, + .chip_ver = 0x0010, + .family_info = &rtl8365mb_family_d, + .port_mask = PORT_MASK(GENMASK(4, 0) | BIT(6) | BIT(7)), + .extints = { + { 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) }, + { 7, 1, PHY_INTF(MII) | PHY_INTF(TMII) | + PHY_INTF(RMII) | PHY_INTF(RGMII) }, + }, + .num_tx_queues = 8, + }, }; enum rtl8365mb_stp_state { @@ -2020,9 +2067,9 @@ static int rtl8365mb_c_ext_config_forcemode(struct realtek_priv *priv, int port, return 0; } -int rtl8365mb_d_ext_config_forcemode(struct realtek_priv *priv, int port, - bool link, int speed, int duplex, - bool tx_pause, bool rx_pause) +static int rtl8365mb_d_ext_config_forcemode(struct realtek_priv *priv, int port, + bool link, int speed, int duplex, + bool tx_pause, bool rx_pause) { u32 r_tx_pause; u32 r_rx_pause; -- 2.53.0