From patchwork Tue Apr 30 07:29:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648420 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 4F3D7C4345F for ; Tue, 30 Apr 2024 07:30:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Ur+KIX8CE74zW8DoctQead0IQBlJIZqXhVUQEU1SUPk=; b=rKoaC5vi/qruNn r0+sD5YvayFZu+clpWJYsvCd2F4X+p2yx7KyaEz7iAUrhtChzYlAn8KNRO3L3rAemgP3IIR5ZySg8 MZi7fTH6uZuv594QhoQxT39UlFwjdQz3inee3YW2D9hN1z8wNZ7oiY4HOmVhWqzUqrGLYtiXj8hto XTpniIdYEXvkXm8Eypt72DAjl8CPRex6uBYIjjdPS9FSQGRfpeJq7K8wK4ofO4rUs/kwOAGSLpI1l Ndak3XQMcboT33hb5R6NRTP6kVQ4uQgCN2YB8OA1D5EAIIa4zjcg81f4KUL1kaZ19avlsIe1iXjhy 479tZx8/1UrmO0Gi3fFw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw6-00000005R3y-0JwP; Tue, 30 Apr 2024 07:29:58 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw5-00000005R2V-0vaZ for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:29:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=eXa4EdnQqRxUOEPvkBPgsUUIstZOOeI7Xe83F05iy1I=; b=SsIAYAp+mKW4UTHBXS33jOsFmS dENEr3NUa3Th8VGLXsymsuBCfq3haR8za5tO/Kvb4Vhy5ByTd84QIUjU0pzc1EdlgPdXaDc6rG2XF YPotIA+9+/1q6hmh55GqnoTJ/9nurhkafgt9f84G8d1x51ga3sSwQ2wGKyKrBwQbOuGSyrlx75qQr Xcgimzt70Somm4DT9GTg5/mYBIw8tSzhLrDcYFSEsZxMrutgQRXJrBbTFfR6TwBUlQ1cLkUbXqC01 hQtB/7cf3U5xlZivcD6gp4YlMJsT7V8rKi0MF9ZPrFgwXznWrNuERrYFTn0nxkPpXFNX8pxCuQ6fE Hl+RBmiA==; Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hvx-0000000GqFw-1WOo for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:53 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id EBC19240008; Tue, 30 Apr 2024 07:29:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eXa4EdnQqRxUOEPvkBPgsUUIstZOOeI7Xe83F05iy1I=; b=ivrznIROkVpyHE63u+TjwNbGEEdjJk9VEFxmunoMTQ4rFoZJA8nw5cOLe4uwMFAqmvsOj9 1QqE13Ixpnd1CZSx44PGCxtTfjXRLFeTwPqFc2waae9NYVb6KDZJQrC+Fu5PHBUTyWNzw/ jMHQSALZLNJL59gp+hcpzzQPMbKsZujRJKfk8QtBIhcYdgaJ+qFRtVMlZ7yYNoJuDAVv3G bgBga0myqC6mU41XAiQx2DNYBm/SX8v/eRs/ZWcapi380sNG0OAzmx7HF1fHSGXobrEIQm ki8Br/KYj5C0ipQZNWj9R4HwpCF0jUsSLwsU/aOCJx3dt08MoW79vUJzjEzm/w== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:41 +0200 Subject: [PATCH net-next v5 1/7] dt-bindings: net: renesas,rzn1-gmac: Document RZ/N1 GMAC support MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-1-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082950_054146_92FEDBC6 X-CRM114-Status: GOOD ( 11.28 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Clément Léger The RZ/N1 series of MPUs feature up to two Gigabit Ethernet controllers. These controllers are based on Synopsys IPs. They can be connected to RZ/N1 RGMII/RMII converters. Add a binding that describes these GMAC devices. Signed-off-by: Clément Léger [rgantois: commit log] Reviewed-by: Rob Herring Reviewed-by: Geert Uytterhoeven Signed-off-by: Romain Gantois --- .../devicetree/bindings/net/renesas,rzn1-gmac.yaml | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml new file mode 100644 index 0000000000000..d9a8d586e260c --- /dev/null +++ b/Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/renesas,rzn1-gmac.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Renesas GMAC + +maintainers: + - Romain Gantois + +select: + properties: + compatible: + contains: + enum: + - renesas,r9a06g032-gmac + - renesas,rzn1-gmac + required: + - compatible + +allOf: + - $ref: snps,dwmac.yaml# + +properties: + compatible: + items: + - enum: + - renesas,r9a06g032-gmac + - const: renesas,rzn1-gmac + - const: snps,dwmac + + pcs-handle: + description: + phandle pointing to a PCS sub-node compatible with + renesas,rzn1-miic.yaml# + +required: + - compatible + +unevaluatedProperties: false + +examples: + - | + #include + #include + + ethernet@44000000 { + compatible = "renesas,r9a06g032-gmac", "renesas,rzn1-gmac", "snps,dwmac"; + reg = <0x44000000 0x2000>; + interrupts = , + , + ; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; + clock-names = "stmmaceth"; + clocks = <&sysctrl R9A06G032_HCLK_GMAC0>; + power-domains = <&sysctrl>; + snps,multicast-filter-bins = <256>; + snps,perfect-filter-entries = <128>; + tx-fifo-depth = <2048>; + rx-fifo-depth = <4096>; + pcs-handle = <&mii_conv1>; + phy-mode = "mii"; + }; + +... From patchwork Tue Apr 30 07:29:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648421 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 B911DC4345F for ; Tue, 30 Apr 2024 07:30:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VB0Q8Z5P02F3a5P/w4M8VDDy08f2R6cH5by7xYhxFYY=; b=j8hsJ0DWogbLjG QR+0dfuSQso0DgWdOSBWe9mSfCsvT77xisCoHQvg6HKy9MpV6vPdrO2wMNbTMNcHaWAQZbX4lGDEp MiYghXVBo/uv1bhNsjuaUNFcoBsgbrASSKsCn79p40ABwqng13ncQXWULyDwMahRu8iqQHKkWK9gZ 0jaX8us3m6SJzwvcpBpWLoWXkcu3VSiCkWZZmcv+W/LtXEBH0tAvwHQ+5s9xEOTXfRWxezyMcaFQL 2sxiYQa5JhiHv4T99RgExjAFXBX0Y6rjLjOHZEUc0Ju7LNjsGbMffWXRAZ5Ghs3jpsetpPVEm28V3 65937MO+8azC3MZsMrKA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwG-00000005R8F-3gzv; Tue, 30 Apr 2024 07:30:08 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw5-00000005R29-0vc1 for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:29:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=Quwz6Y6DCJb6oI8QivjHVeJ8W6gP2+As4r5PbpcMIik=; b=PqsMptgoKJVwHPEoKhcTnkLcdf 7kPEhGp1A9WrxA2Sq20Pkl5gAxey1Ugwbf1ldXz2bTo6UWdSZBg8/JPkXupC4QuzcxkOalj0yx7RZ 1C6A6NJEFFNt6wRSrEFKDLCxeewlbaZ6BpfqerVvgQxYDUGbbg8WN5ndA7PKZoVOjmuuKrq+EpY4L arrO9ddglV5Me68rWK61NiOoHt8pXK5MTThr1Ra5Rwbrot5tmKf+yDP919qyYKTsLHEWIiWExe/st OYKXMcUEDMy6vA8u9LP1D83fu9J5qBajKlmrodN5pey+7wAy9HOnHmAQvQzvi+NelA4fyZKmj74Xv WEeBV6yg==; Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hvy-0000000GqFy-34UZ for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:53 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 319CF24000B; Tue, 30 Apr 2024 07:29:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462147; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Quwz6Y6DCJb6oI8QivjHVeJ8W6gP2+As4r5PbpcMIik=; b=ZxwuCRRbn1FQlBI4z2c9GSAvPY/TW1CMBCxRD+iRIiteCUzjtF+IQ4XvRXzA/TeRQbyojZ Rrp3s1TWVVeyGCBCwMd4y9jTQG14n56nB6m+ILT0XBATUXn9G88e2bheoEKc1ByN5lP9Ql WnQyfPmWAOdArHELhHYAVH71FPH+pI3pqEpNas/kF0+XvsgIQEJfT07qbTSd6nTKfrzKRe rIPIDNup+s4Ez3ptqXYR4Gs45cAkb0L9RucYO03U1W2aBlTatCwTa9shguXaA0E6FCsedZ jsqZNnusVtA8SdVHVeLSFFNCKqMo7ZppyHuEaKF1jIJHxOkKmQVQTd3Kn/uflQ== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:42 +0200 Subject: [PATCH net-next v5 2/7] net: stmmac: Add dedicated XPCS cleanup method MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-2-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082951_249320_2DD19084 X-CRM114-Status: GOOD ( 12.93 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Serge Semin Currently the XPCS handler destruction is performed in the stmmac_mdio_unregister() method. It doesn't look good because the handler isn't originally created in the corresponding protagonist stmmac_mdio_unregister(), but in the stmmac_xpcs_setup() function. In order to have more coherent MDIO and XPCS setup/cleanup procedures, let's move the DW XPCS destruction to the dedicated stmmac_pcs_clean() method. This method will also be used to cleanup PCS hardware using the pcs_exit() callback that will be introduced to stmmac in a subsequent patch. Signed-off-by: Serge Semin Co-developed-by: Romain Gantois Signed-off-by: Romain Gantois --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 1 + drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++++- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 12 +++++++++--- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index dddcaa9220cc3..7e0d727ed795b 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -361,6 +361,7 @@ int stmmac_mdio_unregister(struct net_device *ndev); int stmmac_mdio_register(struct net_device *ndev); int stmmac_mdio_reset(struct mii_bus *mii); int stmmac_xpcs_setup(struct mii_bus *mii); +void stmmac_pcs_clean(struct stmmac_priv *priv); void stmmac_set_ethtool_ops(struct net_device *netdev); int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 59bf83904b62d..2a55c5d07f6b8 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7789,8 +7789,9 @@ int stmmac_dvr_probe(struct device *device, error_netdev_register: phylink_destroy(priv->phylink); -error_xpcs_setup: error_phy_setup: + stmmac_pcs_clean(priv); +error_xpcs_setup: if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); @@ -7832,6 +7833,9 @@ void stmmac_dvr_remove(struct device *dev) if (priv->plat->stmmac_rst) reset_control_assert(priv->plat->stmmac_rst); reset_control_assert(priv->plat->stmmac_ahb_rst); + + stmmac_pcs_clean(priv); + if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 0542cfd1817e6..508bd39cbe2b3 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -523,6 +523,15 @@ int stmmac_xpcs_setup(struct mii_bus *bus) return 0; } +void stmmac_pcs_clean(struct stmmac_priv *priv) +{ + if (!priv->hw->xpcs) + return; + + xpcs_destroy(priv->hw->xpcs); + priv->hw->xpcs = NULL; +} + /** * stmmac_mdio_register * @ndev: net device structure @@ -679,9 +688,6 @@ int stmmac_mdio_unregister(struct net_device *ndev) if (!priv->mii) return 0; - if (priv->hw->xpcs) - xpcs_destroy(priv->hw->xpcs); - mdiobus_unregister(priv->mii); priv->mii->priv = NULL; mdiobus_free(priv->mii); From patchwork Tue Apr 30 07:29:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648423 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 D586FC41513 for ; Tue, 30 Apr 2024 07:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=r4Zvz4M7nhd2038M+mSonQRPPpL0EixLZZ2HYHJhtpA=; b=qkzdnJnXqgfMdM KSPfG7qLf7cW3BsF7KgolLiuyzi6ulNQj8sGn7tOwa8z1PKESPUZA44j2UtnLwrlj8mbQhIfaGRTe X3cztrp8qH66ni5zkJL6n6p5Whtx1p8LIibpgjiulqM3uKnTR9q1QABWazoxxMXWqaqMf95/MPmy/ Y7kHN1yZ0QL7yG/uWx2hut0Am+wu0NyysqRTk+KAXdv+IQtu1xHozhud64F9Nd08D9kd3xqgpnj12 +tDJUbJL3Ygr1kFbetyC/AXgJczgp5MsEueaYTk4MtJovoBFKW3R6jC8U93O2sKb7eX5FnQI70U5h TnlOTDDbcA+rrGZrAn0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwG-00000005R7o-10qs; Tue, 30 Apr 2024 07:30:08 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw5-00000005R2U-0vAw for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:29:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=jCc/5DWJr0Wmss9ouvVqM9KULQkT2TgxRDjtMCmvwS4=; b=BhIX16yIVSH7OZx4DSwVCluUeA 2aX7JFrjtx4A0zvx3Px6G4oMmTDT9gviZD4Kp/Ub+7lpqIWk+jWyl5sAFEiZTnLMIGaQRe7uSJdyH Z1PnzyTlw72NtvVaoJuxZSaNnhYFVqihJs5kDpqWRiGg//id/FYwzdxT/i7bcEM/t8q5vuUjovrcT GDxqJybjfQBmvKN+SPieG/x0eQmCGnHhwxX2Pqudla42d3SJw1gYTEZnanpo98cXwBCpbDQsOFQyt zN5moVrbSns+j3CljhAo0ZqA09NE6NcIm6mGZATga/zCXkgCOobwvrRxibXLqsw+FDerzbbp+WYMV stp+11Hg==; Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hvx-0000000GqFz-3RBB for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:53 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 5F098240002; Tue, 30 Apr 2024 07:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=jCc/5DWJr0Wmss9ouvVqM9KULQkT2TgxRDjtMCmvwS4=; b=pAzY4EkjIuGARnGVvAgIDQ8cFa96R1aR/0FBMmGH0wAg9XCt29+nv+QwPoBRNRcvxDjRyP 3kftfVP8AnZ9r7v768bnOjFeLVzt/bNbvIq1kSFP3h1tOcgfK6QA5nHG/9yv+v4ftvy+Bw s7b1gybW1popET48vA9HOmukGVWregAlxbRNdmiXNC2Z0tHw1IYX61/LIVNMWjjiFJfYzh tVc7MsxzstZfij/xRn5D4u4thT5/opX0LMeALRtFlkzYbYAJrzg4ANqFsLrasoUPlh7rJb iVlgj50FHZJLoADkZW/shx9MLgw+u272By/mWEnzAc3knPdTGbuUITOGpzYzuQ== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:43 +0200 Subject: [PATCH net-next v5 3/7] net: stmmac: Make stmmac_xpcs_setup() generic to all PCS devices MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-3-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082950_339761_DBF6836C X-CRM114-Status: GOOD ( 16.46 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Serge Semin A pcs_init() callback will be introduced to stmmac in a future patch. This new function will be called during the hardware initialization phase. Instead of separately initializing XPCS and PCS components, let's group all PCS-related hardware initialization logic in the current stmmac_xpcs_setup() function. Rename stmmac_xpcs_setup() to stmmac_pcs_setup() and move the conditional call to stmmac_xpcs_setup() inside the function itself. Signed-off-by: Serge Semin Co-developed-by: Romain Gantois Signed-off-by: Romain Gantois --- drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 ++++---- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 28 ++++++++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h index 7e0d727ed795b..f275f2fd91c3e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h @@ -360,7 +360,7 @@ enum stmmac_state { int stmmac_mdio_unregister(struct net_device *ndev); int stmmac_mdio_register(struct net_device *ndev); int stmmac_mdio_reset(struct mii_bus *mii); -int stmmac_xpcs_setup(struct mii_bus *mii); +int stmmac_pcs_setup(struct net_device *ndev); void stmmac_pcs_clean(struct stmmac_priv *priv); void stmmac_set_ethtool_ops(struct net_device *netdev); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 2a55c5d07f6b8..72f4deda76407 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7754,11 +7754,9 @@ int stmmac_dvr_probe(struct device *device, if (priv->plat->speed_mode_2500) priv->plat->speed_mode_2500(ndev, priv->plat->bsp_priv); - if (priv->plat->mdio_bus_data && priv->plat->mdio_bus_data->has_xpcs) { - ret = stmmac_xpcs_setup(priv->mii); - if (ret) - goto error_xpcs_setup; - } + ret = stmmac_pcs_setup(ndev); + if (ret) + goto error_pcs_setup; ret = stmmac_phy_setup(priv); if (ret) { @@ -7791,7 +7789,7 @@ int stmmac_dvr_probe(struct device *device, phylink_destroy(priv->phylink); error_phy_setup: stmmac_pcs_clean(priv); -error_xpcs_setup: +error_pcs_setup: if (priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) stmmac_mdio_unregister(ndev); diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index 508bd39cbe2b3..af8ad9768da10 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -495,31 +495,37 @@ int stmmac_mdio_reset(struct mii_bus *bus) return 0; } -int stmmac_xpcs_setup(struct mii_bus *bus) +int stmmac_pcs_setup(struct net_device *ndev) { - struct net_device *ndev = bus->priv; struct stmmac_priv *priv; struct dw_xpcs *xpcs; + int ret = -ENODEV; int mode, addr; priv = netdev_priv(ndev); mode = priv->plat->phy_interface; - /* Try to probe the XPCS by scanning all addresses. */ - for (addr = 0; addr < PHY_MAX_ADDR; addr++) { - xpcs = xpcs_create_mdiodev(bus, addr, mode); - if (IS_ERR(xpcs)) - continue; + if (priv->plat->mdio_bus_data && priv->plat->mdio_bus_data->has_xpcs) { + /* Try to probe the XPCS by scanning all addresses */ + for (addr = 0; addr < PHY_MAX_ADDR; addr++) { + xpcs = xpcs_create_mdiodev(priv->mii, addr, mode); + if (IS_ERR(xpcs)) + continue; - priv->hw->xpcs = xpcs; - break; + ret = 0; + break; + } + } else { + return 0; } - if (!priv->hw->xpcs) { + if (ret) { dev_warn(priv->device, "No xPCS found\n"); - return -ENODEV; + return ret; } + priv->hw->xpcs = xpcs; + return 0; } From patchwork Tue Apr 30 07:29:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648427 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 86E34C4345F for ; Tue, 30 Apr 2024 07:32:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=kqRGrRuVkgv7lkI2av1nklOAubvP4+gIDHDdmsNAzYo=; b=wCAA4OPZQgF/0w Va3c8UPB4G0aS/ubCv+V4iQOSXT6lNhsCezF8+El1RUTD8HFy6ld6GpLnsIA4VAY65CbyBEaYpftr ExHKPLZ8SgWCAQ01A4ZocIOEIgQhASJdMThwSLj2ynWQie4JEBGb9NDYn3lmJdG7wdlRjcATPp30e 4njR9GWWRORJ2wehjok2r6Tt7voAkJ7+ppazaqEuI12DXtdVyuhuXwkqHpZ7hlmgCdmONXdKBx95t ezJb/bRKtOt3TFu/Ufn28C4tmQQYIdwmqVop1nSat6WStN729UHHhpeW1BlnXLQUwnvvQ+VEIgbRG V4y1fRo2553Ku0JZexIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hxo-00000005RvZ-3Heg; Tue, 30 Apr 2024 07:31:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwu-00000005RYj-1l4S for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:30:48 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=k5xJj++e/DBPx9ddAMfQsap+qn6muqbGCvqtygpbwCk=; b=jvbZRE7mnKyxJYMS/UDIZpxE7d PrQoaXcH5aCxUSZc/jmV8BYlWHlT+jKOgJmWy7bU/8KUVNftVl4vuPU8Y5xbHYuVfQy/6++dGTFHX Dp+fCziS9kssZI2ok5YF+kd9Cjn8tCwEugs7B/MxeXp9mCZX8r1YNCR4v4nuq1nwjcYN5aVClSRoi AJfqolBoetzsI1VjSbo+wbHr044d3SWerDiWZV31QYmoyK6o+jHMSUyrXIO34ZZnr0dIq39T95lxY R6WEg/psEZCmPyRewTRJMlw696AtRcDMBs6r0pEqkZpfEQPmGE4CR2/UqNDxiwgWirq4cOo/74XQp TCUZgNaw==; Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwf-0000000GqJA-2fzV for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:30:37 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 77A2C24000D; Tue, 30 Apr 2024 07:29:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=k5xJj++e/DBPx9ddAMfQsap+qn6muqbGCvqtygpbwCk=; b=cE/jd3OH5C4sWGElGhuhLznxd5UCD3Vf6u6N1drukFen+XxyVsOikegWQ6dC4laMHLVTor KvXcE47qheuvCv1Z9UE/8+l3WCP5xqjfUDpHBrv+UQlKflGvZPMIIWIpGovomB5+mTW1oz ldjjXkWkYExoWYL2QMZT+xcA01y/lrOHqevDt+SKiRhmPp7gqHIRYJiW9ihiDWdSy28+UO kXsxfhylKYVhyEZlyQ+hFLHZzYGuXHxt9p1QDpUHJRR87rtmkDt+L/UYMGeLjWZD9a5YEf LkT38NHGdZYJsXxidcWSjzz3FraTOGkqXaKvJfqIfhQk3HwXMShdskXYe56x/A== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:44 +0200 Subject: [PATCH net-next v5 4/7] net: stmmac: introduce pcs_init/pcs_exit stmmac operations MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-4-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, "Russell King (Oracle)" , Maxime Chevallier , Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_083034_160381_FE45DB0E X-CRM114-Status: GOOD ( 13.97 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Russell King (Oracle)" Introduce a mechanism whereby platforms can create their PCS instances prior to the network device being published to userspace, but after some of the core stmmac initialisation has been completed. This means that the data structures that platforms need will be available. Signed-off-by: Russell King (Oracle) Reviewed-by: Maxime Chevallier Co-developed-by: Romain Gantois Signed-off-by: Romain Gantois Reviewed-by: Serge Semin --- drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c | 8 +++++++- include/linux/stmmac.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c index af8ad9768da10..1c788caea0cfb 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c @@ -505,7 +505,10 @@ int stmmac_pcs_setup(struct net_device *ndev) priv = netdev_priv(ndev); mode = priv->plat->phy_interface; - if (priv->plat->mdio_bus_data && priv->plat->mdio_bus_data->has_xpcs) { + if (priv->plat->pcs_init) { + ret = priv->plat->pcs_init(priv); + } else if (priv->plat->mdio_bus_data && + priv->plat->mdio_bus_data->has_xpcs) { /* Try to probe the XPCS by scanning all addresses */ for (addr = 0; addr < PHY_MAX_ADDR; addr++) { xpcs = xpcs_create_mdiodev(priv->mii, addr, mode); @@ -531,6 +534,9 @@ int stmmac_pcs_setup(struct net_device *ndev) void stmmac_pcs_clean(struct stmmac_priv *priv) { + if (priv->plat->pcs_exit) + priv->plat->pcs_exit(priv); + if (!priv->hw->xpcs) return; diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index dfa1828cd756a..4a24a246c617d 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -285,6 +285,8 @@ struct plat_stmmacenet_data { int (*crosststamp)(ktime_t *device, struct system_counterval_t *system, void *ctx); void (*dump_debug_regs)(void *priv); + int (*pcs_init)(struct stmmac_priv *priv); + void (*pcs_exit)(struct stmmac_priv *priv); void *bsp_priv; struct clk *stmmac_clk; struct clk *pclk; From patchwork Tue Apr 30 07:29:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648422 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 36C0AC4345F for ; Tue, 30 Apr 2024 07:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LugpOMuDAZjUeDxdF792dNFefOjvbhKcSvo3zpnBApI=; b=Ti2Z/DTZWeKzUT hpRFeeH0ec7LtQXZhdtFa0xf+cFb76bWTpEOJn3A3fa7sFhMFjc2eIOzbYRGi5N0q1h8kItZjyCHU 1GPUjGnN33VCRAHfIcIh8SBdG2e+LvRYCO2CQ9xXS0RVMukJ3a8c9ToT8RDtin7SqTwyASUJ2S+0c rtdADak89xviljnzOAIC0LP/ID9sc8X6aKfFkIuIejNNuACOTSS5h95IvyrB2FArXY4eE1gYytwb4 6486GLfWtdaRYmDwdmkbYuD+GQPlomVwBhrOILJczCt9f2UtYui556Fdww8VpyxBFbd9O0+wM3Nvz BbASRnq7S6DdtY2exoRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwJ-00000005R9v-0wmk; Tue, 30 Apr 2024 07:30:11 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw6-00000005R41-3n1C for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:29:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=V7+0uNrudWCYDEwJNq5iDZw6vcb4ldKLdBbxspu2IAY=; b=cMq3J5W5lqn6SL0T7KH5ZMRDk0 t3rPiQm6HEcyDmG7vD/3BMCOK5coiVOu6QNzjS2nrSbaDttn3JezmqWVABUD9MZkmkSMB0ZolKLVN gHnQ/fPKScNwrNL98RA2Yw/WfJJVWJJ6JZrQJYwwTNqzEKCm5R6p+z1H1FO20LTONV0Vq8J4V9LuJ SHrv41YJuvtSganVqBsc7x95nu1RTaE3nVfoRlELy+w8vvHXmuE5DXwq68CVCLo++/RWMwGFI509A WqB5ccNSNJVyigTx5oHdff7TWNXcgZ1L0FJ0E1YuhG2ZTTV9XO6UQNh5ql8NPw8mI29szL3+1xfNN U3M1CXTA==; Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw0-0000000GqGU-16KK for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:57 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id B95EB24000A; Tue, 30 Apr 2024 07:29:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V7+0uNrudWCYDEwJNq5iDZw6vcb4ldKLdBbxspu2IAY=; b=Z+pbr3pUxZKx7YLOUuYBhbhqgqQQSGFa+G6CfWtyrESIM7dZp9gqGorJEk0CPB8KpJltmk 8C/ys1ygbS9gegAdyz3ArsPxmCUPa7zIltE5CXOS/Z5UaI9XX1Y5VZrVhLMp6FMtDLtkQj TZmSup1g6Rubz8dWzW4Nao4qyiJTKhE2l8W4YJ/FzR3S3pcRKVG+J7tAJC67Ht9N0oOPAS gm/+33aZLv+r2DLMqYY1nxxC/9au7pdgN8bpshd9wvhIoldjf5GoWspNaf4+U4BX03WCKU whb8Nzf5UzbmSwzivpbZcQbjESwdwnzRmKzlQGRKERGV2fgS6h/rUif4qSlITA== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:45 +0200 Subject: [PATCH net-next v5 5/7] net: stmmac: dwmac-socfpga: use pcs_init/pcs_exit MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-5-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, "Russell King (Oracle)" , Maxime Chevallier , Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082953_930351_696A679E X-CRM114-Status: GOOD ( 20.15 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: "Russell King (Oracle)" Use the newly introduced pcs_init() and pcs_exit() operations to create and destroy the PCS instance at a more appropriate moment during the driver lifecycle, thereby avoiding publishing a network device to userspace that has not yet finished its PCS initialisation. There are other similar issues with this driver which remain unaddressed, but these are out of scope for this patch. Signed-off-by: Russell King (Oracle) Reviewed-by: Maxime Chevallier [rgantois: removed second parameters of new callbacks] Signed-off-by: Romain Gantois --- .../net/ethernet/stmicro/stmmac/dwmac-socfpga.c | 107 ++++++++++----------- 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c index 12b4a80ea3aa1..b3d45f9dfb556 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c @@ -379,6 +379,56 @@ static int socfpga_gen10_set_phy_mode(struct socfpga_dwmac *dwmac) return 0; } +static int socfpga_dwmac_pcs_init(struct stmmac_priv *priv) +{ + struct socfpga_dwmac *dwmac = priv->plat->bsp_priv; + struct regmap_config pcs_regmap_cfg = { + .reg_bits = 16, + .val_bits = 16, + .reg_shift = REGMAP_UPSHIFT(1), + }; + struct mdio_regmap_config mrc; + struct regmap *pcs_regmap; + struct phylink_pcs *pcs; + struct mii_bus *pcs_bus; + + if (!dwmac->tse_pcs_base) + return 0; + + pcs_regmap = devm_regmap_init_mmio(priv->device, dwmac->tse_pcs_base, + &pcs_regmap_cfg); + if (IS_ERR(pcs_regmap)) + return PTR_ERR(pcs_regmap); + + memset(&mrc, 0, sizeof(mrc)); + mrc.regmap = pcs_regmap; + mrc.parent = priv->device; + mrc.valid_addr = 0x0; + mrc.autoscan = false; + + /* Can't use ndev->name here because it will not have been initialised, + * and in any case, the user can rename network interfaces at runtime. + */ + snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", + dev_name(priv->device)); + pcs_bus = devm_mdio_regmap_register(priv->device, &mrc); + if (IS_ERR(pcs_bus)) + return PTR_ERR(pcs_bus); + + pcs = lynx_pcs_create_mdiodev(pcs_bus, 0); + if (IS_ERR(pcs)) + return PTR_ERR(pcs); + + priv->hw->phylink_pcs = pcs; + return 0; +} + +static void socfpga_dwmac_pcs_exit(struct stmmac_priv *priv) +{ + if (priv->hw->phylink_pcs) + lynx_pcs_destroy(priv->hw->phylink_pcs); +} + static int socfpga_dwmac_probe(struct platform_device *pdev) { struct plat_stmmacenet_data *plat_dat; @@ -426,6 +476,8 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) dwmac->ops = ops; plat_dat->bsp_priv = dwmac; plat_dat->fix_mac_speed = socfpga_dwmac_fix_mac_speed; + plat_dat->pcs_init = socfpga_dwmac_pcs_init; + plat_dat->pcs_exit = socfpga_dwmac_pcs_exit; ret = stmmac_dvr_probe(&pdev->dev, plat_dat, &stmmac_res); if (ret) @@ -444,48 +496,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) if (ret) goto err_dvr_remove; - /* Create a regmap for the PCS so that it can be used by the PCS driver, - * if we have such a PCS - */ - if (dwmac->tse_pcs_base) { - struct regmap_config pcs_regmap_cfg; - struct mdio_regmap_config mrc; - struct regmap *pcs_regmap; - struct mii_bus *pcs_bus; - - memset(&pcs_regmap_cfg, 0, sizeof(pcs_regmap_cfg)); - memset(&mrc, 0, sizeof(mrc)); - - pcs_regmap_cfg.reg_bits = 16; - pcs_regmap_cfg.val_bits = 16; - pcs_regmap_cfg.reg_shift = REGMAP_UPSHIFT(1); - - pcs_regmap = devm_regmap_init_mmio(&pdev->dev, dwmac->tse_pcs_base, - &pcs_regmap_cfg); - if (IS_ERR(pcs_regmap)) { - ret = PTR_ERR(pcs_regmap); - goto err_dvr_remove; - } - - mrc.regmap = pcs_regmap; - mrc.parent = &pdev->dev; - mrc.valid_addr = 0x0; - mrc.autoscan = false; - - snprintf(mrc.name, MII_BUS_ID_SIZE, "%s-pcs-mii", ndev->name); - pcs_bus = devm_mdio_regmap_register(&pdev->dev, &mrc); - if (IS_ERR(pcs_bus)) { - ret = PTR_ERR(pcs_bus); - goto err_dvr_remove; - } - - stpriv->hw->phylink_pcs = lynx_pcs_create_mdiodev(pcs_bus, 0); - if (IS_ERR(stpriv->hw->phylink_pcs)) { - ret = PTR_ERR(stpriv->hw->phylink_pcs); - goto err_dvr_remove; - } - } - return 0; err_dvr_remove: @@ -494,17 +504,6 @@ static int socfpga_dwmac_probe(struct platform_device *pdev) return ret; } -static void socfpga_dwmac_remove(struct platform_device *pdev) -{ - struct net_device *ndev = platform_get_drvdata(pdev); - struct stmmac_priv *priv = netdev_priv(ndev); - struct phylink_pcs *pcs = priv->hw->phylink_pcs; - - stmmac_pltfr_remove(pdev); - - lynx_pcs_destroy(pcs); -} - #ifdef CONFIG_PM_SLEEP static int socfpga_dwmac_resume(struct device *dev) { @@ -576,7 +575,7 @@ MODULE_DEVICE_TABLE(of, socfpga_dwmac_match); static struct platform_driver socfpga_dwmac_driver = { .probe = socfpga_dwmac_probe, - .remove_new = socfpga_dwmac_remove, + .remove_new = stmmac_pltfr_remove, .driver = { .name = "socfpga-dwmac", .pm = &socfpga_dwmac_pm_ops, From patchwork Tue Apr 30 07:29:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648424 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 D17E3C25B10 for ; Tue, 30 Apr 2024 07:30:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T1Qewv/xYE0CA/hr4ELxXBwM3TPwy2Z0Ll4HhSAUEiA=; b=MJT9XGRfXvcfQY x10eylMyGuLY1YeGNFtIlH2mPiqHMtbwYzKt0ohUrAseFZXYJgQ6kC2OucdmMLl+0s/Df5NJsSsFp czFn1t86PR3Q9dsY/Rr/lV0LNlR58pB7VfdouhclmXVHlfmaq6ixWMOUMaLGH78PYY4S8yiK4T6sS 8jjb6E2KrZSK66BrIoahPhWCidGLwkEkvnNirz2CWdxvbryWFNPUeoKyyLa4hphY/9K+mAmSwXGKk z1B4IJWbmALx4rVcApavaggOJE8pZ9eynZwL8P7OA3QlQkXdJshYmJYzhdDCYciSYZemULEMGvgj1 xDigOBKTvataGqODkG9A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwI-00000005R9D-1Po3; Tue, 30 Apr 2024 07:30:10 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw6-00000005R42-3jkQ for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:29:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=fcmojma0CqiLBLuzAbfh8W/Rg3aQQZKZHQ/Lzjv/9/s=; b=K4qrcjR9O3RztfT2zhSHuowTpv 8nwAbIR2QBKsZ7mD/I8znT3n2q3O3nQcItp2tnxbAhn2a82tpiqjA645aacA5FRJa7gg5wEpKWPLf yBeMmsRF6BqvOlJK2EM0gXQ6W+k7Cw7LAWOykg7WqOKmF/ivdXDb1G/Rq5r7/RvTvvXI3/2aF57j0 i0LyEopiPdEUbL+b2E1CTR371B+wBEILPwR+389UgB5hX0VBL+L59EF3H3sR5khYyLDksquP5JaJC pm33cDdKXrHSoI1UxwPW5u2fr8zKQ7zG673WSh8WEP9hsnb8uqjlbrpnehPN4EzNpI8+fojd3S8Ki 2+UVnG0w==; Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw0-0000000GqGk-1yAg for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:57 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 0FC38240004; Tue, 30 Apr 2024 07:29:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462152; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fcmojma0CqiLBLuzAbfh8W/Rg3aQQZKZHQ/Lzjv/9/s=; b=ODpWQ9LxdiKo+32uZDAR3/KIZ5aLGnf0oMEQow/9ZRFwydDl2m1b4tspRIGBeu8z62Js5J sH7IG5nC9ASj5BHy13Hd8ZY7XOzat/c2NpEkvt1OJKxMqEYqbZpWnTy3dMOqv2Yd4c7yp7 +GEN8LMfmqdHZDLpHMK0+oJRiwH/hKiqraimQXvmph6Jdkg6UO/3y2qZOgand5LVL79K1Z WPlWoIzborFGsnTbJ6ikVdlr0/eEmRE5f9XqgGyVeaTw4mhPU4OE754q++pRS4cywBQp66 yevGUiAvRgbgnAVgAq1pPWHkhcO2IZs9BeDF1dPYHV8FH71tqf66UorqCtI5aw== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:46 +0200 Subject: [PATCH net-next v5 6/7] net: stmmac: add support for RZ/N1 GMAC MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-6-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082954_529144_DBA06E25 X-CRM114-Status: GOOD ( 20.01 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Clément Léger Add support for the Renesas RZ/N1 GMAC. This support can make use of a custom RZ/N1 PCS which is fetched by parsing the pcs-handle device tree property. Signed-off-by: "Clément Léger" Co-developed-by: Romain Gantois Signed-off-by: Romain Gantois --- MAINTAINERS | 6 ++ drivers/net/ethernet/stmicro/stmmac/Kconfig | 12 ++++ drivers/net/ethernet/stmicro/stmmac/Makefile | 1 + drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c | 86 ++++++++++++++++++++++++ 4 files changed, 105 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 943921d642add..b65e9908f8532 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -18876,6 +18876,12 @@ F: include/dt-bindings/net/pcs-rzn1-miic.h F: include/linux/pcs-rzn1-miic.h F: net/dsa/tag_rzn1_a5psw.c +RENESAS RZ/N1 DWMAC GLUE LAYER +M: Romain Gantois +S: Maintained +F: Documentation/devicetree/bindings/net/renesas,rzn1-gmac.yaml +F: drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c + RENESAS RZ/N1 RTC CONTROLLER DRIVER M: Miquel Raynal L: linux-rtc@vger.kernel.org diff --git a/drivers/net/ethernet/stmicro/stmmac/Kconfig b/drivers/net/ethernet/stmicro/stmmac/Kconfig index 4ec61f1ee71a2..05cc07b8f48c0 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Kconfig +++ b/drivers/net/ethernet/stmicro/stmmac/Kconfig @@ -142,6 +142,18 @@ config DWMAC_ROCKCHIP This selects the Rockchip RK3288 SoC glue layer support for the stmmac device driver. +config DWMAC_RZN1 + tristate "Renesas RZ/N1 dwmac support" + default ARCH_RZN1 + depends on OF && (ARCH_RZN1 || COMPILE_TEST) + select PCS_RZN1_MIIC + help + Support for Ethernet controller on Renesas RZ/N1 SoC family. + + This selects the Renesas RZ/N1 SoC glue layer support for + the stmmac device driver. This support can make use of a custom MII + converter PCS device. + config DWMAC_SOCFPGA tristate "SOCFPGA dwmac support" default ARCH_INTEL_SOCFPGA diff --git a/drivers/net/ethernet/stmicro/stmmac/Makefile b/drivers/net/ethernet/stmicro/stmmac/Makefile index 26cad4344701e..c2f0e91f6bf83 100644 --- a/drivers/net/ethernet/stmicro/stmmac/Makefile +++ b/drivers/net/ethernet/stmicro/stmmac/Makefile @@ -21,6 +21,7 @@ obj-$(CONFIG_DWMAC_MEDIATEK) += dwmac-mediatek.o obj-$(CONFIG_DWMAC_MESON) += dwmac-meson.o dwmac-meson8b.o obj-$(CONFIG_DWMAC_QCOM_ETHQOS) += dwmac-qcom-ethqos.o obj-$(CONFIG_DWMAC_ROCKCHIP) += dwmac-rk.o +obj-$(CONFIG_DWMAC_RZN1) += dwmac-rzn1.o obj-$(CONFIG_DWMAC_SOCFPGA) += dwmac-altr-socfpga.o obj-$(CONFIG_DWMAC_STARFIVE) += dwmac-starfive.o obj-$(CONFIG_DWMAC_STI) += dwmac-sti.o diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c new file mode 100644 index 0000000000000..848cf3c01f4ab --- /dev/null +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-rzn1.c @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Copyright (C) 2024 Schneider-Electric + * + * Clément Léger + */ + +#include +#include +#include +#include + +#include "stmmac_platform.h" +#include "stmmac.h" + +static int rzn1_dwmac_pcs_init(struct stmmac_priv *priv) +{ + struct device_node *np = priv->device->of_node; + struct device_node *pcs_node; + struct phylink_pcs *pcs; + + pcs_node = of_parse_phandle(np, "pcs-handle", 0); + + if (pcs_node) { + pcs = miic_create(priv->device, pcs_node); + of_node_put(pcs_node); + if (IS_ERR(pcs)) + return PTR_ERR(pcs); + + priv->hw->phylink_pcs = pcs; + } + + return 0; +} + +static void rzn1_dwmac_pcs_exit(struct stmmac_priv *priv) +{ + if (priv->hw->phylink_pcs) + miic_destroy(priv->hw->phylink_pcs); +} + +static int rzn1_dwmac_probe(struct platform_device *pdev) +{ + struct plat_stmmacenet_data *plat_dat; + struct stmmac_resources stmmac_res; + struct device *dev = &pdev->dev; + int ret; + + ret = stmmac_get_platform_resources(pdev, &stmmac_res); + if (ret) + return ret; + + plat_dat = devm_stmmac_probe_config_dt(pdev, stmmac_res.mac); + if (IS_ERR(plat_dat)) + return PTR_ERR(plat_dat); + + plat_dat->bsp_priv = plat_dat; + plat_dat->pcs_init = rzn1_dwmac_pcs_init; + plat_dat->pcs_exit = rzn1_dwmac_pcs_exit; + + ret = stmmac_dvr_probe(dev, plat_dat, &stmmac_res); + if (ret) + return ret; + + return 0; +} + +static const struct of_device_id rzn1_dwmac_match[] = { + { .compatible = "renesas,rzn1-gmac" }, + { } +}; +MODULE_DEVICE_TABLE(of, rzn1_dwmac_match); + +static struct platform_driver rzn1_dwmac_driver = { + .probe = rzn1_dwmac_probe, + .remove_new = stmmac_pltfr_remove, + .driver = { + .name = "rzn1-dwmac", + .of_match_table = rzn1_dwmac_match, + }, +}; +module_platform_driver(rzn1_dwmac_driver); + +MODULE_AUTHOR("Clément Léger "); +MODULE_DESCRIPTION("Renesas RZN1 DWMAC specific glue layer"); +MODULE_LICENSE("GPL"); From patchwork Tue Apr 30 07:29:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Romain Gantois X-Patchwork-Id: 13648425 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 60FC6C4345F for ; Tue, 30 Apr 2024 07:30:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GMrsCZDA2UxUPIbEw4cu5DT9nQtzgDlQF3R+Su4vu7E=; b=OjZ4cnHFcXfAU3 6lWgJPPn/mKrG9Fh9RLVCUP4hoxG8Su3BL7Bkj5kWf/vS+wZtU2JgrQvGxd5Oxus8qs2bQCXJN8PO qWRonpTfBpijIapPYy0b4WehPzh2rR1uNncF+2rB2U30Ey6lE5XWG8dC6pgb1YusO0MgtYCSYTUey GN86Y/c38KT5sSoWfXHvR2AnzMpP6uAw321ypLI13YdswczKi2otuxHrPpCLaJnFEBB7DGPvcLTZW JuWaDPA3Ps5DgTv+k8odklZlZ7C4VzUdU2KeWQG6qVYSY69IXyefFQevJDTf/R3T01l4LRGj4PDPj GmXfJQkD6LoLo2kSqgig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hwK-00000005RAl-1lQx; Tue, 30 Apr 2024 07:30:12 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw8-00000005R4h-1nKs for linux-arm-kernel@bombadil.infradead.org; Tue, 30 Apr 2024 07:30:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Cc:To:In-Reply-To:References: Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Sender:Reply-To:Content-ID:Content-Description; bh=NzNqKTpVWMnrcgcJVGgyUqBdfYphefuKpHkJ0PXLDgQ=; b=oXZEmGyoDQUUGY7tbAVRJIbdSA wi58jtaxyhK6tPVlRpTeUbi/eMPf44mq2qPrmHNC2etqUL3sJJmbJBSnPqgkppy2OJTw0RTC5TyMI cMYJ9Rr653ga80qorXKHXLda8hlyQ+FJcSK5Kxre/98lbz3wcv8J+E0pBoNZxKz85cHRS26LQvUI+ pKT6zFQ3jFNJL2ZY4+NhdOeilwpWS+mdFQMwYyQafdvTjHZW4Mt4zkmlCkchqBKKUbHm4u0FAuyJ7 YjnyUBVtCmS0k59k9VcxTBdCCe+3dBJvhOmu9AE5TVOnGZyjdqhGQaHwG4kH90/Y94y3AJt0JzGAW mWW+M9JQ==; Received: from relay1-d.mail.gandi.net ([2001:4b98:dc4:8::221]) by desiato.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1hw1-0000000GqGl-2Tsi for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 07:29:58 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 4ABAC240006; Tue, 30 Apr 2024 07:29:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1714462153; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NzNqKTpVWMnrcgcJVGgyUqBdfYphefuKpHkJ0PXLDgQ=; b=CN3T8ALqDDUwQIHWdmnwbu3w3cBGhFiAQoFYmgkkKp2oTWvbq+mhAmBUGZk01NF1VCjA+1 ioZwzqpZZhj16mWwLfSDLz8mIuYOgmGYedI6gfJOj1lVbjZ0Oy05xSF5Dp4JvlBFx6cff7 fOqIuApRSaGeilWB4ncdRG4Wh684KPIJwLhM98+zfSx7dbIEjVwRVFFX3jAlqKmNImx7wQ y8wdQilSlU2nd7KxDYydTtxPevbLWFA9VkHrbZ/MRHJEZqgWrfXd5mpzY5r8uXmZnGHDXb ndvFNdrtZKve1FkpZX9N/juVjL2DgNUHkKkGvFX0JyMtQSU1yl8ZQsUnPY1A7A== From: Romain Gantois Date: Tue, 30 Apr 2024 09:29:47 +0200 Subject: [PATCH net-next v5 7/7] ARM: dts: r9a06g032: describe GMAC1 MIME-Version: 1.0 Message-Id: <20240430-rzn1-gmac1-v5-7-62f65a84f418@bootlin.com> References: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> In-Reply-To: <20240430-rzn1-gmac1-v5-0-62f65a84f418@bootlin.com> To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Geert Uytterhoeven , Magnus Damm , Alexandre Torgue , Jose Abreu , Maxime Coquelin , Russell King , =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= , Serge Semin Cc: Thomas Petazzoni , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Romain Gantois X-Mailer: b4 0.13.0 X-GND-Sasl: romain.gantois@bootlin.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_082954_956393_17BE8E81 X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Clément Léger The r9a06g032 SoC of the RZ/N1 family features two GMAC devices named GMAC1/2, that are based on Synopsys cores. GMAC1 is connected to a RGMII/RMII converter that is already described in this device tree. Signed-off-by: Clément Léger [rgantois: commit log] Reviewed-by: Geert Uytterhoeven Signed-off-by: Romain Gantois --- arch/arm/boot/dts/renesas/r9a06g032.dtsi | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/arch/arm/boot/dts/renesas/r9a06g032.dtsi b/arch/arm/boot/dts/renesas/r9a06g032.dtsi index fa63e1afc4ef4..57c730f43442e 100644 --- a/arch/arm/boot/dts/renesas/r9a06g032.dtsi +++ b/arch/arm/boot/dts/renesas/r9a06g032.dtsi @@ -316,6 +316,24 @@ dma1: dma-controller@40105000 { data-width = <8>; }; + gmac1: ethernet@44000000 { + compatible = "renesas,r9a06g032-gmac", "renesas,rzn1-gmac", "snps,dwmac"; + reg = <0x44000000 0x2000>; + interrupts = , + , + ; + interrupt-names = "macirq", "eth_wake_irq", "eth_lpi"; + clocks = <&sysctrl R9A06G032_HCLK_GMAC0>; + clock-names = "stmmaceth"; + power-domains = <&sysctrl>; + snps,multicast-filter-bins = <256>; + snps,perfect-filter-entries = <128>; + tx-fifo-depth = <2048>; + rx-fifo-depth = <4096>; + pcs-handle = <&mii_conv1>; + status = "disabled"; + }; + gmac2: ethernet@44002000 { compatible = "renesas,r9a06g032-gmac", "renesas,rzn1-gmac", "snps,dwmac"; reg = <0x44002000 0x2000>;