From patchwork Tue Jul 18 21:29:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 13318319 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A819EEB64DA for ; Wed, 19 Jul 2023 06:24:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=5X3XXWlY4ncsj/lcqFwlEZR5H7pF6hkXCDdtwdDgOCA=; b=BLhGi/YW8zrFeVKYUfX5Jt3761 dTp1QApNSzjb3oJUI1h/Mk9GKlGO8VqyAL/COAFwmqTTg5bgAn3AhUD63TvodIVvRpmCPzTxo+Vqe gUyVR2VYJx8ktIN7dCFgu1G952JPGLHL97NCRFSCa0Bx/KlhEKo/TJFKwmiOUD8N9Q2VYSxwnbAb+ Lt66Of7cnykF/FGexx3uNUue8G+gQuHThqbwO99A2Q3Ni12RyNOMd9qemb+A2u+ry/O51LD8cWgAe J2XDWYkCwLuhPp10VXn8D7svhrZT4CufZyemxCyq6QpurFn5drE2yO6tQBfigYCgva0GaytrFVauC E0cpg6pw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM0br-005hzz-1o; Wed, 19 Jul 2023 06:24:27 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM0bl-005hvZ-02; Wed, 19 Jul 2023 06:24:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Type:MIME-Version:Message-ID: Subject:To:From:Date:Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:In-Reply-To:References; bh=5X3XXWlY4ncsj/lcqFwlEZR5H7pF6hkXCDdtwdDgOCA=; b=a0donNQFyTiHkqcySB4xHMl8OV Dw11En+q/6H+xqCQN1B8qWgEI67CpEaxrIgZXMT3LREezgAsLX7sJU0+Uoje0+y9LYmTCCmagLV+o aagOwJL5cURNrU/hFWmmekZJBTWOCwJcP6z92XS0OB22qXnMErNcUSPeMzJEXE2+PEr0paZ+0lHJf H25ZPDZTTU1gjF9eoNlbBrVt8nplUt/bPChob2ibCZe+fS0sDAfJDxiAJ9Iok+35zH4dGxmmwkwHr hzCFGQ8wGO9lww9FpynrO52JBvtZEFC8xS8gUOj+zMVyR7OgDwWBk58EShwgynD9b2eIXE+w86kSJ AZMQvScw==; Received: from pidgin.makrotopia.org ([185.142.180.65]) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLsHF-00C4FC-0i; Tue, 18 Jul 2023 21:31:11 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qLsGe-0001Jh-1v; Tue, 18 Jul 2023 21:30:00 +0000 Date: Tue, 18 Jul 2023 22:29:48 +0100 From: Daniel Golle To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , Florian Fainelli , Greg Ungerer , =?iso-8859-1?q?Bj=F8rn?= Mork , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH net-next v3 0/9] net: ethernet: mtk_eth_soc: add basic support for MT7988 SoC Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_223043_559047_D3852D60 X-CRM114-Status: GOOD ( 14.37 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org The MediaTek MT7988 SoC introduces a new version (3) of the NETSYS block and comes with three instead of two MACs. The first MAC can be internally connected to a built-in Gigabit Ethernet switch with four 1000M/100M/10M twisted pair user ports. The second MAC can be internally connected to a built-in 2500Base-T Ethernet PHY. There are two SerDes units which can be operated in USXGMII, 10GBase-(K)R, 5GBase-R, 2500Base-X, 1000Base-X or SGMII interface mode. This series adds initial support for NETSYS v3 and the first MAC of the MT7988 SoC connecting the built-in DSA switch. The switch is supported since commit 110c18bfed414 ("net: dsa: mt7530: introduce driver for MT7988 built-in switch"). Basic support for the 1000M/100M/10M built-in PHYs connected to the switch ports is present since commit ("98c485eaf509b net: phy: add driver for MediaTek SoC built-in GE PHYs"). Changes since v2: * Use version number instead of feature bits for NETSYS version * Remove unneeded check for NULL when calling mtk_pcs_lynxi_destroy * Reduce dt-bindings to what is actually needed at this point for the driver to work. Changes since v1: * Set MTK_MAX_DEVS to 3 instead of converting to dynamic number of Ethernet MACs. * use mtk_m32 when ever possible * more small improvements and minor comments addressed Daniel Golle (3): dt-bindings: net: mediatek,net: add missing mediatek,mt7621-eth dt-bindings: net: mediatek,net: add mt7988-eth binding net: ethernet: mtk_eth_soc: convert clock bitmap to u64 Lorenzo Bianconi (6): net: ethernet: mtk_eth_soc: add version in mtk_soc_data net: ethernet: mtk_eth_soc: increase MAX_DEVS to 3 net: ethernet: mtk_eth_soc: rely on MTK_MAX_DEVS and remove MTK_MAC_COUNT net: ethernet: mtk_eth_soc: add NETSYS_V3 version support net: ethernet: mtk_eth_soc: convert caps in mtk_soc_data struct to u64 net: ethernet: mtk_eth_soc: add basic support for MT7988 SoC .../devicetree/bindings/net/mediatek,net.yaml | 101 ++++- drivers/net/ethernet/mediatek/mtk_eth_path.c | 36 +- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 398 ++++++++++++++---- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 327 +++++++++----- drivers/net/ethernet/mediatek/mtk_ppe.c | 18 +- .../net/ethernet/mediatek/mtk_ppe_offload.c | 2 +- drivers/net/ethernet/mediatek/mtk_wed.c | 4 +- 7 files changed, 661 insertions(+), 225 deletions(-)