From patchwork Sat Jun 1 00:03:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Wang X-Patchwork-Id: 10971117 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 834776C5 for ; Sat, 1 Jun 2019 00:03:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 685D028AB7 for ; Sat, 1 Jun 2019 00:03:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5BEC328B44; Sat, 1 Jun 2019 00:03:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD0F028AB7 for ; Sat, 1 Jun 2019 00:03:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=JAXqHvg1RLSgjj6qVnpjuJYxRpDLeFnmIJqeTsE5DLs=; b=cT9r3LDzjmu1Hb aMV8UGPK6aAmIGIz4lGrUXK1uvPDslm8Ovbi0zYb8x1UYLToiVDkANviN1LCbc52yzhllXI7rTaqs 5t/lFQPzzPUVCAlcPSMaLJMKDc/0aq1jomkM9R7DgafZ6BAuBToUPP9Z/rQGG/Fk0yIUSumYMVD8i 0OzIP5u+I4t4tEqhK8bLxTk3ybNWxl2Mgd6lMG0XOqQWcHCNvH1imKDkWlHlLIBQO5M+MnxxJ5rP0 L0CMmj8LjgaH2GhxRAmoeJjPfdIYXRc87Dd0Z3ieTeUPXUfgFitI9UiMtUdnmtBq9I8/BIAIkgXe3 yVpyp9Sdqdz3br+8i/EA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWrUh-0000oR-69; Sat, 01 Jun 2019 00:03:31 +0000 Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hWrUe-0000nE-O3 for linux-mediatek@lists.infradead.org; Sat, 01 Jun 2019 00:03:29 +0000 X-UUID: 1b0cb8993744472b9b2715e3b749d7b6-20190531 X-UUID: 1b0cb8993744472b9b2715e3b749d7b6-20190531 Received: from mtkcas67.mediatek.inc [(172.29.193.45)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 2001991282; Fri, 31 May 2019 16:03:20 -0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 31 May 2019 17:03:19 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Sat, 1 Jun 2019 08:03:17 +0800 From: To: , Subject: [PATCH net-next v1 0/6] Add MT7629 ethernet support Date: Sat, 1 Jun 2019 08:03:09 +0800 Message-ID: <1559347395-14058-1-git-send-email-sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190531_170328_780419_C080A634 X-CRM114-Status: UNSURE ( 9.27 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, nbd@openwrt.org, Sean Wang , linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+patchwork-linux-mediatek=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sean Wang MT7629 inlcudes two sets of SGMIIs used for external switch or PHY, and embedded switch (ESW) via GDM1, GePHY via GMAC2, so add several patches in the series to make the code base common with the old SoCs. The patch 1, 3 and 6, adds extension for SGMII to have the hardware configured for 1G, 2.5G and AN to fit the capability of the target PHY. In patch 6 could be an example showing how to use these configurations for underlying PHY speed to match up the link speed of the target PHY. The patch 4 is used for automatically configured the hardware path from GMACx to the target PHY by the description in deviceetree topology to determine the proper value for the corresponding MUX. The patch 2 and 5 is for the update for MT7629 including dt-binding document and its driver. Sean Wang (6): dt-bindings: clock: mediatek: Add an extra required property to sgmiisys dt-bindings: net: mediatek: Add support for MediaTek MT7629 SoC net: ethernet: mediatek: Extend SGMII related functions net: ethernet: mediatek: Integrate hardware path from GMAC to PHY variants net: ethernet: mediatek: Add MT7629 ethernet support arm64: dts: mt7622: Enlarge the SGMII register range .../arm/mediatek/mediatek,sgmiisys.txt | 2 + .../devicetree/bindings/net/mediatek-net.txt | 14 +- arch/arm64/boot/dts/mediatek/mt7622.dtsi | 3 +- drivers/net/ethernet/mediatek/Makefile | 3 +- drivers/net/ethernet/mediatek/mtk_eth_path.c | 323 ++++++++++++++++++ drivers/net/ethernet/mediatek/mtk_eth_soc.c | 97 +++--- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 177 +++++++++- drivers/net/ethernet/mediatek/mtk_sgmii.c | 105 ++++++ 8 files changed, 647 insertions(+), 77 deletions(-) create mode 100644 drivers/net/ethernet/mediatek/mtk_eth_path.c create mode 100644 drivers/net/ethernet/mediatek/mtk_sgmii.c