From patchwork Sat Aug 5 14:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 13342597 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 183AAC0015E for ; Sat, 5 Aug 2023 14:43:52 +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=bHamsYMKRaMPhubzkLkNWDwzup6VhOCBFWy/2PzAqo4=; b=zNIso4AOfT1ngJvY33746zBoCK z7aQ6hQTL6GBp7Oc9GLnLL1Gi3+4TQB9pjuK9XVFZXyLMRduygxug75L2hIvyqJ8lVl+rQxwTJ8M9 ueGJqsR71Hl+5lEuvK+ZAijrLkpL1Ma5Gfh0zkds9pnwcWfxkJd/k5Fz3jmfDG3IWzSwESBQpF9NW JOiXiyOX8cR0x/5hKs4U4NO5MC8cRVPxYcvaEeXsSsrJBEiZZdby/7wmMkN68kpEBUmkT3R1W3Ky7 TX9pQMXzuCnSeMnS3EQ8nwCNlapNQyCEa5BLPnMCJmLMLyTY1tSuZnSyWJnTlipmtFEn3HUDfD48x HI2RwvQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qSIVT-00EFRY-0y; Sat, 05 Aug 2023 14:43:51 +0000 Received: from pidgin.makrotopia.org ([185.142.180.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qSIVP-00EFPL-1E; Sat, 05 Aug 2023 14:43:48 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qSIUq-0000N9-0A; Sat, 05 Aug 2023 14:43:12 +0000 Date: Sat, 5 Aug 2023 15:42:58 +0100 From: Daniel Golle To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , 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 RESEND net-next 1/2] net: dsa: mt7530: register OF node for internal MDIO bus Message-ID: <6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230805_074347_423183_E0BB4139 X-CRM114-Status: GOOD ( 13.00 ) 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 From: David Bauer The MT753x switches provide a switch-internal MDIO bus for the embedded PHYs. Register a OF sub-node on the switch OF-node for this internal MDIO bus. This allows to configure the embedded PHYs using device-tree. Signed-off-by: David Bauer Signed-off-by: Daniel Golle --- drivers/net/dsa/mt7530.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index 8fbda739c1b35..9bb805de397a9 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2152,10 +2152,13 @@ mt7530_setup_mdio(struct mt7530_priv *priv) { struct dsa_switch *ds = priv->ds; struct device *dev = priv->dev; + struct device_node *np, *mnp; struct mii_bus *bus; static int idx; int ret; + np = priv->dev->of_node; + bus = devm_mdiobus_alloc(dev); if (!bus) return -ENOMEM; @@ -2174,7 +2177,9 @@ mt7530_setup_mdio(struct mt7530_priv *priv) if (priv->irq) mt7530_setup_mdio_irq(priv); - ret = devm_mdiobus_register(dev, bus); + mnp = of_get_child_by_name(np, "mdio"); + ret = devm_of_mdiobus_register(dev, bus, mnp); + of_node_put(mnp); if (ret) { dev_err(dev, "failed to register MDIO bus: %d\n", ret); if (priv->irq) From patchwork Sat Aug 5 14:43:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 13342596 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 D51FBC04A6A for ; Sat, 5 Aug 2023 14:43:52 +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:In-Reply-To:Content-Type: MIME-Version:References: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:List-Owner; bh=Cj2PYvRgpQDJtjUVyJ3ygj/RNNSyJDRds+DiUQsZqiA=; b=aD2KjwaBV8HkmwQ4r3R2vhKfTV dCwMR7PedI8I4ABzyUOEtQWABcgcKH9iXJX66m/kIKvOE2dVq8LCordU6l94Wida2+DzzqnSzAfck +E/p61pHmi7o6z8Cv05aunFs6VWQpclm1S0SD0YZo2JPiANfz6p8MND4nEmcChCMfQTMsNTY4p9cU jTzl3AkE1DsERYWSVu22eqJNsvSZNY4nWkH+97MpzkVKaaDOBrndjA9JF8WkhCPVnSOFsKHeaqvs6 1li72H0cTfkDaLLu8jeJHBNTLLFBcYyV6Vt2O3hHYdRE1KoTfa9p6sDNBYPsG7tfeomOD9FZaSmhA R0p2xcrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qSIVT-00EFRA-02; Sat, 05 Aug 2023 14:43:51 +0000 Received: from pidgin.makrotopia.org ([185.142.180.65]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qSIVP-00EFPK-1A; Sat, 05 Aug 2023 14:43:48 +0000 Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qSIV5-0000NR-1o; Sat, 05 Aug 2023 14:43:27 +0000 Date: Sat, 5 Aug 2023 15:43:19 +0100 From: Daniel Golle To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , 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 RESEND net-next 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus Message-ID: <9aec0fe0cb676b76132c388bb3ead46f596a6e6e.1691246461.git.daniel@makrotopia.org> References: <6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230805_074347_422784_2FB30C53 X-CRM114-Status: GOOD ( 10.29 ) 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 From: David Bauer Document the ability to add nodes for the MDIO bus connecting the switch-internal PHYs. Signed-off-by: David Bauer Signed-off-by: Daniel Golle --- .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index e532c6b795f4f..50f8f83cc440f 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -128,6 +128,12 @@ properties: See Documentation/devicetree/bindings/regulator/mt6323-regulator.txt for details for the regulator setup on these boards. + mdio: + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + description: + Node for the internal MDIO bus connected to the embedded ethernet-PHYs. + mediatek,mcm: type: boolean description: