From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sonic310-24.consmr.mail.ne1.yahoo.com (sonic310-24.consmr.mail.ne1.yahoo.com [66.163.186.205]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9485D384CF5 for ; Sat, 10 Oct 2026 19:45:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=66.163.186.205 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791661505; cv=none; b=dc6gklO/zf+wJSGwqOFGb58/xpWuOGr1DqFQ9274yz027hsbaDhHbLUnyk58+oVLGivyF7HTXO/UyYPwS69HNCQ9UMJc4lnh4ft5PcdKJmXi6u1xEfzJ7aXug2DBKuAtne4fB7eiiAkO8siz+8Ay8YADvLas6iYXN7fmIve/1A0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791661505; c=relaxed/simple; bh=o4sj9TMlaQemOT0I/UuZE81Gd5fmF8J4vK6aDbcbc3c=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=i3cUdM+s2wzslqiCz4MLVsfUIKol4xoI2tA6nuRmn4Kf5YsGkZVJ4p4VW+ADt1p4p4sPTCsRynBs0HfRB9++KzUS/vMAJyaNF7rLKS9rueYpXCd6/OGBtIktrkcCbNhar7nSlamz/qC35ZTSOm6kRXXySnHwr8rktgsHYQkc0gk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=yahoo.com; spf=pass smtp.mailfrom=yahoo.com; dkim=pass (2048-bit key) header.d=yahoo.com header.i=@yahoo.com header.b=CfrE+yAF; arc=none smtp.client-ip=66.163.186.205 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.b="CfrE+yAF" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1791661497; bh=A1iomQdYyd+5MMtNNZ94Yi3jTdT30m7TFYDS68ug5i0=; h=Date:Subject:From:To:References:In-Reply-To:From:Subject:Reply-To; b=CfrE+yAF9wt2taYlJjIP3s5SLUBv0oZrvMSN2ORXuwfS/vRQs/t0TFxCQBqbQ6TMhq+zOAG8DIJ8smMkTunQS+ddi5GKHadw5C6da0DQb2BWr6wIlbijx3CaS1utBtoD156AqJ1LnNVI2fHWOH5YIclUV7o48+Bm4zGiAC1xWiZ0/TyqBhF3xJgM7Q/0roYyAk1KyMYqGAq/S758B/j7PLUR6X5wsic2WbAe6X9Fu1Yegh6DFm0JfOaB3cs8jbW1mC+pqUVsqCqFSPHSU4SJx9RUTsaIB6LBpxOwN+DbPIthMF6wc1ASB3S3h5L3BiDLKLizi4/a/GSzWhPqPtVwaQ== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1791661497; bh=oj3nEhr834JYy8e5t9x/2Guma05c4jdkGrv/3LvS4QC=; h=X-Sonic-MF:Date:Subject:From:To:From:Subject; b=QoP9Kfh0XVqSDRw6EA87bQG5lm5Tq594SgedHg18RMb9s3JY5gX8q4fgYk2i8zFzPDXPKxECS9Dd7XJTZEnUfBbu0sExarJxuj++e7fuyCV7cpixBya0tRnLUl33nT43KIDAdE3GBVW4VKQxYAQTEMOfKsh8Iq691XppuIF21mG2qZUTA0PqnD191GWWnl+NJ4w9eQhLHtNhHZJ2X5P6v9a7MksitK12t7HjdLGnamzY+BJ4MeVpP4rs3i5F3NYU4+EUARU6E4lharKS63eGdRHJY/4lzmicd7HsJIfKYYIePAD213SqbqkQcveFgAJOsAloJdUsLuzS/abxM7nKGw== X-YMail-OSG: pSxV5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sj1CimHLjjKDIC4pSynjjfsoDAtyKPCVTAz6t0 AO9s.VXaNXo_2kqmRkMSxgrvWEWnraGUs49zepu62iDRIPt4bw_EyKIzsB1ePNI09yn7SbXApgpS 3edf.FsMnywcKjgMCqGjZeHOi9MSqV69dOsFFMTNsi6varEKdPo0eNOgNaLqrbgNtgT9XqVVp8wU zQBXs2Red4zgqMU91LhlrCeHsszEndFrL4XI7a_LO1jTDTBGGSKY- X-Sonic-MF: X-Sonic-ID: b52615f1-a628-4ef0-abe0-b8aea0ed1d9f Received: from sonic.gate.mail.ne1.yahoo.com by sonic310.consmr.mail.ne1.yahoo.com with HTTP; Sat, 10 Oct 2026 19:44:57 +0000 Received: by hermes--production-ir2-5dd9bf4598-lsjm6 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 5f53752bd3862099eb73f04915345000; Sat, 10 Oct 2026 19:44:54 +0000 (UTC) Message-ID: <8d3a9cc7-17cb-46b5-ac78-c7b4055989a7@yahoo.com> Date: Sat, 10 Oct 2026 21:44:52 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH net-next v3 9/9] net: dsa: realtek: rtl8365mb: add support for RTL8367S-VB From: Mieczyslaw Nalewaj 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 References: Content-Language: pl In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailer: WebService/1.1.26668 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 SGMII/HSGMII SerDes of this chip sits on external interface 0 (port 6), and the MII/TMII/RMII/RGMII interface on external interface 1 (port 7), the other way round than on family C chips. The chip reuses the existing initialization jam table. The chip has 8 ports, not 11. Cap priv->num_ports at RTL8365MB_D_MAX_NUM_PORTS for family D. This is a functional change: it sets ds->num_ports, the IRQ domain size and the bound of every loop over priv->num_ports. 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 to an IPQ5018) with bridge VLAN filtering and per-port PVIDs. Signed-off-by: Mieczyslaw Nalewaj --- drivers/net/dsa/realtek/rtl8365mb_main.c | 31 +++++++++++++++++++++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/drivers/net/dsa/realtek/rtl8365mb_main.c b/drivers/net/dsa/realtek/rtl8365mb_main.c index 5d80409..c604560 100644 --- a/drivers/net/dsa/realtek/rtl8365mb_main.c +++ b/drivers/net/dsa/realtek/rtl8365mb_main.c @@ -89,6 +89,12 @@ * 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 and the SerDes, so the code paths specific to it are selected + * with rtl8365mb_get_family(). */ #include @@ -118,9 +124,10 @@ #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. +#define RTL8365MB_D_MAX_NUM_PORTS 8 +/* 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 @@ -874,6 +881,19 @@ static const struct rtl8365mb_chip_info rtl8365mb_chip_infos[] = { .jam_table = rtl8365mb_init_jam_8365mb_vc, .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), }, + { + .name = "RTL8367S-VB", + .chip_id = 0x6642, + .chip_ver = 0x0010, + .family = RTL8365MB_FAMILY_D, + .extints = { + { 6, 0, PHY_INTF(SGMII) | PHY_INTF(HSGMII) }, + { 7, 1, PHY_INTF(MII) | PHY_INTF(TMII) | + PHY_INTF(RMII) | PHY_INTF(RGMII) }, + }, + .jam_table = rtl8365mb_init_jam_8365mb_vc, + .jam_size = ARRAY_SIZE(rtl8365mb_init_jam_8365mb_vc), + }, }; enum rtl8365mb_stp_state { @@ -3787,7 +3807,10 @@ static int rtl8365mb_detect(struct realtek_priv *priv) dev_info(priv->dev, "found an %s switch\n", mb->chip_info->name); - priv->num_ports = RTL8365MB_MAX_NUM_PORTS; + if (rtl8365mb_get_family(priv) == RTL8365MB_FAMILY_D) + priv->num_ports = RTL8365MB_D_MAX_NUM_PORTS; + else + priv->num_ports = RTL8365MB_MAX_NUM_PORTS; ret = devm_mutex_init(priv->dev, &mb->sds_lock); if (ret) -- 2.53.0