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: 131494 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp500708vqr; Sat, 5 Aug 2023 08:03:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgfw+tSRJfHXnFn9wOMA53izeBekKwmDLRm45+iY5eZqJzkFD6mqMpHaqHPHvvhbjnu30R X-Received: by 2002:a05:6a20:8402:b0:13f:5cbc:5dd3 with SMTP id c2-20020a056a20840200b0013f5cbc5dd3mr6192536pzd.1.1691247793017; Sat, 05 Aug 2023 08:03:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691247793; cv=none; d=google.com; s=arc-20160816; b=Eef0qqsh5OLzvRVxUMxeAiwa2B96Nf6BC1JTmHG43EO7Yfw2UmIxtZTPG6lVugmVsO tFyUMiyE9iDXwkQVtc327MtosegP3nTtqxpQ3sqC4/cdw3JHZ+LXSX49iz+6S09yjj7J TYYF0wikLL+a+YNdY+yiw0IZx+RnWW+Ab2S4onDQCZ+Nb5Cx9wySXzIuKcWO9C3eTkHn 0pdnAruRK6LuN7VyUNRs62zGiPPEDxBvOXHeaw/I0tOH0kmB2l8g7RPLUlr5ldHgOmg9 nd8RZL4l4IOZosG3pP9XTvK7kn+3q15bssRYwLkP0D5Cs3ELUbXJgs1KYfl0qLtZVIEl Lbpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=bHamsYMKRaMPhubzkLkNWDwzup6VhOCBFWy/2PzAqo4=; fh=vl2FZ9uzCyg3wCpbehRM5aU64q64jQWw5QyDb8W+lEE=; b=xziSQOL3wcPxqcaNa44LKasSFvNgYreVdWBmsHNWrhQMLVCejxwyOJolNutFE5qopa ZHANotW3z3v6m24sMscKDJV10PXION/ht+ezfFPg8XmG3Q1/5ZQkTbu8xtBZiYtq3L6+ JzNuww4BRGOMVugg1/P7rpWqbZZv2dqJLXuz5EMLupWZLCdbuLBhGW/3fZkfZcS6tZWn 8xqBuDItVYThIYLtdmUFhC0iIOCRoplC6r8L+GWZ0Tsz7ZJI70CB3F/WtdlaGiYpFFdR wHicOf3W7/OQoTjW8JGAdx0kl4OfKQ+oGFTFdxNFPZa7hHydh5LRolpXa4tTl37fMxMS Qq+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h4-20020a056a001a4400b006871e685bc7si3250743pfv.2.2023.08.05.08.02.51; Sat, 05 Aug 2023 08:03:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229798AbjHEOnm (ORCPT + 99 others); Sat, 5 Aug 2023 10:43:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229475AbjHEOnl (ORCPT ); Sat, 5 Aug 2023 10:43:41 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8A4B1FE6; Sat, 5 Aug 2023 07:43:38 -0700 (PDT) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773401845856580863 X-GMAIL-MSGID: 1773401845856580863 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: 131493 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp499713vqr; Sat, 5 Aug 2023 08:01:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHzeSjVesMJ4PfdE/vhIAPvOEpjalYeDNUCF1HGeeY9KxORFWGyJ5oW0nY5kNt/3LftEyMu X-Received: by 2002:a17:90a:43a7:b0:268:1745:b61 with SMTP id r36-20020a17090a43a700b0026817450b61mr3409286pjg.34.1691247703779; Sat, 05 Aug 2023 08:01:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691247703; cv=none; d=google.com; s=arc-20160816; b=dsoZOQir9+uqGCqzIdOYmvjb91+4IclyzaHuLbwpW4bSzsbfEGqEbESSb9gQjVd3ar T+Y06qtqlzQeXI5lbXSrRlEA3yC0tuJqg58uftKGJJkIlP/3OSarZpzcKmLRZUDPWOmz MrMtXVRwsdY2TI1l+T6b5zVVGfsi2Kn7pxT997AUpUs4ADtgrlkgEtMmBJDmLP6jtq+B TIU90U8ufqpZ+ag3UbFnhBpIk9GX90DpFbg1ZQRglahtgmdBCffRmVYc6sCzdfIjrUkg IPW0UfWiP40R34UIOCMbx5BTBgPrOf+lBTzmvoaBNcimIxQ9jtXSDTUe4zNNNaqO6usC neuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date; bh=Cj2PYvRgpQDJtjUVyJ3ygj/RNNSyJDRds+DiUQsZqiA=; fh=vl2FZ9uzCyg3wCpbehRM5aU64q64jQWw5QyDb8W+lEE=; b=bNrFHbBI2AvhTc8vOOFfHyUygil29rnE2M+GdoZkAjm0r1ir9RYItBOURJg3M480UE osgtBo/1/CN8DrZIxQ3Bf4XXZ/uzZQKhj/VfnzNHt67t7oAQW3Qs4es8jyHpF7pIcv1O IwFu31dU63cltFr+GHvt++B1JWI93RSgfwbGul6ccq1W0imIGu8h7nlV78wVGkN+7lka sA9MYF2jc5/s9Me1kGdA5gVI4S9Kw3WTa7h66bHRPIw/ezgKyWlFwv5bcxOYVf6QMdwX z9ozbyi2ojhOVHKp57NySYIhWS7e5teyafvkUzaMiAFWEl9cCqOKgxyLNCHwydktyIVQ iC8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cu13-20020a17090afa8d00b002635333de96si2247827pjb.97.2023.08.05.08.01.28; Sat, 05 Aug 2023 08:01:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbjHEOno (ORCPT + 99 others); Sat, 5 Aug 2023 10:43:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjHEOnl (ORCPT ); Sat, 5 Aug 2023 10:43:41 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27AE94224; Sat, 5 Aug 2023 07:43:39 -0700 (PDT) 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773401752152562253 X-GMAIL-MSGID: 1773401752152562253 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: