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: 13227187 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 C0139C77B73 for ; Sun, 30 Apr 2023 11:30:22 +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:MIME-Version:Message-Id:Date:Subject:Cc :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=NTGApwGkmpKzAWn2ciEfgm08MKU50VvQO29lRXhKze8=; b=VQNVUJ2jp8iGYW HE7C3EPUixMYVsNQq5xBH7lkyKpc+IpeqYyy1g+VQWzepbG7uqiN/mJi5zmFwYBJ8jx2f61PdOVj4 TXnKbc1k2dL4gngZ6Z1RcyJ/J1qVxHUgwDD976OUcPPrTVsjiMviHccuuaS5iorev1x0Gw1pezYEn TpEamoIZpTCIBmHDHVUPtRyHK1lXLeOzXUsK5dJcGCkoA5ABTEtiWQ9NR1X6Sp3sPKg6jx2HPaEd3 lqoKJu+y7+gTf3hi27n+mLHxVmqlvCnhOW7yCWCLN4mmUTStLEwuDrxEvSJNRXxxTRqRi6yqLoGwz vaemP9ZwOAf3+cWMMjhw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pt5Eu-00E568-0D; Sun, 30 Apr 2023 11:29:12 +0000 Received: from perseus.uberspace.de ([95.143.172.134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pt5Em-00E53g-34 for linux-arm-kernel@lists.infradead.org; Sun, 30 Apr 2023 11:29:09 +0000 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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230430_042906_000510_CE0317B8 X-CRM114-Status: GOOD ( 10.88 ) 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 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: 13227186 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 4C564C77B60 for ; Sun, 30 Apr 2023 11:30:21 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GNsoUlvlZjvgX4y/YmrHzcclT4yHTs1LBvdBq1NgNNc=; b=aQZI8kO28pePG7 Pn1F9l8RHzbSae6lBsWsIMfN0x6LM2tPRe0rQSt7RJZ8P969kHXqDUg4KdxukiKKOSsBDvxhZROPi JbNGaq7+CCPoVBpd5hUDL3/duIUvhlR8VxutobAOt/vNAcn9JZngEkC+Kyche6TIvT52s+8qOIuQU eeyARFzuvar9nOjJdnPhgKcVuabNvRmXXBXgXEVUkMy5wquNbH82Su/BYQlehPNU+sGcf7WmzfOXX OTFMIkGe2LY7MfNTNUku1CWGHarIlZXi9bqaNTOsUhXjnDQAeG7qKvsnS7498MlzknyFJ/Y6L/MTj acAbZB/6I+7WJIU8hvog==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1pt5Es-00E55v-2U; Sun, 30 Apr 2023 11:29:10 +0000 Received: from perseus.uberspace.de ([95.143.172.134]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1pt5Em-00E53m-2d for linux-arm-kernel@lists.infradead.org; Sun, 30 Apr 2023 11:29:08 +0000 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=3E?= =?unknown-8bit?q?=2C_=B1n=C3=A7_=C3=9CNAL__=3Carinc=2Eunal=40arinc9=2Ecom?= =?unknown-8bit?q?=3E=2C_Landen_Chao_=3CLanden=2EChao=40mediatek=2Ecom=3E=2C?= =?unknown-8bit?q?_DENG_Qingfang_=3Cdqfext=40gmail=2Ecom=3E=2C_Sean_Wang_=3C?= =?unknown-8bit?q?sean=2Ewang=40mediatek=2Ecom=3E=2C_Daniel_Golle_=3Cdaniel?= =?unknown-8bit?q?=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= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230430_042906_003308_0FDF30CB X-CRM114-Status: UNSURE ( 9.46 ) 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 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: