From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=178.21.23.139 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796408938; b=vJCPYVLFvYfk3BN9LdmRgQiqLyLp55zUOAQgKR5E3F6fMN3UT7WVHWufhQXnnPuZpcNo cZG+/X8q7Ci62W0D5+caLwSGiCcF7d3KhJJhO91F0N0cKNc3vJ+ZYCIwLgxnVPkpawZfs 6dOlvoGRHMZERsP/yxlyVB93vIEv/s25+osA+bn15g1O4POP3Ptke4IhnOpbv3acXcadM yyrVXrbCDXowTQ2KsTfzxsSFZcj8hpP0QmgKeuQs7bshwz6Arc4jPjCLI1cDXnamr54hX TiMoYg4UoSmX+qRQeoWEK+ak8xImkhXV7u5af+NgNPdulHCJtYaQnVSGJYTPQeD9RQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408938; h=DMARC-Filter:Received:X-Virus-Scanned:Received:DKIM-Signature:From: To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Transfer-Encoding; bh=X1RlyO8F52W1MzLOu38EX3CyJbMn4S2ozdm0yWGsnJQ=; b=QPDAVCYiFSqXzqTZ29oXcEYqg20lbDsMAGIaq/ma1eVqt0T151dBJrKXS8uvJb9DvM+P yx4TCUNgOKfIe+4SMFVqUpEED50BIYpX2QUeyHDBxK8bFXXjycOdu7lhG1ia6Of1sZIH+ VOxdr2dKGnDlpQ6T7ekffL7qWlTAsQDfxq15awJoGFxArcd3ial8zi+yo+0SeJpv2M1KH NT2+H8MzfXHra37HZEwgVsSY5QmXt0e91LHDPVldpPlGbNXxIrSX1UBqFZS52aFnngWcG xz8Q5Cshuuyrkcuj4wvb7kFguNtu1cfJ529U6kTRI5s9kyjq4ztNvsOrFm8k/Ws4uJQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=disroot.org; spf=pass smtp.mailfrom=disroot.org; dkim=pass header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=kn3x5pNl; arc=none smtp.remote-ip=178.21.23.139 Received: from layka.disroot.org (layka.disroot.org [178.21.23.139]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8B426606A322; Fri, 4 Dec 2026 18:28:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8B426606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=disroot.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=disroot.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=disroot.org header.i=@disroot.org header.a=rsa-sha256 header.s=mail header.b=kn3x5pNl Received: from mail01.layka.lan (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id E726C82F00; Fri, 04 Dec 2026 19:28:55 +0100 (CET) X-Virus-Scanned: SPAM Filter at disroot.org Received: from layka.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id FnXCTeHAZd3K; Fri, 4 Dec 2026 19:28:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1796408935; bh=tNhpxjt5uZawkxZ/hfMC9QXqkYKc+T/T0PBF74LTDys=; h=From:To:Cc:Subject:Date; b=kn3x5pNlDboY1eylevAGgGJLNNe+c4WUd5SYNhmlWIGRbthBrIyZD0CipLcdHO6kS TPLqxg97EMhDtN1htQu25O4aZuG/gzvqhPEfBPF8AMDHZ6dVQ7Z2mBk+3O4XPLwjet gXSzVS9a/ZU1XM+9j2M20rnpiS7UYVCOZ6GrwqHT/vCPyimVF7Z9QMKxBHaqwEtFtj KBl3cBOKmS3H3coje4L2sMrPuwmIsxsGfc75L70HPwEdv+NKoGZw5gfj0T9anl/+Rv XgIJ7fz3Z5HlS2+I6GXGnHz65ciy/eeBCtRs+KozHnCUg6QvfmyqIwgPpj71FAtiDT LUmzuU2Ibbaaw== From: Rustam Adilov To: Linus Walleij , Luiz Angelo Daros de Luca , =?UTF-8?q?Alvin=20=C5=A0ipraga?= , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiner Kallweit , Russell King , Willem de Bruijn , Simon Horman , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Rustam Adilov Subject: [RFC PATCH net-next 0/6] net: dsa: realtek: add support for RTL9607C switch Date: Fri, 4 Dec 2026 23:25:14 +0500 Message-ID: <20261204182553.33952-1-adilov@disroot.org> 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 Content-Transfer-Encoding: 8bit This patch series adds support for the embedded switch in RTL9607C. It is a 11 port switch controller with 4 internal PHYs corresponding to ports 0~3, PON serdes which is for the PON port 5, 2 HSGMII serdes for ports 6-7 but the former is muxed with USB3 and latter is muxed with PCIE1, and also CPU NIC port somehow, and 2 main CPU NIC ports at 9/10. The support is done through the introduction of the realtek-mmio interface driver which the RTL9607C switch makes use of. That is also the only reason why it is RFC and not v1. I didn't get the any review on that during the testing in OpenWrt at [1] PR. The patch 1 is the tag driver which is similar to what i have posted prior at [2] but a few things were changed like commit message making clear what is similar and what is not and how the reason codes are handled. And now the long awaited DSA driver is coming with it too. DSA driver itself is pretty basic, in a similar fashion to how the initial RTL8365MB switch support was added in [3]. I suspect the VLAN, FDB, MDB, and all the other goodies can be added in the future (though probably not by me as i'm very much not experienced in advanced networking). I do very much know that they are very similar however. And the patch 4 fixes one thing that is needed for the c45 part of the RTL9607C to function properly. I do hope it is not gonna cause any issues on any existing systems. I think it could be carved out if it turns out to be valid. [1] https://github.com/openwrt/openwrt/pull/26969 [2] https://lore.kernel.org/all/20261119165129.26693-1-adilov@disroot.org/ [3] https://lore.kernel.org/all/20211018093804.3115191-1-alvin@pqrs.dk/ Rustam Adilov (6): net: dsa: tag_rtl8_4: add support for RTL9607C tag variant net: dsa: realtek: add new mmio interface for drivers dt-bindings: net: dsa: realtek: add new rtl9607c switch compatible net: dsa: realtek: add support for RTL9607C switch net: phy: realtek: use mdio.addr instead of 0 in rtlgen_read/write_vend2 net: phy: realtek: add support for RTL9607C internal PHYs .../devicetree/bindings/net/dsa/realtek.yaml | 59 +- drivers/net/dsa/realtek/Kconfig | 14 + drivers/net/dsa/realtek/Makefile | 3 + drivers/net/dsa/realtek/realtek-mmio.c | 84 + drivers/net/dsa/realtek/realtek-mmio.h | 29 + drivers/net/dsa/realtek/realtek.h | 1 + drivers/net/dsa/realtek/rtl83xx.c | 38 +- drivers/net/dsa/realtek/rtl83xx.h | 1 + drivers/net/dsa/realtek/rtl9607c_main.c | 1525 +++++++++++++++++ drivers/net/phy/realtek/realtek_main.c | 140 +- include/net/dsa.h | 2 + net/dsa/Kconfig | 3 +- net/dsa/tag_rtl8_4.c | 171 +- 13 files changed, 2047 insertions(+), 23 deletions(-) create mode 100644 drivers/net/dsa/realtek/realtek-mmio.c create mode 100644 drivers/net/dsa/realtek/realtek-mmio.h create mode 100644 drivers/net/dsa/realtek/rtl9607c_main.c -- 2.56.1