From patchwork Sun Oct 13 21:27:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Petrous via B4 Relay X-Patchwork-Id: 13834042 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 4A70BCF2591 for ; Sun, 13 Oct 2024 21:29:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=sKgphTabq1CYFZ2eYndC2IQMG83Fe3LeAKIWkqkIHRU=; b=a6/vpe5u3Ny/IAlXbEbulTtrIV 5c5R632barMt+BQzbXYWkJmsvgzN2eyU1J70cRuK/WbVzyMsWHsnsG0Bj5Ki/zXUirI+iyuf5RHNj gln1t/T9BhKqacQ5z3wzpEL2kHRmyMq4ctUegFbebQW0grV4naCEsHmgDcHNLDo5vz9H/VawoiJg4 TfS7vF0y35H3riGPSOi8tYgHSftc6FLDVl+5NqTYG7b0VmTQpFtXFUXdUA6jHFsSzUeZlGzAGGoWg yn2nYl0Py1WNB7SNljtFRCQpYD952ixsuO4/h8byMjCx4k94vIshQv80yqo+baJe49hvOah/bDmnX d4N9XLvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t069X-00000003G9Q-1ClL; Sun, 13 Oct 2024 21:29:27 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t0687-00000003Fpw-2tDU for linux-arm-kernel@lists.infradead.org; Sun, 13 Oct 2024 21:28:01 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id C9ECC5C5616; Sun, 13 Oct 2024 21:27:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 87542C4CEC5; Sun, 13 Oct 2024 21:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1728854877; bh=2J/X2hiCuNODJ8Ht7z/AVpabipXFZ+tjUjf+e1KY4Bc=; h=From:Subject:Date:To:Cc:Reply-To:From; b=oQyJ9f1IxArTESrxsU6Qy/b9vgNtSpYoTlB2W+1unAU1ILkDe4TQAwdL4Y3f09DbY npkIB4XN3+qkAT3BOOvy25d1WmiFGHwXopcnY3F9i9+Qrkbkd10W13PgJOguBCqAOO kHmN+o/5WJ/kd81Q/v51kvyohk1l4IBimFjeOCBN1v8HUL6n7rgKcyvp0JuO00F1OL P6AJkFmlWm0Dd95u2EXEUrY/Xk8liyiIkl6QT7x0YQ/XN16/2UYDHJEfqhJD4uV1Fd 2zdMgmgJXmh+1J2b/2Vu26wU/iD1uqmAwVsTnn7NGTooV+p5IALXAVjbkztRQnYXZ1 dZs/Ke1hQ7LdA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6B891CF2591; Sun, 13 Oct 2024 21:27:57 +0000 (UTC) From: Jan Petrous via B4 Relay Subject: [PATCH v3 00/16] Add support for Synopsis DWMAC IP on NXP Automotive SoCs S32G2xx/S32G3xx/S32R45 Date: Sun, 13 Oct 2024 23:27:35 +0200 Message-Id: <20241013-upstream_s32cc_gmac-v3-0-d84b5a67b930@oss.nxp.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAEc7DGcC/x3MSQqAMAxA0atI1hY0db6KSKk1ahYONCqCeHeLy 7f4/wEhzyTQRA94ulh4WwN0HIGb7TqR4iEYMMEsqVGrc5fDk12MaHTOTIt1qqjqlPoy71MsIJS 7p5Hv/9p27/sBCKI3SmUAAAA= To: Maxime Coquelin , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vinod Koul , Richard Cochran , Andrew Lunn , Heiner Kallweit , Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Emil Renner Berthing , Minda Chen , Nicolas Ferre , Claudiu Beznea , Iyappan Subramanian , Keyur Chudgar , Quan Nguyen , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Giuseppe Cavallaro Cc: linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, imx@lists.linux.dev, devicetree@vger.kernel.org, NXP S32 Linux Team , "Jan Petrous (OSS)" , Jacob Keller , Serge Semin , "Russell King (Oracle)" , Andrei Botila X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1728854875; l=3830; i=jan.petrous@oss.nxp.com; s=20240922; h=from:subject:message-id; bh=2J/X2hiCuNODJ8Ht7z/AVpabipXFZ+tjUjf+e1KY4Bc=; b=N1XXm6twcb9Ly1bnTdMtCh4TGGSqesmvTCxPJmrgU+2pNf3ToKecL1yajDIOnK73jRj1Q3EHe vxK6Gt65iKWB8mchgSwkwz0/M1t85nndEj/7IowP7Z6TX/iJwOdUGoa X-Developer-Key: i=jan.petrous@oss.nxp.com; a=ed25519; pk=Ke3wwK7rb2Me9UQRf6vR8AsfJZfhTyoDaxkUCqmSWYY= X-Endpoint-Received: by B4 Relay for jan.petrous@oss.nxp.com/20240922 with auth_id=217 X-Original-From: "Jan Petrous (OSS)" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241013_142759_855900_2F9F00DF X-CRM114-Status: GOOD ( 13.30 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: jan.petrous@oss.nxp.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The SoC series S32G2xx and S32G3xx feature one DWMAC instance, the SoC S32R45 has two instances. The devices can use RGMII/RMII/MII interface over Pinctrl device or the output can be routed to the embedded SerDes for SGMII connectivity. The provided stmmac glue code implements only basic functionality, interface support is restricted to RGMII only. More, including SGMII/SerDes support will come later. This patchset adds stmmac glue driver based on downstream NXP git [0]. [0] https://github.com/nxp-auto-linux/linux v3: - switched to b4 WoW to overcome threading issue with b4 - extracted the hunk with the typo fix from v2 patch#1 to separate patch as Jacob suggested - removed dead code for RMII/MII support, which will be added alter - used new rgmii_clock() helper in other stmmac:dwmac glue drivers - yaml: compatible strings compressed to simple one "nxp,s32-dwmac", removed duplicated required properties, already defined in snps,dwmac, fixed example v2: - send to wider audience as first version missed many maintainers - created rgmi_clk() helper as Russell suggested (see patch#4) - address Andrew's, Russell's, Serge's and Simon's comments Message-ID: Signed-off-by: Jan Petrous (OSS) --- Jan Petrous (OSS) (16): net: driver: stmmac: Fix CSR divider comment net: driver: stmmac: Extend CSR calc support net: stmmac: Fix clock rate variables size net: phy: Add helper for mapping RGMII link speed to clock rate net: dwmac-dwc-qos-eth: Use helper rgmii_clock net: dwmac-imx: Use helper rgmii_clock net: dwmac-intel-plat: Use helper rgmii_clock net: dwmac-rk: Use helper rgmii_clock net: dwmac-starfive: Use helper rgmii_clock net: macb: Use helper rgmii_clock net: xgene_enet: Use helper rgmii_clock net: dwmac-sti: Use helper rgmii_clock dt-bindings: net: Add DT bindings for DWMAC on NXP S32G/R SoCs net: stmmac: dwmac-s32: add basic NXP S32G/S32R glue driver MAINTAINERS: Add Jan Petrous as the NXP S32G/R DWMAC driver maintainer net: stmmac: dwmac-s32: Read PTP clock rate when ready .../devicetree/bindings/net/nxp,s32-dwmac.yaml | 97 +++++++++ .../devicetree/bindings/net/snps,dwmac.yaml | 1 + MAINTAINERS | 7 + drivers/net/ethernet/apm/xgene/xgene_enet_hw.c | 16 +- drivers/net/ethernet/cadence/macb_main.c | 14 +- drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 ++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + drivers/net/ethernet/stmicro/stmmac/common.h | 2 + .../ethernet/stmicro/stmmac/dwmac-dwc-qos-eth.c | 11 +- drivers/net/ethernet/stmicro/stmmac/dwmac-imx.c | 15 +- .../net/ethernet/stmicro/stmmac/dwmac-intel-plat.c | 20 +- .../ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 2 +- drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c | 30 +-- drivers/net/ethernet/stmicro/stmmac/dwmac-s32.c | 237 +++++++++++++++++++++ .../net/ethernet/stmicro/stmmac/dwmac-starfive.c | 19 +- drivers/net/ethernet/stmicro/stmmac/dwmac-sti.c | 18 +- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +- .../net/ethernet/stmicro/stmmac/stmmac_platform.c | 2 +- include/linux/phy.h | 21 ++ include/linux/stmmac.h | 10 +- 21 files changed, 424 insertions(+), 119 deletions(-) --- base-commit: 18ba6034468e7949a9e2c2cf28e2e123b4fe7a50 change-id: 20240923-upstream_s32cc_gmac-6891eb75b126 Best regards,