From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=66.163.185.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796422066; b=R2icE+OH+K3QSZooyMmOC6aBgZzUDj5mUZb7Mpj4d5N812vEqTS0NO9KJo/xM94zGnBE FGp3kdfxxkffel+ap0WJwpBeskRZ+Tt5Cnfeb8DR2y/f5SVS+okFufdvlItI9V1yDVi3J /rILAwxvkQIagKghDdLE6iUTmnzhpqfGyZaJgbMjQ9kx3LUxnx6tBRCQ6xOpbCrJkxoxJ jrbHU1hMoCpvcG9bYZOJ23lkQGw57PqPZv2mZmpz7NYUEHiG/EwtcrnOSrL2M4ucuC3fF JxvjkGeEH7MqP70+REaHQ2eBPlRYTkkKeDVQl3ELNZoKOTaGSNgDLNXWBLjgU4+rvGw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796422066; 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=LhhKgnWTPLloLHU6/yV38aJTzch8Owd0KtBeNB4tdbo=; b=P7LhPpd3Ageq+lO/GMy4AuoBNiB3VMUb9lUzsVzSIhklAVkBf+DsHbU8lfpiLvo5sfi8 trcefK9e/Sd3oecJhR4D9LMjapzV6lFdzp8e23CFa0+JhH6Y1S7TAmr9y46GAnSVY5lw6 j9XRoUF1As5+/UPCOMhPSHgf52gQawE1LUOBQ4BpUrd+KQp0j+G9phqjXpg7bRTJCatZV EotwAf/rPvgihUvEb/8Wp2fXnnzrm2eZ1o4DsI9AmZDsXH/mEUIXp7QQO/vm3/NK+gEvW wBfBzleQdMmuvx67B2csyozyTP987dXeBCY8iHrhnx6qeQqwDNhg+TLNYrW/TSuVDCg== 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=g0AjXbfy; arc=none smtp.remote-ip=66.163.185.148 Received: from sonic305-22.consmr.mail.ne1.yahoo.com (sonic305-22.consmr.mail.ne1.yahoo.com [66.163.185.148]) (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 68FAE606A330 for ; Fri, 4 Dec 2026 22:07:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 68FAE606A330 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=g0AjXbfy DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796422065; bh=LhhKgnWTPLloLHU6/yV38aJTzch8Owd0KtBeNB4tdbo=; h=Date:Subject:To:References:In-Reply-To:From:Content-Type:From:Subject:Reply-To:Content-Type; b=g0AjXbfyiwIpSMF3pX5zXuDRJdZFLa/x58LXhh3NVrj3l8gK5t6PfyuwtBERZO0o3TTiii93NLH GifCMxnOuzdoaUAQHUm08KinC8CFF8g3MvWNRjbCCYpXXCXVnDWnKmRta7HN0q9zTdCMoeNkiKLi2 mC4IpM9A3MXTDChY9M0dOWnN40sO+9os5xwVo77i23a3j59RPohfq8ESXbehBkDx32aL1/U973oHi 0iL7fW708QLjYQ6q2fIWdtcf/KiUriA7ssTVbUWnCi+WoYxOp+gRpTj3ajDjcg6HgFbjntSNPFH1o /FS2Hq3kzOmorB/ADkqWLoJAJxddiiCooK+g== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1796422065; bh=I/DKnE1/uv2EeF4HVCxCPn/lHKWyPUFp34f6izZGFfi=; h=X-Sonic-MF:Date:Subject:To:From:From:Subject; b=CgDe38LiBldoSEKzp/E7NtV8Prp iyu3Lrbscu4BfeVOrgSzxHhbzSQlGXaJrLGG8yqfMCOdNebH3iGgmTxZQL2QGzwD/4o0LFYmBzRZI FOOrukAuwRIUxX7Cr4A+EA4ZxKQMcuFAiljbs85kkzvZ3cWWQaxBrN+NAjK/spk67GhyZUbIb29w/ cBxQEtN8yTbcTJ12FWM6uyHsTKrvaP4AKiEpkz2sXIn4W31obpOjg7lyO7sha2cbxGYMbZtPEEAlw 0deVE5fHcF0fXBkcmV3hr0ArxSPnsQE+UpQNGv9NvBY1Y+HjReuUI+4CP/CVt9Xdw4Em9rw9zvi0W ipMDqhA== X-YMail-OSG: UUbgUiMVM1nMJQDJabkh1qZwGFOcEu0RbWqU4pendA07peJK05Y7MHPB84FRR9l uK5RnfJJJWRhlcJQqrugIVd.duzeXUkzQgKlpTvONNJ0snTwiA8qmyCbnlZvq3uvrlGgUQvyXVe. UCzh4pRiJHCo1h8d4aqpoc5t7vQiKlBPsFkF8t.rpXlZ6XYaISaDp94AXXrn.v4gWiMm5x8sibvQ .sX9uljU.zHyBO0DsW9Se_p0bihw.xnf.C607yGnK04n1u4TNsMkrifLOExFT5FVDgMelt9Fk.c7 fiTAcqp6M0VfyTnaXMQ8equIB6TxZhnWRhG2e7zf_yuPxbY4H1rHJIK2vMYRbss9Mto3vGLtNpb0 KaKeE4z.HGE9jx7LFyKUM4bpgs8ILfcTjHsnUsTfXM5xdmJKMKY7DHwggN1rnvymvGigV8npqiEs 1cv72CY.k7wgvcjo2c_v5ULNPUthw1qJPzbhNQYH7._FowK5vye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cViTae_krYjRsc2oSsjimeWMR6 9lPVTPb3oSEcUd6n4THzxZNfuMAY8IanRAaj_L2sBmsCWDASljKbtC9GyowLKixPwYXGgRlpDEaR w.csK2NJrT5qrGP9_StYA11ADhz5uxZ.6Hmpui21pL.8oNMPUujzh.F7tcJB7So01YjbWZY9Cs2Z vOrprExUm.HTjZJzr9vXYMmMs.clCQVN9IFLvvmCyjwFW2BDiJo1.aXlOdAmjFSAID6Ga_neXEJg s91LWQTNktN_NEIJ5AZpXLBp10iTYsfIi1_byKd0d5_PE75_0bl1QK50AJYDNPTu5vFO5rRPRyX9 d7EZDdxSpByQggzLOMYeezxb5JkQdjNOrk54wcSxlVt_a1g9lgKifuY6dw92Cb2l33Z7KarHRmDz XygWyKbGwta9DWTSJm3b_suIbUOgN.7w8WklSkgPOHvIES4SM0vRtsbN3oEMoPWZOUuXd6zhBBQ_ u0aPYWNSP9npqWYll8n0JQyf7jNCykRCYySqPQ2XaitP4ijMIRe.XtopJsj4UYj9sNyznaQj2L5K 30xRITSDQhx4LqzNdFfhbotaaBc.I5v2dYTqTqjJvKPu9unu1Fr2yqz35JYHRBWDaXAN_oyo17pm HMoDGiV0PtzHevjrT3YI.l0pYEL5GOE9rYdiquwJjFXOhPodizhObzSsGgluDC6REvTqywkCixMI fYBRpDYpEOwju.jEcrXo4wFqCR7tX2Y.jukbWOeZEBLvTm53oo9y.HV8WoYCVZFsknUX1BR3LqA8 5a8IfNDShmw.18lovZXBIRgtfdiiznkBVz3gGAM4um7s9rePc2w-- X-Sonic-MF: X-Sonic-ID: 82d93110-431c-453c-bd28-d60cb16932b9 Received: from sonic.gate.mail.ne1.yahoo.com by sonic305.consmr.mail.ne1.yahoo.com with HTTP; Fri, 4 Dec 2026 22:07:45 +0000 Received: by hermes--production-ir2-7c4859dc89-8drgr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID d9b473070862bfba835ef7cb47674188; Fri, 04 Dec 2026 22:07:41 +0000 (UTC) Message-ID: <6172622a-5dbc-4e3e-a3d7-b0d67fd15386@yahoo.com> Date: Fri, 4 Dec 2026 23:07:38 +0100 X-Mailing-List: netdev@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 v20 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: <9efcb80a-517c-4413-8261-4f9380e0eb83@yahoo.com> Content-Language: pl In-Reply-To: <9efcb80a-517c-4413-8261-4f9380e0eb83@yahoo.com> From: Mieczyslaw Nalewaj Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.27159 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 0ada87b..bdcd6c2 100644 --- a/drivers/net/dsa/realtek/rtl8365mb.h +++ b/drivers/net/dsa/realtek/rtl8365mb.h @@ -70,10 +70,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 57fdee5..bcdde4b 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 { @@ -2030,9 +2077,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