From patchwork Thu Nov 9 21:50:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 16435 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b129:0:b0:403:3b70:6f57 with SMTP id q9csp727491vqs; Thu, 9 Nov 2023 13:51:47 -0800 (PST) X-Google-Smtp-Source: AGHT+IHQ0Q+UERxolr0t2SUIOzh5LqsEHfUjG8bLinFQfEBWo8Vq1eGgb9sQfv1cUqgBjqXzLG1E X-Received: by 2002:a05:6830:1b63:b0:6cc:d4f7:e37d with SMTP id d3-20020a0568301b6300b006ccd4f7e37dmr7015652ote.5.1699566707748; Thu, 09 Nov 2023 13:51:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699566707; cv=none; d=google.com; s=arc-20160816; b=NyYTkdBE7XiBtNc7CbfvrPM7V3ckdltcu9bkR0Y1yw98zTHQLJYFjprClOwrxSEqGM UZpHbJ5Cc3BbPKOeDvDZSdCzb5sdrlYwW1bkPVZr97wYeVyiaRqsSElmSoHYIYlYRVLG 5pr8ryR95KdYyx8UswMJiSpziLrIR0fxAD6aw2cIYVFuuIhmVvK/klNT3GkBZdYTb0Ka ow5/vNnA+WhjQB3eA+3MR7lPkBkmVwmXzYPuRn8YDKusiXzBt/pl7gDtmLGDa6RGT2eu 1REIJxwjQ3rjIj1XhG4wmwTKWiiGKvWal6jRiacNA15cZbAF/uf4OkUATx+0d6N555Cu ttTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=1uolZe8cKTsNCbxzystCWtpbdkBcjS+VBbRWLg1T8NM=; fh=9GVzMIks0k0Waq6W0HUSHcdxejYnykUnl93AUDny5kk=; b=BSljrUGJW5L9lr0Nfy4CLSns7Y8r6zXiBkZSkuv/xSMd3aCDNl0Sfm19b7/+9cZvmm 68eT27nYyXG5ASzjScickPy1U8QJ5h+9XHiKDhTmRVcZkowYBkth0ez5ZyJzRFKRE2QX eaFYYs3RpbPNF2PXhWlbpzgfEXQpzNxFVp4b4kqx2jMpf2emwyQ9BN+ywBNvjuZENGJM 6BkCwnkMQgFB5zbc8JwD1TXgZm3dHmWOsK7yJUSp/5uJBJkWqJ4o0GTDyemxc3Wqr4Xz Mo0My9Vgv4bhhoFpgRGQ86g3DS5fr1ibBAac3e8IHi7yHjTdMUxSpKnkzp+GdZK5JEiM AUTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bw6-20020a056a02048600b005be09f31e07si2332710pgb.553.2023.11.09.13.51.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Nov 2023 13:51:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 90B398336C45; Thu, 9 Nov 2023 13:51:34 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232443AbjKIVvT (ORCPT + 30 others); Thu, 9 Nov 2023 16:51:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231724AbjKIVvS (ORCPT ); Thu, 9 Nov 2023 16:51:18 -0500 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D1A14212; Thu, 9 Nov 2023 13:51:16 -0800 (PST) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1r1CvH-0003Tv-1d; Thu, 09 Nov 2023 21:50:47 +0000 Date: Thu, 9 Nov 2023 21:50:43 +0000 From: Daniel Golle To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chunfeng Yun , Vinod Koul , Kishon Vijay Abraham I , Felix Fietkau , John Crispin , Sean Wang , Mark Lee , Lorenzo Bianconi , Matthias Brugger , AngeloGioacchino Del Regno , Andrew Lunn , Heiner Kallweit , Russell King , Alexander Couzens , Daniel Golle , Philipp Zabel , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-phy@lists.infradead.org Subject: [RFC PATCH 0/8] Add support for 10G Ethernet SerDes on MT7988 Message-ID: MIME-Version: 1.0 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Thu, 09 Nov 2023 13:51:34 -0800 (PST) X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782124859636350695 X-GMAIL-MSGID: 1782124859636350695 This series aims to add support for GMAC2 and GMAC3 of the MediaTek MT7988 SoC. While the vendor SDK stuffs all this into their Ethernet driver, I've tried to seperate things into a PHY driver, a PCS driver as well as changes to the existing Ethernet and LynxI PCS driver. +----------------+ +--------------+ | USXGMII PCS | +------------------+ | Ethernet MAC +--+-------------+ +---+ PEXTP SerDes PHY | +--------------+ | SGMII PCS | | +------------------+ +-------------+--+ Alltogether this allows using GMAC2 and GMAC3 with all possible interface modes, including in-band-status if needed. Daniel Golle (8): dt-bindings: phy: mediatek,xfi-pextp: add new bindings phy: add driver for MediaTek pextp 10GE SerDes PHY net: pcs: pcs-mtk-lynxi: use 2500Base-X without AN net: pcs: pcs-mtk-lynxi: allow calling with NULL advertising dt-bindings: net: pcs: add bindings for MediaTek USXGMII PCS net: pcs: add driver for MediaTek USXGMII PCS dt-bindings: net: mediatek,net: fix and complete mt7988-eth binding net: ethernet: mtk_eth_soc: add paths and SerDes modes for MT7988 .../devicetree/bindings/net/mediatek,net.yaml | 171 ++++- .../bindings/net/pcs/mediatek,usxgmii.yaml | 105 +++ .../bindings/phy/mediatek,xfi-pextp.yaml | 71 ++ MAINTAINERS | 3 + drivers/net/ethernet/mediatek/Kconfig | 17 + drivers/net/ethernet/mediatek/mtk_eth_path.c | 122 +++- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 178 ++++- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 105 ++- drivers/net/pcs/Kconfig | 10 + drivers/net/pcs/Makefile | 1 + drivers/net/pcs/pcs-mtk-lynxi.c | 38 +- drivers/net/pcs/pcs-mtk-usxgmii.c | 688 ++++++++++++++++++ drivers/phy/mediatek/Kconfig | 11 + drivers/phy/mediatek/Makefile | 1 + drivers/phy/mediatek/phy-mtk-pextp.c | 355 +++++++++ include/linux/pcs/pcs-mtk-usxgmii.h | 18 + 16 files changed, 1813 insertions(+), 81 deletions(-) create mode 100644 Documentation/devicetree/bindings/net/pcs/mediatek,usxgmii.yaml create mode 100644 Documentation/devicetree/bindings/phy/mediatek,xfi-pextp.yaml create mode 100644 drivers/net/pcs/pcs-mtk-usxgmii.c create mode 100644 drivers/phy/mediatek/phy-mtk-pextp.c create mode 100644 include/linux/pcs/pcs-mtk-usxgmii.h