From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=66.163.187.32 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796069861; b=DSzwunFBWp7Fq+AU9blkmRdMrhz+6ePcwCXT83lx5JipY8T0rkFbFxW1QLoqrzR/vW3S wbFCKuJ1hgwOKqXVHaPiGVhV8JbOktuKrXSfnxxCyl24MUvvDNm47Dzuio60VkMHsDyyE ib6ryK0d7vmj1dwBlgzaby+IPrRrVFRWx3heZFsi/N+Fu1GPmoho08wTopRIq84ZS42/R djvpWFAwwMKy5BQPiXSbH1hBDZuBaWYuAjswMD+onATgbstB9tNibyerfGWac74Tqi+bQ p9QbTOEOOzzG8cFQ/O5PmWsIslNaB1eEI2JffnMMOYVvAJo1RAFpQnZjC1nEOJAQYsg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796069861; 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=xQR5cxs2Eby1lUo1Cde4yNdV//a/2jFbsHsSvCCWP8w=; b=aDAh9tmxAYhSFwwBwEelJ3fFUWVn8gcO2DwceFsvPT49FkOgbrAI2fDFfJyEf3FRhWQo W6fjMDC1WxOcJpPuSfAz/fjP96zRhAV4Sw96RzrHeCDeqq2kax/JbXzSOOI33VVayNy3u kuTraH46FrL7dANQb5rER7lFb1sYyT3fxbmQVqT8AzUH2vhRqWQToq5sN2B0vmV1nsAAn MJ6VXKhfWEHOMlPpySk0+6XV8Un0O1/La1j/HiEZt2KqJWEA3SCM71Sm6jams4LWBmor5 p3Le1cpBRtjwJbq0OrMzNHW4bymetXPJW1MpmXv1nJo6viWrWVaUCCz4nht4mWnHlYw== 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=hBtgaO1b; arc=none smtp.remote-ip=66.163.187.32 Received: from sonic308-9.consmr.mail.ne1.yahoo.com (sonic308-9.consmr.mail.ne1.yahoo.com [66.163.187.32]) (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 6D223606A327 for ; Mon, 30 Nov 2026 20:17:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D223606A327 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=hBtgaO1b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796069860; bh=xQR5cxs2Eby1lUo1Cde4yNdV//a/2jFbsHsSvCCWP8w=; h=Date:Subject:To:References:In-Reply-To:From:Content-Type:From:Subject:Reply-To:Content-Type; b=hBtgaO1bmaQu0PltCtF/WPO5XziRHwoGu7SRpLEff+1s6iW7aOUtPEXrFrwo0d+co1iqXdfKmFbunc8UHywqukGkUvT0U/XgHxffMxej9k/GmjHVKfqiCg0UKGy3HDBGzRzOnmaHUTvd7K+x1eeZZQlgH0TK9mkoNhdLxPTVnnRYTWC7VZBNGToKu9AUBWn6p4TnFlsS+30rl1PG2pXfS9afAYFvls+MVxOmb1pVqN6Kam3SwwTf/DhSpPBobCdWZ04eLkWispejclqV48uReLWsIaJxyw78GBV2bcbE901UqfLSXFVJe1EIQzKR48keBg+NfXRIkMmEGPQ9XLXUFg== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796069860; bh=ZO3TWBFG4ttCqIaeBjSkq9ig4sujrJksE9vNDbllQEG=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=dw+Bj9YPNsZRyjeWHeZl9vRax83kP9MWanMuHcdApBaiVlvkpLhDnyj3RgsKVuFuJb+WO53kmGWz57hepqpMlasaJAc66w2a7MZDbqP+rXBTBzxFUsKR/SUajxzbhsGsg7D+P3dZtdrwxidCkwwH7986XWGI2+jmEqDkTJjW9NHLBD8ZyWVjGJR0GFC3ljlLmdEy8KC2ugtMGmPESEM5g5G890WLzY3EZcAdCCFqEOQZC2+hxTs+fQtiOXF9sJWl0r0RpBjSgkfCoyBdXlZDqGTogO26aaW7vu0//i/LB/wAhoadz2SkRCurD5b4eWq/ydStbtH6Dhl9dADUIP1UDA== X-YMail-OSG: 6VuuEzoVM1lWvmoE5131Yz4D1M0TNEG06okvlezG2zFL9qxgIRRAMM1FdHLrZpU 8Whjdca3aLD9oohkeWc.Z0lEUfCJgokzoPLhQmk8XY8G2NMXAS2rNvQr9HesI8IoW4iYjSS7BIZS .KgXdFNtPwEZRAp.1gP8KLQhY9jzVgq4Qk9KzqSgO5xN_hq4XvQgjOEinaK5SoTQmMAydCg30094 rSzg40FyIvH6XpZW0_v1gtTnVa1Yx6WUSw88IOkxj7wn7bBa81J5Vav.4oRMsev6rGBWs_BkIohm PyjUI._DUHGuo.pEOO17Kz2tljVsBWuzWJTIyRZ.zJJowXs6nAuRkMaCjKXAOf9A9r35wKKY1bMF PzYXt7R1Fh3egvI9rl1Nh0I_Qf6e0J3q80_UkNJOMc_cDil3YDkoGPuNAb1xf8y1X5JNsKRL3cvi pWpaCiMZszX5aiNLf6OY3uWXSsW5jc2FeKItfRJj_g2lYJpVGphn3tFbxWuEgApWL5gg_a8fg4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GUvlZkv1gaGFkjJh_.Kb.9C5f38I08mvbsSPSJ8XT1DHdws_29Pf hDnc3C0P43dAfR3GzA1VBsmX_uzFtVXwQCOQ3H0O.X6D.gcdNGNUjE3HecxE.3xbcLpGxSsrFpPM _7DDGfeEWGqqjZZPXjAp.psIF1Q7YswvYKm7HTsf_oE5UJ7CUXB5qQ5D0z7KIZf.ofEm4Xarru89 vIjioHVRpk8.mzp8n91lmNZPlpVrvRM0NuDVUCzu8gsGWhpIUBAGZV9FYm1y6H3B6HnzxAM1MnWE AujI0Ne705BCGOXZqpmlZPjY1dtHnxBjZ03o71rkmula3Kywymb1gudUJfREHI0G6Wq3oRzB.0HX Fr_FnGOOwK3bAMrsHd7b098988FL2bqQaUDwX9yv4DhHlOAk4BiQBsoprjUDy1sujEuvPhylLkE5 WyqDD8WT5OD4aa6QUoBpAyZZkB2V0jKrXAIFFju5Vt3wajWh_U.7eJ_NingGko9XO5xPEkFYeq5E 2OaLNrm_CaMSPfUBk2PzsBXo8UyNwGrVrPLU.Df.3ZM_KkrfWVxoYfLhpG0iHBEV2MWu_IiYyTdV z3uw_6MsMb9ia6sfOb3LHBtulMCNWABL21V_KGQa1Ei0cXB.N7RHnMFOkBgkp8nWPJVYmyJ1tF58 PcgQnwHjv0UhW.TvcoODOp2kcFQRFd4loRvA0qsbdY9KQloiA8AB9DdrvXw15q.stKfZfAiD7m0G v1LMSHYr2.ZT0FZw7z9V55.l1QA7Gxq4luBa8yKpaGg_v5gkphETu X-Sonic-MF: X-Sonic-ID: b5a97994-616c-4109-8864-661e5a0c361a Received: from sonic.gate.mail.ne1.yahoo.com by sonic308.consmr.mail.ne1.yahoo.com with HTTP; Mon, 30 Nov 2026 20:17:40 +0000 Received: by hermes--production-ir2-7c4859dc89-cgshs (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 1bba8b10488b15cf620ae01158557c78; Mon, 30 Nov 2026 20:17:37 +0000 (UTC) Message-ID: Date: Mon, 30 Nov 2026 21:17:34 +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 v17 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: <236d002f-5ca5-4f12-bf5b-0ed6442e5c9a@yahoo.com> Content-Language: pl In-Reply-To: <236d002f-5ca5-4f12-bf5b-0ed6442e5c9a@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 7dcf401..19d7ab2 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 { @@ -2026,9 +2073,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