From patchwork Sun Apr 30 11:28:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 13227189 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37608C7EE21 for ; Sun, 30 Apr 2023 11:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230139AbjD3Lfn (ORCPT ); Sun, 30 Apr 2023 07:35:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40300 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229477AbjD3Lfi (ORCPT ); Sun, 30 Apr 2023 07:35:38 -0400 X-Greylist: delayed 400 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Sun, 30 Apr 2023 04:35:35 PDT Received: from perseus.uberspace.de (perseus.uberspace.de [95.143.172.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29AB02701 for ; Sun, 30 Apr 2023 04:35:34 -0700 (PDT) Received: (qmail 18674 invoked by uid 988); 30 Apr 2023 11:28:52 -0000 Authentication-Results: perseus.uberspace.de; auth=pass (plain) From: David Bauer To: Sean Wang , Landen Chao , DENG Qingfang , Daniel Golle , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: [PATCH 1/2] mt7530: register OF node for internal MDIO bus Date: Sun, 30 Apr 2023 13:28:32 +0200 Message-Id: <20230430112834.11520-1-mail@david-bauer.net> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Bar: / X-Rspamd-Report: BAYES_HAM(-2.999999) R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) SUSPICIOUS_RECIPS(1.5) X-Rspamd-Score: -0.099999 Received: from unknown (HELO unkown) (::1) by perseus.uberspace.de (Haraka/3.0.1) with ESMTPSA; Sun, 30 Apr 2023 13:28:52 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=david-bauer.net; s=uberspace; h=from; bh=1CwuYfvRbtvDggjy1KUcLv3iiE191S7uqbxY1wuyIr0=; b=ZbtXbBd/kO8pqErhBWiIYRRlfZkANNXqJv6XUkTRqVaZ1yUqjgL8WchfyNL9dEf6Z4cnG+WgG7 zLNfx5NUihvGk9H5Q86mpSU1KLSQE28vE0kNSrJK1bIUV+1/RI5P3zTnsqxH+TxXpITizsg7qH0k vnhQhfCJ+KfDN+gqeJt9PmjXNDDatkip7ppHh4hZ0dnjKfJmwlgrxjGE71O+TWVfMqJKyR28YdbW kkQ0ffCvMN8QfNKwOQg3YsOFzIg6fLGuI7LoiGwnxm4suFTm+13bFep5CUFynlrB7i4Z06FdZpau 7L0zaculLlrnKD5Dxd1ekxTIrMytJmYqajs8lt3+M8xnWcd6zqAbjIIaLX9la3SRqG3tJhjdFfPG TBJfYCx4nB0N9bFQO80Kq87oGJC/ioubnBiNMBgx5efBrTveLE7L3HjcjcdgJMufGfqUUg4ebTWm d+v7+nInuLQ19Tu3blzw6hdeYnfIGojUFqzMnnXG2bNWq1sa0JHUjmCkizBCgFcqeN3AyNTlMUJU fb5vBZOt/rR/hOdtDSpjpHNV/FYGXBat+htaDWouyNPHkEBVauYF7w1iIuiRVcrEwYtn2eOMpgNm 0L5m2CoXibIYntiRa5kMt9uszM/WbeF0NKWWFLrPapQwHOEp4qo9hSff7m6bXPIAokXYYgYsiZXA o= Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org 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 Acked-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 c680873819b0..7e8ea5b75c3e 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2119,10 +2119,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; @@ -2141,7 +2144,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 Sun Apr 30 11:28:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Bauer X-Patchwork-Id: 13227188 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AAFEC77B73 for ; Sun, 30 Apr 2023 11:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229774AbjD3Lfl (ORCPT ); Sun, 30 Apr 2023 07:35:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjD3Lfi (ORCPT ); Sun, 30 Apr 2023 07:35:38 -0400 Received: from perseus.uberspace.de (perseus.uberspace.de [95.143.172.134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 657B2271C for ; Sun, 30 Apr 2023 04:35:36 -0700 (PDT) Received: (qmail 18696 invoked by uid 988); 30 Apr 2023 11:28:54 -0000 Authentication-Results: perseus.uberspace.de; auth=pass (plain) From: David Bauer To: =?unknown-8bit?q?Andrew_Lunn_=3Candrew=40lunn=2Ech=3E=2C_Florian_Fainell?= =?unknown-8bit?q?i_=3Cf=2Efainelli=40gmail=2Ecom=3E=2C_Vladimir_Oltean_=3Co?= =?unknown-8bit?q?lteanv=40gmail=2Ecom=3E=2C_=22David_S=2E_Miller=22_=3Cdave?= =?unknown-8bit?q?m=40davemloft=2Enet=3E=2C_Eric_Dumazet_=3Cedumazet=40googl?= =?unknown-8bit?q?e=2Ecom=3E=2C_Jakub_Kicinski_=3Ckuba=40kernel=2Eorg=3E=2C_?= =?unknown-8bit?q?Paolo_Abeni_=3Cpabeni=40redhat=2Ecom=3E=2C_Rob_Herring_=3C?= =?unknown-8bit?q?robh+dt=40kernel=2Eorg=3E=2C_Krzysztof_Kozlowski_=3Ckrzysz?= =?unknown-8bit?q?tof=2Ekozlowski+dt=40linaro=2Eorg=3E=2C_Matthias_Brugger_?= =?unknown-8bit?q?=3Cmatthias=2Ebgg=40gmail=2Ecom=3E=2C_AngeloGioacchino_Del?= =?unknown-8bit?q?_Regno__=3Cangelogioacchino=2Edelregno=40collabora=2Ecom?= =?unknown-8bit?q?=3E=2C_=B1n=C3=A7_=C3=9CNAL__=3Carinc=2Eunal=40arinc9=2Eco?= =?unknown-8bit?q?m=3E=2C_Landen_Chao_=3CLanden=2EChao=40mediatek=2Ecom=3E?= =?unknown-8bit?q?=2C_DENG_Qingfang_=3Cdqfext=40gmail=2Ecom=3E=2C_Sean_Wang_?= =?unknown-8bit?q?=3Csean=2Ewang=40mediatek=2Ecom=3E=2C_Daniel_Golle_=3Cdani?= =?unknown-8bit?q?el=40makrotopia=2Eorg=3E?= Cc: 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 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus Date: Sun, 30 Apr 2023 13:28:33 +0200 Message-Id: <20230430112834.11520-2-mail@david-bauer.net> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230430112834.11520-1-mail@david-bauer.net> References: <20230430112834.11520-1-mail@david-bauer.net> MIME-Version: 1.0 X-Rspamd-Bar: / X-Rspamd-Report: BAYES_HAM(-3) R_MISSING_CHARSET(0.5) MIME_GOOD(-0.1) MID_CONTAINS_FROM(1) SUSPICIOUS_RECIPS(1.5) X-Rspamd-Score: -0.1 Received: from unknown (HELO unkown) (::1) by perseus.uberspace.de (Haraka/3.0.1) with ESMTPSA; Sun, 30 Apr 2023 13:28:54 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=david-bauer.net; s=uberspace; h=from; bh=sTYmJdxkbJ6INid41yoAQ9uYdKno4uxUMFR5arFxeCc=; b=jOG5PZqyf0Fr/vBRT7d3DIMKD7eTMbfb4F6YNlEPi9GCL326ZHSewYXKDuO5hSwHhWvjJrlDb8 V9U9sNTecZc3GGlBu3ZBAdFdPPiZ4dCI0YQoJV6oaAlc6GP5SGF0BE+7DbsSTH8WLCX3oINCTVvI TJxipRze5M8tl2c65CrX3SKFDBikA4xMg1Xz25Uxh8A4bqTKd7uN47dTk2GP8riZ84aVV31olbAL Bnb8pX9sLT+hqrKFAhStBiUgmE1w7UCTCqFLIRmPTF4nlg8BFFzHEUOWQJEJzqIX/in2TtmwMWuD JXy/jjU++UOmqBtW5OHXsha20f8d05y0AGWc4s2HOHjwhgXf6FPwBKrRzlUy4Gw5dBC1YOQOWz1f cXeIvoXXOSRVdh7C8uN1hY8vq7Qu8ymv2BQgivOg/TFVEAT7TJC1I3U3tRotGcfR+PLw32hLZFlX T+/d4EXZm5w1WBjNrFOrsAdpaNg0a1b+d8VaBAcecVjc2OWV3w/ZROGkVJLkwJX+4PmB9cTAvZS0 bkvL0akVRqCTdZV8exHIQyTzergXnTYH7ZIAsVynx/ZHEoXr1E44g6VfFzmWytA8Tp7P7BzDoyZ7 eCW4IuxOS3kWXlvJ37cSHw7LKr1XrTcXMFnh6D7ByBe9H4amiCLIhaTnnLkCV8QaXeKxWl5av9xC 8= Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Document the ability to add nodes for the MDIO bus connecting the switch-internal PHYs. Signed-off-by: David Bauer --- .../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 e532c6b795f4..50f8f83cc440 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: