From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=66.163.186.206 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796169423; b=SeaxNJ3tOtLW4DefgwcxWObXzfEWqFok0u0wfVM2v/V+DHT3Kcd64VX7eXcQLiGXaVS4 dZXFI91m/uO/rxtb0zbv6ON5Z4J3efdNGeGC+UGLINGEVpyXgC4bYuJ2ZiphuNBoKm8Qg fHt/7Viv4Owc6zl2F+jN45AYfYDC+DWfL/xA0xU8N+ZXW5g+Mh1u5Akev13C+Eo9yil2v EGBFAR+WHC7Sh37WJ/rpjZhyZMMYv17mvQvbx/holgBgqEZuc4hcMOGcndmDA0Mh1GYVy DTAFWrT0nSWu1y6YaO76CvznfTMpIokgb42H3UP6ztuWGAAH8wcI8FS3R8zgTyxi2DA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796169423; 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=g+Yq2K4PvU6ZIIL/1DQjhhb+b2IbbqKbXJX2YR4cPIU=; b=vVMw3K46OFR86MqXZ6sblsxwXdrxufAtermhnGC+s08TTKjnsKfLMZG3Z6qAXsMr8JK7 YJttkLoEc7MqHXifpblJLdrx9xj0XKUlkQLPr3TBB8tHkUpn1nqzlOu1XKM1fD8HtxLZN iX4ZOAy03prbW9KJq1DQLD5pJB+rR8twtJwof6sLi/s77Aov48UED4NMkz72/zzrJ5HEj YkTvhwNKGa6fib7O7fbxFS25uA21WOgR/3p3vVNyJZ+8q3dUgu+dHgG0hddFBGG567LWG 9gJ3tZz3ZCLAznI5KQRJ+9OuCF9dWg8B41DVQKPyofjU6iSfY7Bk9rr8ml7iHa4yqxw== 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=OrZvleKq; arc=none smtp.remote-ip=66.163.186.206 Received: from sonic310-25.consmr.mail.ne1.yahoo.com (sonic310-25.consmr.mail.ne1.yahoo.com [66.163.186.206]) (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 12F63606A33A for ; Tue, 1 Dec 2026 23:57:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 12F63606A33A 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=OrZvleKq DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796169422; bh=g+Yq2K4PvU6ZIIL/1DQjhhb+b2IbbqKbXJX2YR4cPIU=; h=Date:Subject:To:References:In-Reply-To:From:Content-Type:From:Subject:Reply-To:Content-Type; b=OrZvleKqA2d2I1b4TpBYVn77Bh7GcupDjqD8F8BH/PfhmqxyyJ+cYrcMpzHuDGMPDsiFtk8LKaExZKRHkk+z78LMAhWfeyzkKA7xGaamvV9Yp6F0gM3s5QSJ0kl/tvqrT4H39oPHwekXnHdE+PGvCMZVOKq2vJFBLC+PrWDcWo7MhsvJNIS7cHj2xDVpZy9EjhvJzR8mJ0CtHW4krPp0LaQqpGbq4I1Upz3NObMbOWx34r7qazdt9X/odNAU2dIJ7f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Hfiotzh7x8Q_94fN4.OjFN gMytyoAGTwpea0xJc.iImCvobHtl2aFgbBwaTZEC.wLHxfmSfE5A9ZAZBOH.819y16nud_FDUt8v 9MjrVKg7.nz5wopn.O_f8.PcalTaMYhwYDBUG9MBgqh7fsuXZL24SJfvb9p.EPzzPbVB7RAvwR6Z 8R7S7DZvt2jlpuQ_GZrdgGoftVkKQ.c.PJKFBOLcOpBy0qjZKOZx2QneFCNFkcxIvkYO82IdYwlP xU.u70XOyvzh5cKAU6jrr_w6DFcWF92Kv0SyPi.uSbBWTB83ho5e8ek.kzdD8XI.4kfo5OwWf0NF 4xdCyxNOuH1epcdnRt0uKCCMeXs6IXg54VedrLdVtYmOgiP0u95Y3qL0.yL9loljQjZc6mEViemk NjEjRFxG_M17IdkzhpxLjp9mtipVUsqLoPnuqIRrC9EiCCVdrzy4JVYewHR9W6mFRW5KVQueEPQH KQvGEAM0kvlgVCOemO6afFT1ScTFBFkTJFclX04Ydk6C39e1FEZybtLuPOriUuxqNBbufjd_oUMg 4CDVR3Timt3IfTCQJf6EkzWsU4pFxXD_2vu6bkMSpLBAsZp3CjlTlt.NZUomvQrmIQ33HbswxuRM I7jBfe5gZtKFEyT147XA.l6qkBB6t147nz4oJUhc_6hi.5K2JKPvp50hl.Q3AX015zoEpl8VPIGM YOEIWLac1qROP4ba7fCtQIkvJBPAwqS1WOlDJmiQTBC_3xdHyJfJO2kTtL8pjHXAEIGiPuwz9zWY D.sCIuSLuixxrqKFJ4q7cwI5Z74wkv7q..VVlJ5Lh1QMWVMRLkec- X-Sonic-MF: X-Sonic-ID: c371a427-89c4-4d23-92bc-7a9d02f5cdbd Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Tue, 1 Dec 2026 23:57:02 +0000 Received: by hermes--production-ir2-7c4859dc89-lptdq (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1ad331625d65122736d771b2a29cec49; Tue, 01 Dec 2026 23:56:59 +0000 (UTC) Message-ID: <925fb208-e8fa-410c-84ed-1b8e2a2b0757@yahoo.com> Date: Wed, 2 Dec 2026 00:56:56 +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 v18 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: <1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1@yahoo.com> Content-Language: pl In-Reply-To: <1383a67b-15e4-4c76-8bbf-65d3cbfa1fc1@yahoo.com> 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 207f59a..4ef1a5b 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 { @@ -2025,9 +2072,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