From patchwork Sat Sep 16 11:08:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388303 X-Patchwork-Delegate: geert@linux-m68k.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 40AC2CD37BB for ; Sat, 16 Sep 2023 11:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239018AbjIPLK1 (ORCPT ); Sat, 16 Sep 2023 07:10:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239094AbjIPLJ4 (ORCPT ); Sat, 16 Sep 2023 07:09:56 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB70119F; Sat, 16 Sep 2023 04:09:50 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 73E3E240003; Sat, 16 Sep 2023 11:09:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862589; 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=lscCcidsJMMOQkHcl8eCmBbaHAYgbiEltqPqbGnvzb8=; b=VdvydhjubqnTb7zMzlmvDb1AyuPlHiJU1Pmq977kdg2rTcKM8lqKF5FamXN2RD0kuYAIKy N8Ya1bJkDpYePX037ZX6DqzRS0aKK2BR1qZd/1rKahuc1ZE1+DtjF2ml8+DyuBdJko/L41 uVMRjFxnMGH+z0aMGnqqBl5aZtHgnocmV81BBECvLyncbHRVPeGz6eTvI95chAwCXQdidJ S32jFRpQiAwE/WbqdYKdR+VXecLnoA4IslS+9AACuM+g+hehqFq9qshqXUr5pYUhcDGqXJ a4fsb0r7UVYdHD6LyPImW+59xuH2V1lIYn95YPoIeElxjf65EAGYpMe3WTuxug== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: David Bauer , Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 01/10] net: dsa: mt7530: register OF node for internal MDIO bus Date: Sat, 16 Sep 2023 14:08:53 +0300 Message-Id: <20230916110902.234273-2-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.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 Signed-off-by: Arınç ÜNAL --- 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 035a34b50f31..7db9af7b9658 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2156,10 +2156,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; @@ -2178,7 +2181,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 Sep 16 11:08:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388302 X-Patchwork-Delegate: geert@linux-m68k.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 5FE75CD37B7 for ; Sat, 16 Sep 2023 11:10:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239069AbjIPLK2 (ORCPT ); Sat, 16 Sep 2023 07:10:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239240AbjIPLKT (ORCPT ); Sat, 16 Sep 2023 07:10:19 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 72B381B0; Sat, 16 Sep 2023 04:10:10 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id C6EE8240004; Sat, 16 Sep 2023 11:09:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862609; 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=bCVsSCUqr94fHC72W488TJM9Q7uBl3U9XOpO5b6zFkI=; b=HFsOWmhU1AcmLExDDgGw+IVR7jUbH2dKOYbsQSzyL2/Y3HtO7H7t2hWrEwTraBnNLF4Hmd 2wzXQfuG7cx4+RvoIVZhkyP+aeXXfN7BObZ+w6LTHTSTFxSbHSrbKHPzWN5tPE8TM2pjZ2 5B1Hm1Ud+TRTYf16+hrsWr7H2DJn0AUeMfLqf8nGWVsGuak+TQeE12kxIcBCofOtG3lBti fEZjgT02/ye1we3qf17VcgXSc2jHSC9TwLnI0cn4RK4BOmqFNUc7rEX0NyZZs6D3LzKXNa ex0TJsVceQFcxXb2dkoH1PrA/YI1y1xZ8Erzqp1WhvnGaQJCYh4uJ4UdoYU42Q== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Florian Fainelli , Rob Herring , Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 02/10] dt-bindings: net: dsa: microchip,lan937x: add missing ethernet on example Date: Sat, 16 Sep 2023 14:08:54 +0300 Message-Id: <20230916110902.234273-3-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The port@5 node on the example is supposed to be used as a CPU port. Add the missing ethernet property and remove the label property. Remove the MAC bindings on the example as they cannot be validated. Signed-off-by: Arınç ÜNAL Reviewed-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Rob Herring --- .../bindings/net/dsa/microchip,lan937x.yaml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml index 8d7e878b84dc..d187034fb31a 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml @@ -68,16 +68,6 @@ examples: - | #include - macb0 { - #address-cells = <1>; - #size-cells = <0>; - - fixed-link { - speed = <1000>; - full-duplex; - }; - }; - spi { #address-cells = <1>; #size-cells = <0>; @@ -134,10 +124,10 @@ examples: port@5 { reg = <5>; - label = "lan7"; phy-mode = "rgmii"; tx-internal-delay-ps = <2000>; rx-internal-delay-ps = <2000>; + ethernet = <&macb1>; fixed-link { speed = <1000>; From patchwork Sat Sep 16 11:08:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388304 X-Patchwork-Delegate: geert@linux-m68k.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 801C0CD37B7 for ; Sat, 16 Sep 2023 11:11:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234283AbjIPLK7 (ORCPT ); Sat, 16 Sep 2023 07:10:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239051AbjIPLKf (ORCPT ); Sat, 16 Sep 2023 07:10:35 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8148E19A; Sat, 16 Sep 2023 04:10:29 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 91CB3240003; Sat, 16 Sep 2023 11:10:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862628; 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=BgK1RR7PvoKyZDk0Jc59OCF7MxiLvtGydv7ioUqbT0Y=; b=jfHvHtuc+xqfSbVdGtke/CXe36aT3ln5BhveQlDrHTC4bUBcwnisulq7Nq5WitSm3y/Zro v8JuJhLWLr+P6UfJQfQBfkcldkNix/BAG7b5INH2Zo461XHQKOBuaLe6MPW8EfCvMimDe6 esnrB0UDXQ23P3rmQZgIXkzecBbPtSgH+S/RokQbhJMm0/w4dI3Mqws6oIHcRuVm6z64UW kV1yltovhTPM93EnMDIBCf7n7vc0phIBwojsrPUnl76AEqrFIKhc1bte9p5fs+MkZjpUVY Lk084pAvydhldmDOQkS9YGPo7O/vNcPTmYi5hOvW9iFD/bqArjKLiqclwu8EJg== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 03/10] dt-bindings: net: dsa: realtek: fix MDIO bus child node restrictions Date: Sat, 16 Sep 2023 14:08:55 +0300 Message-Id: <20230916110902.234273-4-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The MDIO controlled Realtek switches (distinguished by the reg property being used) are allowed to have their MDIO bus registered OF-based. Allow the mdio property for them. Only the SMI controlled Realtek switches require the compatible property of the mdio child node. Require it for them and disallow it for the MDIO controlled ones. Remove the unnecessary if:then:not:required rule and comments. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/dsa/realtek.yaml | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index cfd69c2604ea..7eb025df0df8 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -109,18 +109,19 @@ if: then: $ref: /schemas/spi/spi-peripheral-props.yaml# - not: - required: - - mdc-gpios - - mdio-gpios - - mdio - properties: mdc-gpios: false mdio-gpios: false - mdio: false + mdio: + properties: + compatible: false else: + properties: + mdio: + required: + - compatible + required: - mdc-gpios - mdio-gpios @@ -130,11 +131,6 @@ else: required: - compatible - # - mdc-gpios - # - mdio-gpios - # - reset-gpios - # - mdio - unevaluatedProperties: false examples: From patchwork Sat Sep 16 11:08:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388305 X-Patchwork-Delegate: geert@linux-m68k.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 881E9CD37B7 for ; Sat, 16 Sep 2023 11:11:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbjIPLLb (ORCPT ); Sat, 16 Sep 2023 07:11:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239086AbjIPLLE (ORCPT ); Sat, 16 Sep 2023 07:11:04 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A6581AA; Sat, 16 Sep 2023 04:10:57 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A131B240005; Sat, 16 Sep 2023 11:10:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862655; 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=4p0NlFBH4xgH4kzo+ZWXDnGHN/kVaqsbVlpwtx8tToU=; b=GE4iVrg/VE60T4umjJ4+5PcY1uIjtRw3gTxSOWhjhMl1LwG2XNoSjEFnOZ0dZOadfELSFU pOfLfwbcAltSQTZaKj/bT32T4K4uc/NY2+crFKO7ljS9at1cQKOmC5F1Bb6IFA/P3kEMY0 BgK/+953ow3X4WlpMSs4ZvNx/64Q6nPf3zfLGyEffzzkgUxlZ4/GI27HNd8U88/1PGNiM2 OFLtIXplJbGO72zyIhGV7N5r61QYKwIcVmZwppFqtgp4obfTpB5BnHlSB5jq4Q+nPWYVQm 44ZADQdPQEC1SMG+DcZ9V/9ZgjksBqHUUa3TmdTAxTBP0pey/1KlshitGGnVeg== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 04/10] dt-bindings: net: dsa: nxp,sja1105: improve MDIO bus bindings Date: Sat, 16 Sep 2023 14:08:56 +0300 Message-Id: <20230916110902.234273-5-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The SJA1110 switch uses the mdios property for its two MDIO buses. Instead of a pattern, define two mdio nodes. This ensures the same compatible string won't be used twice. The address and size cell definitions can also be removed now that the reg property has become unnecessary. Move the comment to the description of mdios, mdio0, and mdio1 properties. Disallow the mdios property for SJA1105. Require at least one of the MDIO buses to be defined to prevent empty mdios child node. Signed-off-by: Arınç ÜNAL --- .../bindings/net/dsa/nxp,sja1105.yaml | 49 ++++++++++--------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index 4d5f5cc6d031..3f3c4ecc6442 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -35,42 +35,44 @@ properties: spi-cpha: true spi-cpol: true - # Optional container node for the 2 internal MDIO buses of the SJA1110 - # (one for the internal 100base-T1 PHYs and the other for the single - # 100base-TX PHY). The "reg" property does not have physical significance. - # The PHY addresses to port correspondence is as follows: for 100base-T1, - # port 5 has PHY 1, port 6 has PHY 2 etc, while for 100base-TX, port 1 has - # PHY 1. mdios: + description: + The optional container node for the two MDIO buses of the SJA1110. type: object properties: - '#address-cells': - const: 1 - '#size-cells': - const: 0 - - patternProperties: - "^mdio@[0-1]$": + mdio0: + description: + The node for the bus controlling the 100base-T1 PHYs of the SJA1110 + switch. PHY address to port correspondence is port 5 has PHY 1, port 6 + has PHY 2, etc. $ref: /schemas/net/mdio.yaml# unevaluatedProperties: false properties: compatible: - oneOf: - - enum: - - nxp,sja1110-base-t1-mdio - - nxp,sja1110-base-tx-mdio + const: nxp,sja1110-base-t1-mdio + + required: + - compatible - reg: - oneOf: - - enum: - - 0 - - 1 + mdio1: + description: + The node for the bus controlling the 100base-TX PHY of the SJA1110 + switch. PHY address to port correspondence is port 1 has PHY 1. + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + + properties: + compatible: + const: nxp,sja1110-base-tx-mdio required: - compatible - - reg + + anyOf: + - required: [ mdio0 ] + - required: [ mdio1 ] patternProperties: "^(ethernet-)?ports$": @@ -124,6 +126,7 @@ allOf: then: properties: spi-cpol: false + mdios: false required: - spi-cpha else: From patchwork Sat Sep 16 11:08:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388306 X-Patchwork-Delegate: geert@linux-m68k.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 7CE5DCD37B7 for ; Sat, 16 Sep 2023 11:12:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239124AbjIPLME (ORCPT ); Sat, 16 Sep 2023 07:12:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239288AbjIPLL7 (ORCPT ); Sat, 16 Sep 2023 07:11:59 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE547CCE; Sat, 16 Sep 2023 04:11:44 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id D5488240009; Sat, 16 Sep 2023 11:10:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862703; 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=suIxn/V1rRA2+i2OMNh+42WJYyF57dcYWh8ZSEA+/F0=; b=oKtg3XpodpdjUhzQjpCkBzarcFQRj4F4QCwlzZkIFFJYwvaiP7MqRY/Sz4zz9B70NMzFn8 RWs6pOLSgl6y6+ku3TAWE29sxTh/XYiFQIl6IvylUInZ/d/8k+RTFGs8z7i4rekGW7ff5L BtFgzeTZMu1CCHbhqCvJtZ053PhAjpNBi9ItemSAzcnz8XEN0U0MJKqrFtTO427SR7TaYp OIgWRbg15SRbhLtwp9KDq/MbOxyVP8Mt1q18cBW95upVAW9bnmjuhY4V8IO7DdeB1bcQXy Zcn0Jkg1yI0jVxLcFacG+KC19Kfo5rTeg7OUR5edfx0DOZ6/IgXAJ+OCygMlMg== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 05/10] dt-bindings: net: dsa: define MDIO bus child node Date: Sat, 16 Sep 2023 14:08:57 +0300 Message-Id: <20230916110902.234273-6-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Some DSA subdrivers register the MDIO bus of the switch they control. Or let the DSA driver register the MDIO bus. The node for these buses are either required or optional, depending on the subdriver. Document this on all of the affected DSA switch schemas. The attributes of a DSA subdriver that lets the DSA driver register the bus: - ds->ops->phy_read() and ds->ops->phy_write() are present. - ds->slave_mii_bus is not populated by the DSA subdriver. - The bus is registered non-OF-based or OF-based. Registered OF-based if "mdio" child node is defined. The affected DSA switch schemas are documented below. - brcm,b53.yaml drivers/net/dsa/b53/b53_common.c: - The DSA subdriver lets the DSA driver register the bus. --- - mediatek,mt7530.yaml drivers/net/dsa/mt7530.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio" child node is defined. --- - microchip,ksz.yaml - microchip,lan937x.yaml drivers/net/dsa/microchip/ksz_common.c: - The DSA subdriver won't let the DSA driver register the bus when "mdio" child node is defined. Registers the bus OF-based only. Registers the bus when "mdio" child node is defined. - mdio_np = of_get_child_by_name(dev->dev->of_node, "mdio"); if (!mdio_np) return 0; ds->slave_mii_bus = bus; --- - nxp,sja1105.yaml drivers/net/dsa/sja1105/sja1105_mdio.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers multiple buses OF-based only. Registers the buses when "mdios" child node and "nxp,sja1110-base-tx-mdio" and "nxp,sja1110-base-t1-mdio" compatible strings per child node under "mdios" is defined. - mdio_node = of_get_child_by_name(switch_node, "mdios"); if (!mdio_node) return 0; - np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-tx-mdio"); if (!np) return 0; - np = of_get_compatible_child(mdio_node, "nxp,sja1110-base-t1-mdio"); if (!np) return 0; --- - qca8k.yaml drivers/net/dsa/qca/qca8k-8xxx.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio" child node is defined. - mdio = of_get_child_by_name(priv->dev->of_node, "mdio"); --- - realtek.yaml drivers/net/dsa/realtek/realtek-smi.c: - The DSA subdriver won't let the DSA driver register the bus. Registers the bus OF-based only. Registering the bus is mandatory. Registers the bus when compatible string "realtek,smi-mdio" on a child node is defined. - mdio_np = of_get_compatible_child(priv->dev->of_node, "realtek,smi-mdio"); if (!mdio_np) return -ENODEV; ds->slave_mii_bus = priv->slave_mii_bus; drivers/net/dsa/realtek/realtek-mdio.c: - The DSA subdriver lets the DSA driver register the bus. --- - renesas,rzn1-a5psw.yaml drivers/net/dsa/rzn1_a5psw.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers the bus OF-based only. Registers the bus when "mdio" child node is defined. - mdio = of_get_child_by_name(dev->of_node, "mdio"); if (of_device_is_available(mdio)) ret = a5psw_probe_mdio(a5psw, mdio); --- - ar9331.txt drivers/net/dsa/qca/ar9331.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers the bus OF-based only. Registering the bus is mandatory. Registers the bus when "mdio" child node is defined. - mnp = of_get_child_by_name(np, "mdio"); if (!mnp) return -ENODEV; --- - lan9303.txt drivers/net/dsa/lan9303-core.c: - The DSA subdriver lets the DSA driver register the bus. --- - lantiq-gswip.txt drivers/net/dsa/lantiq_gswip.c: - The DSA subdriver won't let the DSA driver register the bus. - No ds->ops->phy_read() or ds->ops->phy_write(). - Registers the bus OF-based only. Registers the bus when compatible string "lantiq,xrx200-mdio" on a child node is defined. - mdio_np = of_get_compatible_child(dev->of_node, "lantiq,xrx200-mdio"); if (mdio_np) err = gswip_mdio(priv, mdio_np); --- - marvell.txt drivers/net/dsa/mv88e6xxx/chip.c: - The DSA subdriver won't let the DSA driver register the bus. - ds->slave_mii_bus = mv88e6xxx_default_mdio_bus(chip); - Registers the bus non-OF-based or OF-based. Registers OF-based if "mdio" child node is defined. --- - vitesse,vsc73xx.txt drivers/net/dsa/vitesse-vsc73xx-core.c: - The DSA subdriver lets the DSA driver register the bus. I will convert the non json-schema documents accordingly. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/dsa/brcm,b53.yaml | 7 +++++++ .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 7 +++++++ .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 7 +++++++ .../devicetree/bindings/net/dsa/microchip,lan937x.yaml | 3 +++ .../devicetree/bindings/net/dsa/nxp,sja1105.yaml | 3 ++- Documentation/devicetree/bindings/net/dsa/qca8k.yaml | 10 +++++----- Documentation/devicetree/bindings/net/dsa/realtek.yaml | 4 ++++ .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 3 +++ 8 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml index 4c78c546343f..0bb2ff0cf2d0 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml @@ -65,6 +65,13 @@ properties: - brcm,bcm63268-switch - const: brcm,bcm63xx-switch + mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index e532c6b795f4..31a7dbbf704d 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -151,6 +151,13 @@ properties: ethsys. maxItems: 1 + mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + patternProperties: "^(ethernet-)?ports$": type: object diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index e51be1ac0362..20e4174fe1ab 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -49,6 +49,13 @@ properties: Set if the output SYNCLKO clock should be disabled. Do not mix with microchip,synclko-125. + mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. + $ref: /schemas/net/mdio.yaml# + unevaluatedProperties: false + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml index d187034fb31a..33a4926b2d94 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml @@ -32,6 +32,9 @@ properties: maxItems: 1 mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. $ref: /schemas/net/mdio.yaml# unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index 3f3c4ecc6442..6838dc165d06 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -37,7 +37,8 @@ properties: mdios: description: - The optional container node for the two MDIO buses of the SJA1110. + The optional container node for the two MDIO buses of the SJA1110. The bus + won't be registered if its node is not defined. type: object properties: diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml index df64eebebe18..c472050582be 100644 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml @@ -60,13 +60,13 @@ properties: B68 on the QCA832x and B49 on the QCA833x. mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. In that case, the legacy + mapping will be used. With the legacy mapping, the reg corresponding to + the MDIO bus is the switch reg with an offset of -1. $ref: /schemas/net/mdio.yaml# unevaluatedProperties: false - description: Qca8k switch have an internal mdio to access switch port. - If this is not present, the legacy mapping is used and the - internal mdio access is used. - With the legacy mapping the reg corresponding to the internal - mdio is the switch reg with an offset of -1. $ref: dsa.yaml# diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 7eb025df0df8..62ebaa4b5ae3 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -96,6 +96,10 @@ properties: - '#interrupt-cells' mdio: + description: + The node for the MDIO bus of the switch. For the MDIO controlled switches, + this is optional and the bus will be registered non-OF-based if this is + not defined. $ref: /schemas/net/mdio.yaml# unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml index 833d2f68daa1..9ad9f5cdf688 100644 --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml @@ -46,6 +46,9 @@ properties: maxItems: 1 mdio: + description: + The optional node for the MDIO bus of the switch. The bus won't be + registered if this is not defined. $ref: /schemas/net/mdio.yaml# unevaluatedProperties: false From patchwork Sat Sep 16 11:08:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388326 X-Patchwork-Delegate: geert@linux-m68k.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 4F7F8CD37BB for ; Sat, 16 Sep 2023 11:14:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbjIPLNj (ORCPT ); Sat, 16 Sep 2023 07:13:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35418 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231482AbjIPLNI (ORCPT ); Sat, 16 Sep 2023 07:13:08 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9F36E62; Sat, 16 Sep 2023 04:12:41 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 86FEF240002; Sat, 16 Sep 2023 11:11:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862760; 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=sxK8lRKWIBb9Z0O3Tvb06WKXqFsJaGZqBLWHiNoJa3o=; b=DjJ2fCg+wOKIS1DRGr73CWt8njm6u2HR4WWyOJN4HutNBHu3/1RBIe+MHn7PjSeGIMw80C yP9rtDIfZKpD82VrW1U/XKKELh1kDRKoMHwxMdgEyyPzKJShHGQ9cxqafjEDOkmlfw23WY pCa2BdbZUMV8QP1VaCiRb5Q061T7COsXPzdtfNE1S5pDdfbWus9ads9qANlQwgR/Zn3dGN 5v4N9sqpqn8MM/3dA//0l6TKN38AtKhhOtmLqUkNaLVB/eO2NomBYxZsESH18gCfMzu5i7 cYOy2zBTTP4eNXco6g9d1Werqui7D+26dueceOzN3KMSzZIGPNE0/N81TmDHXA== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 06/10] dt-bindings: net: define phylink bindings Date: Sat, 16 Sep 2023 14:08:58 +0300 Message-Id: <20230916110902.234273-7-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Define the phylink bindings on ethernet-controller.yaml and replace the bindings on the dsa-port.yaml schema with them. The shared ports of DSA requires phy-mode so keep that. Important remarks about the phylink bindings: - fsl,fman-dtsec uses tbi-handle instead of pcs-handle, therefore tbi-handle is included. - For sfp, only managed with the in-band-status value must be required, but phy-handle is required as another option because of a special case on the eth2 node on arch/arm/boot/dts/marvell/armada-385-turris-omnia.dts. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/dsa/dsa-port.yaml | 12 ++------ .../bindings/net/ethernet-controller.yaml | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml index 480120469953..53efb686cfc7 100644 --- a/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml +++ b/Documentation/devicetree/bindings/net/dsa/dsa-port.yaml @@ -65,16 +65,8 @@ if: - required: [ ethernet ] - required: [ link ] then: - allOf: - - required: - - phy-mode - - oneOf: - - required: - - fixed-link - - required: - - phy-handle - - required: - - managed + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + required: [ phy-mode ] additionalProperties: true diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml index 9f6a5ccbcefe..ef28ebc76798 100644 --- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml @@ -284,6 +284,35 @@ allOf: controllers that have configurable TX internal delays. If this property is present then the MAC applies the TX delay. +$defs: + phylink: + description: phylink bindings for ethernet controllers + allOf: + - anyOf: + - required: [ fixed-link ] + - required: [ pcs-handle ] + - required: [ tbi-handle ] + - required: [ phy-handle ] + - required: [ sfp ] + - required: [ managed ] + + - if: + required: [ fixed-link ] + then: + properties: + managed: + const: auto + + - if: + required: [ sfp ] + then: + oneOf: + - required: [ phy-handle ] + - required: [ managed ] + properties: + managed: + const: in-band-status + additionalProperties: true ... From patchwork Sat Sep 16 11:08:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388328 X-Patchwork-Delegate: geert@linux-m68k.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 25492CD37BB for ; Sat, 16 Sep 2023 11:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239270AbjIPLOL (ORCPT ); Sat, 16 Sep 2023 07:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234283AbjIPLNk (ORCPT ); Sat, 16 Sep 2023 07:13:40 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 45320E4E; Sat, 16 Sep 2023 04:13:08 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 51BF6240003; Sat, 16 Sep 2023 11:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862786; 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=xhIrExaH+Pxga2qgOi/puibscZ/eAZoI/ny/hgH81io=; b=jQd0Gg737dggiZcbuwSo9+ScBsaoWp0hSmSQV+Uw4DHZL9+nAfv+His6tE/s4jcaPECdfS 3PGuHtcD6ZBST3GP+GcXpao4T+19AD3mR7a0iFPctDerOEbID43OqogHDjknexA5ZJOMTR 3jQreJPImNKLVLB66K/k1GeC6ELcVz0NXoe6iqaEVmyCFzqMiKcrxkYwbQTNGoIiWJ8S2i yKMaMRd2GDcKecgNAeNhq+uSnl0ewa5HnqlZUOUerSkE/fUtuZtuSqfhDSNnZLYA1l01DN p3PY5iRyOgyQh/9bP1g7+HlEF4DT8I/684zeGZ1QKOS/0rQtEvPXZazEW85C9w== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 07/10] dt-bindings: net: enforce phylink bindings on certain ethernet controllers Date: Sat, 16 Sep 2023 14:08:59 +0300 Message-Id: <20230916110902.234273-8-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Phylink bindings are required for ethernet controllers that utilise phylink_fwnode_phy_connect() directly or through phylink_of_phy_connect(), and register OF-based only MDIO buses, if they register any. All the drivers that utilise phylink_fwnode_phy_connect() directly or through phylink_of_phy_connect(): - DSA - drivers/net/ethernet/mscc/ocelot_net.c - mscc,vsc7514-switch.yaml - drivers/net/ethernet/microchip/sparx5/sparx5_netdev.c - microchip,sparx5-switch.yaml - drivers/net/ethernet/altera/altera_tse_main.c - altr,tse.yaml - drivers/net/ethernet/xilinx/xilinx_axienet_main.c - xlnx,axi-ethernet.yaml - drivers/net/ethernet/mediatek/mtk_eth_soc.c - mediatek,net.yaml - drivers/net/ethernet/ti/am65-cpsw-nuss.c - ti,k3-am654-cpsw-nuss.yaml - drivers/net/ethernet/atheros/ag71xx.c - qca,ar71xx.yaml - drivers/net/ethernet/freescale/dpaa/dpaa_eth.c - fsl,fman-dtsec.yaml - drivers/net/ethernet/microchip/lan966x/lan966x_main.c - microchip,lan966x-switch.yaml - drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c - marvell,pp2.yaml - drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c - fsl,qoriq-mc-dpmac.yaml - drivers/net/ethernet/cadence/macb_main.c - cdns,macb.yaml - Can register non-OF-based bus. - drivers/net/ethernet/stmicro/stmmac/stmmac_main.c - snps,dwmac.yaml - Can register non-OF-based bus. - drivers/net/ethernet/marvell/mvneta.c - marvell-armada-370-neta.txt - drivers/net/ethernet/freescale/enetc/enetc.c - fsl-enetc.txt RFC: The drivers marked with "can register non-OF-based bus" seem to search the MDIO bus to connect the PHY to the MAC using phylink_connect_phy() and/or phy_find_first() if phylink bindings don't exist. Should we enforce phylink bindings on their schemas regardless? DSA, like any other driver utilising the Linux MDIO infrastructure, can register a bus. On certain conditions, it registers the MDIO bus of the switch it controls non-OF-based. We can know when DSA won't create any non-OF-based buses. That leaves us with only OF-based buses in which case we can enforce phylink bindings for user ports. The bindings are already enforced for shared ports so we can enforce the bindings for all ports on the switch schemas which will achieve the same result with fewer lines. By looking at whether the mdio child node exists and what is explained on it, we can enforce phylink bindings. - mscc,vsc7514-switch.yaml - Enforce phylink bindings for all ports. - arrow,xrs700x.yaml - Enforce phylink bindings for all ports. - brcm,b53.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - brcm,sf2.yaml - Enforce phylink bindings for all ports. - hirschmann,hellcreek.yaml - Enforce phylink bindings for all ports. - mediatek,mt7530.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - microchip,ksz.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - microchip,lan937x.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - mscc,ocelot.yaml - Enforce phylink bindings for all ports. - nxp,sja1105.yaml - Enforce phylink bindings for all ports. - qca8k.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - realtek.yaml - Enforce phylink bindings for all ports if "mdio" is defined. - renesas,rzn1-a5psw.yaml - Enforce phylink bindings for all ports. - ar9331.txt - Enforce phylink bindings for all ports. - lan9303.txt - Enforce phylink bindings for all ports if "mdio" is defined. - lantiq-gswip.txt - Enforce phylink bindings for all ports. - marvell.txt - Enforce phylink bindings for all ports if "mdio" is defined. - vitesse,vsc73xx.txt - Enforce phylink bindings for all ports if "mdio" is defined. I will convert the non json-schema documents accordingly. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/altr,tse.yaml | 1 + .../devicetree/bindings/net/cdns,macb.yaml | 1 + .../bindings/net/dsa/arrow,xrs700x.yaml | 6 ++ .../devicetree/bindings/net/dsa/brcm,b53.yaml | 9 +++ .../devicetree/bindings/net/dsa/brcm,sf2.yaml | 6 +- .../net/dsa/hirschmann,hellcreek.yaml | 6 ++ .../bindings/net/dsa/mediatek,mt7530.yaml | 9 +++ .../bindings/net/dsa/microchip,ksz.yaml | 9 +++ .../bindings/net/dsa/microchip,lan937x.yaml | 9 +++ .../bindings/net/dsa/mscc,ocelot.yaml | 6 ++ .../bindings/net/dsa/nxp,sja1105.yaml | 1 + .../devicetree/bindings/net/dsa/qca8k.yaml | 9 +++ .../devicetree/bindings/net/dsa/realtek.yaml | 57 +++++++++++-------- .../bindings/net/dsa/renesas,rzn1-a5psw.yaml | 2 +- .../bindings/net/fsl,fman-dtsec.yaml | 1 + .../bindings/net/fsl,qoriq-mc-dpmac.yaml | 1 + .../devicetree/bindings/net/marvell,pp2.yaml | 4 +- .../devicetree/bindings/net/mediatek,net.yaml | 1 + .../net/microchip,lan966x-switch.yaml | 4 +- .../bindings/net/microchip,sparx5-switch.yaml | 5 +- .../bindings/net/mscc,vsc7514-switch.yaml | 5 ++ .../devicetree/bindings/net/qca,ar71xx.yaml | 1 + .../devicetree/bindings/net/snps,dwmac.yaml | 1 + .../bindings/net/ti,k3-am654-cpsw-nuss.yaml | 4 +- .../bindings/net/xlnx,axi-ethernet.yaml | 3 +- 25 files changed, 130 insertions(+), 31 deletions(-) diff --git a/Documentation/devicetree/bindings/net/altr,tse.yaml b/Documentation/devicetree/bindings/net/altr,tse.yaml index f5d3b70af07a..24e0f1213109 100644 --- a/Documentation/devicetree/bindings/net/altr,tse.yaml +++ b/Documentation/devicetree/bindings/net/altr,tse.yaml @@ -67,6 +67,7 @@ required: allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/cdns,macb.yaml b/Documentation/devicetree/bindings/net/cdns,macb.yaml index bf8894a0257e..a455de04c5f1 100644 --- a/Documentation/devicetree/bindings/net/cdns,macb.yaml +++ b/Documentation/devicetree/bindings/net/cdns,macb.yaml @@ -156,6 +156,7 @@ required: allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink - if: not: diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml index 9565a7402146..7829fc9e202d 100644 --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml @@ -29,6 +29,12 @@ properties: reg: maxItems: 1 +patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml index 0bb2ff0cf2d0..ed5b3eab1948 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml @@ -142,6 +142,15 @@ allOf: reg: maxItems: 1 + - if: + required: [ mdio ] + then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + unevaluatedProperties: false examples: diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml index c745407f2f68..6cffcd35a943 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,sf2.yaml @@ -81,7 +81,10 @@ properties: patternProperties: '^port@[0-9a-f]$': - $ref: dsa-port.yaml# + type: object + allOf: + - $ref: dsa-port.yaml# + - $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false properties: @@ -161,6 +164,7 @@ examples: port@0 { label = "gphy"; reg = <0>; + phy-handle = <&phy8>; }; }; }; diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml index 4021b054f684..30b4c7b1fd08 100644 --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml @@ -67,6 +67,12 @@ properties: additionalProperties: false +patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 31a7dbbf704d..a8e1134707e4 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -297,6 +297,15 @@ allOf: mediatek,mcm: false reset-names: false + - if: + required: [ mdio ] + then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + unevaluatedProperties: false examples: diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index 20e4174fe1ab..d8f12234eec6 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -60,6 +60,15 @@ required: - compatible - reg +if: + required: [ mdio ] +then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + unevaluatedProperties: false examples: diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml index 33a4926b2d94..44a892b93eca 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml @@ -65,6 +65,15 @@ required: - compatible - reg +if: + required: [ mdio ] +then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + unevaluatedProperties: false examples: diff --git a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml index fe02d05196e4..80cc9c49282b 100644 --- a/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mscc,ocelot.yaml @@ -73,6 +73,12 @@ properties: little-endian: true big-endian: true +patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml index 6838dc165d06..1d5c4a81caf6 100644 --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml @@ -79,6 +79,7 @@ patternProperties: "^(ethernet-)?ports$": patternProperties: "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink allOf: - if: properties: diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml index c472050582be..546939ab2053 100644 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml @@ -114,6 +114,15 @@ required: - compatible - reg +if: + required: [ mdio ] +then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-6]$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + unevaluatedProperties: false examples: diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 62ebaa4b5ae3..ec0428b74157 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -6,8 +6,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# title: Realtek switches for unmanaged switches -allOf: - - $ref: dsa.yaml#/$defs/ethernet-ports +$ref: dsa.yaml#/$defs/ethernet-ports maintainers: - Linus Walleij @@ -107,33 +106,43 @@ properties: compatible: const: realtek,smi-mdio -if: - required: - - reg +allOf: + - if: + required: + - reg -then: - $ref: /schemas/spi/spi-peripheral-props.yaml# - properties: - mdc-gpios: false - mdio-gpios: false - mdio: + then: + $ref: /schemas/spi/spi-peripheral-props.yaml# properties: - compatible: false + mdc-gpios: false + mdio-gpios: false + mdio: + properties: + compatible: false -else: - properties: - mdio: - required: - - compatible + else: + properties: + mdio: + required: + - compatible - required: - - mdc-gpios - - mdio-gpios - - mdio - - reset-gpios + required: + - mdc-gpios + - mdio-gpios + - mdio + - reset-gpios -required: - - compatible + required: + - compatible + + - if: + required: [ mdio ] + then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml index 9ad9f5cdf688..7ec4371932ef 100644 --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml @@ -72,7 +72,7 @@ properties: patternProperties: "^(ethernet-)?port@[0-4]$": - type: object + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink description: Ethernet switch ports properties: diff --git a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml index c80c880a9dab..c31db5f7d548 100644 --- a/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml +++ b/Documentation/devicetree/bindings/net/fsl,fman-dtsec.yaml @@ -136,6 +136,7 @@ dependencies: allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml index a1b71b35319e..b2cab0fa7b35 100644 --- a/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml +++ b/Documentation/devicetree/bindings/net/fsl,qoriq-mc-dpmac.yaml @@ -15,6 +15,7 @@ description: allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink properties: compatible: diff --git a/Documentation/devicetree/bindings/net/marvell,pp2.yaml b/Documentation/devicetree/bindings/net/marvell,pp2.yaml index 4eadafc43d4f..8e60cc4bbbc9 100644 --- a/Documentation/devicetree/bindings/net/marvell,pp2.yaml +++ b/Documentation/devicetree/bindings/net/marvell,pp2.yaml @@ -59,7 +59,9 @@ patternProperties: '^(ethernet-)?port@[0-2]$': type: object description: subnode for each ethernet port. - $ref: ethernet-controller.yaml# + allOf: + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false properties: diff --git a/Documentation/devicetree/bindings/net/mediatek,net.yaml b/Documentation/devicetree/bindings/net/mediatek,net.yaml index e74502a0afe8..7562bb64baa9 100644 --- a/Documentation/devicetree/bindings/net/mediatek,net.yaml +++ b/Documentation/devicetree/bindings/net/mediatek,net.yaml @@ -391,6 +391,7 @@ patternProperties: unevaluatedProperties: false allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink description: Ethernet MAC node properties: diff --git a/Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml b/Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml index 306ef9ecf2b9..a770cfc490a9 100644 --- a/Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml +++ b/Documentation/devicetree/bindings/net/microchip,lan966x-switch.yaml @@ -73,7 +73,9 @@ properties: "^port@[0-9a-f]+$": type: object - $ref: /schemas/net/ethernet-controller.yaml# + allOf: + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false properties: diff --git a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml index fcafef8d5a33..da4b4d934705 100644 --- a/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml +++ b/Documentation/devicetree/bindings/net/microchip,sparx5-switch.yaml @@ -84,7 +84,10 @@ properties: patternProperties: "^port@[0-9a-f]+$": - $ref: /schemas/net/ethernet-controller.yaml# + type: object + allOf: + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false properties: diff --git a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml index 8ee2c7d7ff42..b3aff7b0790e 100644 --- a/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml +++ b/Documentation/devicetree/bindings/net/mscc,vsc7514-switch.yaml @@ -126,6 +126,11 @@ properties: - const: xtr - const: fdma + ethernet-ports: + patternProperties: + "^port@[0-9a-f]+$": + $ref: ethernet-controller.yaml#/$defs/phylink + required: - compatible - reg diff --git a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml index 89f94b31b546..d021bfb4ad20 100644 --- a/Documentation/devicetree/bindings/net/qca,ar71xx.yaml +++ b/Documentation/devicetree/bindings/net/qca,ar71xx.yaml @@ -8,6 +8,7 @@ title: QCA AR71XX MAC allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink maintainers: - Oleksij Rempel diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml index ddf9522a5dc2..62d8c2cfafe9 100644 --- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml +++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml @@ -567,6 +567,7 @@ dependencies: allOf: - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink - if: properties: compatible: diff --git a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml index c9c25132d154..d4366a11918e 100644 --- a/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml +++ b/Documentation/devicetree/bindings/net/ti,k3-am654-cpsw-nuss.yaml @@ -117,7 +117,9 @@ properties: type: object description: CPSWxG NUSS external ports - $ref: ethernet-controller.yaml# + allOf: + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink unevaluatedProperties: false properties: diff --git a/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml b/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml index 1d33d80af11c..f8894546c02a 100644 --- a/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml +++ b/Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml @@ -130,7 +130,8 @@ required: - phy-handle allOf: - - $ref: /schemas/net/ethernet-controller.yaml# + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink additionalProperties: false From patchwork Sat Sep 16 11:09:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388327 X-Patchwork-Delegate: geert@linux-m68k.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 580C4CD37B7 for ; Sat, 16 Sep 2023 11:14:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239086AbjIPLOM (ORCPT ); Sat, 16 Sep 2023 07:14:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37642 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239251AbjIPLOE (ORCPT ); Sat, 16 Sep 2023 07:14:04 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E419CC4; Sat, 16 Sep 2023 04:13:27 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 5D9AD240002; Sat, 16 Sep 2023 11:13:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862806; 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=h68im17ZsTltgdDllQ9qqFghqW30sH1nXTjgiWPgu0s=; b=IeqUdIOdP7dL0pkj13xi7r0fav2LpFGMHvYeKgZRvrtBvaacK1H7M4o7C8dKW6qwvCP0YZ ZvUacH0ocJcOymCzkAmr9aekHHCHGGmd4p4uaSs/kRMhWWwiBaW5pA292yIgOp61DqDO0t TyKuwDpFxoxEmqsiNOUT0mzbXXdGnNnQ9VW/Y9QVRvb3ecfazZ0cGB5PYhamopOr3kG1zw fJGHsVySyaMn1mDhrl1x8ltUOzpBqM7QHk7n0cf5xjGap074q3tAaOF8R/KkKZCQipePUL SreJ1h+gAhCmCsIeDBeoa9qs58h/0LJqTIw8AWk7TrrMOuK2a74MUrsa46yJ3A== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 08/10] dt-bindings: net: dsa: marvell: convert to json-schema Date: Sat, 16 Sep 2023 14:09:00 +0300 Message-Id: <20230916110902.234273-9-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Convert the document for Marvell ethernet switches to json-schema. Signed-off-by: Arınç ÜNAL --- .../devicetree/bindings/net/dsa/marvell.txt | 109 ---------- .../devicetree/bindings/net/dsa/marvell.yaml | 204 ++++++++++++++++++ 2 files changed, 204 insertions(+), 109 deletions(-) delete mode 100644 Documentation/devicetree/bindings/net/dsa/marvell.txt create mode 100644 Documentation/devicetree/bindings/net/dsa/marvell.yaml diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.txt b/Documentation/devicetree/bindings/net/dsa/marvell.txt deleted file mode 100644 index 6ec0c181b6db..000000000000 --- a/Documentation/devicetree/bindings/net/dsa/marvell.txt +++ /dev/null @@ -1,109 +0,0 @@ -Marvell DSA Switch Device Tree Bindings ---------------------------------------- - -WARNING: This binding is currently unstable. Do not program it into a -FLASH never to be changed again. Once this binding is stable, this -warning will be removed. - -If you need a stable binding, use the old dsa.txt binding. - -Marvell Switches are MDIO devices. The following properties should be -placed as a child node of an mdio device. - -The properties described here are those specific to Marvell devices. -Additional required and optional properties can be found in dsa.txt. - -The compatibility string is used only to find an identification register, -which is at a different MDIO base address in different switch families. -- "marvell,mv88e6085" : Switch has base address 0x10. Use with models: - 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, - 6171, 6172, 6175, 6176, 6185, 6240, 6320, 6321, - 6341, 6350, 6351, 6352 -- "marvell,mv88e6190" : Switch has base address 0x00. Use with models: - 6190, 6190X, 6191, 6290, 6361, 6390, 6390X -- "marvell,mv88e6250" : Switch has base address 0x08 or 0x18. Use with model: - 6220, 6250 - -Required properties: -- compatible : Should be one of "marvell,mv88e6085", - "marvell,mv88e6190" or "marvell,mv88e6250" as - indicated above -- reg : Address on the MII bus for the switch. - -Optional properties: - -- reset-gpios : Should be a gpio specifier for a reset line -- interrupts : Interrupt from the switch -- interrupt-controller : Indicates the switch is itself an interrupt - controller. This is used for the PHY interrupts. -#interrupt-cells = <2> : Controller uses two cells, number and flag -- eeprom-length : Set to the length of an EEPROM connected to the - switch. Must be set if the switch can not detect - the presence and/or size of a connected EEPROM, - otherwise optional. -- mdio : Container of PHY and devices on the switches MDIO - bus. -- mdio? : Container of PHYs and devices on the external MDIO - bus. The node must contains a compatible string of - "marvell,mv88e6xxx-mdio-external" - -Example: - - mdio { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&gpio0>; - interrupts = <27 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - #interrupt-cells = <2>; - - switch0: switch@0 { - compatible = "marvell,mv88e6085"; - reg = <0>; - reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - switch1phy0: switch1phy0@0 { - reg = <0>; - interrupt-parent = <&switch0>; - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; - }; - }; - }; - }; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - interrupt-parent = <&gpio0>; - interrupts = <27 IRQ_TYPE_LEVEL_LOW>; - interrupt-controller; - #interrupt-cells = <2>; - - switch0: switch@0 { - compatible = "marvell,mv88e6190"; - reg = <0>; - reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; - - mdio { - #address-cells = <1>; - #size-cells = <0>; - switch1phy0: switch1phy0@0 { - reg = <0>; - interrupt-parent = <&switch0>; - interrupts = <0 IRQ_TYPE_LEVEL_HIGH>; - }; - }; - - mdio1 { - compatible = "marvell,mv88e6xxx-mdio-external"; - #address-cells = <1>; - #size-cells = <0>; - switch1phy9: switch1phy0@9 { - reg = <9>; - }; - }; - }; - }; diff --git a/Documentation/devicetree/bindings/net/dsa/marvell.yaml b/Documentation/devicetree/bindings/net/dsa/marvell.yaml new file mode 100644 index 000000000000..45756b8d74d9 --- /dev/null +++ b/Documentation/devicetree/bindings/net/dsa/marvell.yaml @@ -0,0 +1,204 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/dsa/marvell.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell Ethernet Switches + +$ref: dsa.yaml#/$defs/ethernet-ports + +maintainers: + - Andrew Lunn + - Arınç ÜNAL + +description: + Marvell ethernet switches are MDIO devices. + +properties: + compatible: + oneOf: + - description: | + Switch has base address 0x10. Use with models: + 6085, 6095, 6097, 6123, 6131, 6141, 6161, 6165, 6171, 6172, 6175, + 6176, 6185, 6240, 6320, 6321, 6341, 6350, 6351, 6352 + const: marvell,mv88e6085 + + - description: | + Switch has base address 0x00. Use with models: + 6190, 6190X, 6191, 6290, 6361, 6390, 6390X + const: marvell,mv88e6190 + + - description: | + Switch has base address 0x08 or 0x18. Use with models: + 6220, 6250 + const: marvell,mv88e6250 + + reg: + maxItems: 1 + + reset-gpios: + description: GPIO to be used to reset the whole device + maxItems: 1 + + "#interrupt-cells": + const: 2 + + interrupt-controller: true + + interrupts: + maxItems: 1 + + eeprom-length: + description: + Set to the length of an EEPROM connected to the switch. Must be set if the + switch can not detect the presence and/or size of a connected EEPROM, + otherwise optional. + + mdio: + description: + The optional node for the MDIO bus of the switch. The bus will be + registered non-OF-based if this is not defined. + $ref: /schemas/net/mdio.yaml# + + mdio-external: + description: The externally reachable MDIO bus of the 6390 family switches + $ref: /schemas/net/mdio.yaml# + + properties: + compatible: + const: marvell,mv88e6xxx-mdio-external + + required: + - compatible + +required: + - compatible + - reg + +allOf: + - if: + properties: + compatible: + enum: + - marvell,mv88e6085 + - marvell,mv88e6250 + then: + properties: + mdio-external: false + + - if: + required: [ mdio ] + then: + patternProperties: + "^(ethernet-)?ports$": + patternProperties: + "^(ethernet-)?port@[0-9]+$": + $ref: /schemas/net/ethernet-controller.yaml#/$defs/phylink + +unevaluatedProperties: false + +examples: + - | + #include + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switch@0 { + compatible = "marvell,mv88e6085"; + reg = <0>; + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + phy-mode = "rmii"; + ethernet = <&fec1>; + + fixed-link { + speed = <100>; + full-duplex; + }; + }; + + port@1 { + reg = <1>; + label = "swp1"; + }; + }; + }; + }; + + - | + #include + #include + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + switch: switch@0 { + compatible = "marvell,mv88e6190"; + reg = <0>; + reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio3>; + interrupts = <2 IRQ_TYPE_LEVEL_LOW>; + interrupt-controller; + #interrupt-cells = <2>; + + ethernet-ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + phy-mode = "rmii"; + ethernet = <&fec1>; + + fixed-link { + speed = <100>; + full-duplex; + }; + }; + + port@1 { + reg = <1>; + label = "swp1"; + phy-handle = <ðphy1>; + }; + + port@2 { + reg = <2>; + label = "swp2"; + phy-handle = <&ext_ethphy0>; + }; + }; + + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethphy1: ethernet-phy@1 { + reg = <1>; + interrupt-parent = <&switch>; + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>; + }; + }; + + mdio-external { + compatible = "marvell,mv88e6xxx-mdio-external"; + #address-cells = <1>; + #size-cells = <0>; + + ext_ethphy0: ethernet-phy@0 { + reg = <0>; + compatible = "ethernet-phy-ieee802.3-c45"; + }; + }; + }; + }; From patchwork Sat Sep 16 11:09:01 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388330 X-Patchwork-Delegate: geert@linux-m68k.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 267ABCD37B7 for ; Sat, 16 Sep 2023 11:15:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238089AbjIPLOn (ORCPT ); Sat, 16 Sep 2023 07:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239181AbjIPLON (ORCPT ); Sat, 16 Sep 2023 07:14:13 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::221]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 783D1CE9; Sat, 16 Sep 2023 04:13:46 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id A4B67240004; Sat, 16 Sep 2023 11:13:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862825; 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=PDRE70R3lGz5ezhDBmTyzAtvLuORLg4w0dd0nsfORgc=; b=Neaf6SAGL7XVuZ5i4UaYHEGAe9v3D5Al2VGQf2Q38vACYLlG1sm2cRx5W3Rh0XMh8REHma f/frjptNDm5AijdY9O1S8i7IlT99bnn2y1dKH0Wt13Dj81J/6uZqd2NDYmNQsKSgOHb4b+ i1JN+vAayRvuB1vRJamwKLfUB6BYDx9XKvggqxhWFn7pfTbJ2F6uo+nlJp7F8Wz3zhtOO+ 3lS8G3atb6Th+AoBgRcGre1ZtuupEFaTQhQtlA9FcXFugFt3jfG99ujrthbkPmKNtlGhxj OE7Zr6czr5evQ71Q84QOEXsNBGF242x4vaBtV24ikCLdenRtlq2zDfmjndAy6Q== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 09/10] MAINTAINERS: update MARVELL 88E6XXX ETHERNET SWITCH document file name Date: Sat, 16 Sep 2023 14:09:01 +0300 Message-Id: <20230916110902.234273-10-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org The dt-bindings document was converted to json-schema. Update the file name. Signed-off-by: Arınç ÜNAL --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 612d6d1dbf36..5d4e6b578c04 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -12564,7 +12564,7 @@ MARVELL 88E6XXX ETHERNET SWITCH FABRIC DRIVER M: Andrew Lunn L: netdev@vger.kernel.org S: Maintained -F: Documentation/devicetree/bindings/net/dsa/marvell.txt +F: Documentation/devicetree/bindings/net/dsa/marvell.yaml F: Documentation/networking/devlink/mv88e6xxx.rst F: drivers/net/dsa/mv88e6xxx/ F: include/linux/dsa/mv88e6xxx.h From patchwork Sat Sep 16 11:09:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= X-Patchwork-Id: 13388329 X-Patchwork-Delegate: geert@linux-m68k.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 501E6CD37BB for ; Sat, 16 Sep 2023 11:15:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239169AbjIPLOo (ORCPT ); Sat, 16 Sep 2023 07:14:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239219AbjIPLOR (ORCPT ); Sat, 16 Sep 2023 07:14:17 -0400 Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12A031BD; Sat, 16 Sep 2023 04:14:04 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 89478240005; Sat, 16 Sep 2023 11:13:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1694862843; 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=HAZCgeoh9KUduxxc51sEyaD/Ww3GnyAUx/PFLTVQyPc=; b=hKK2Wuk79GoaUo/hY/fuO5GNEsYpXvHQTmZHzkmUu1psjYgV5XTyUjTmWeR3yNV65L4Ghz kQB0p3rthYgY0/1iJ1iTHdBtt3XqWLfmGTwb2cQTywTU4YqVAi5uQYhbNk7NK/b0s7wch5 o3R6bt5DMAyUXaAkMcviVr7aHL8KquFNdxeplIiYsZKYMMVXrxtHkocr3elHkU4mPcuJqK 21vBYwU+gVEk/OLBULj3WcOF61OeP3y7yC+8z+plp1vHHwnnZbaTiVNcvxSGNrMqFtf+FM p6uiuukzlQvtFjbmaBTjXA7kM9QiyQdGrD7nVsUCHlmLE9UgQKwalLOkDla9Pw== From: =?utf-8?b?QXLEsW7DpyDDnE5BTA==?= To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , George McCollister , Andrew Lunn , Florian Fainelli , Vladimir Oltean , Kurt Kanzenbach , Matthias Brugger , AngeloGioacchino Del Regno , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?utf-8?q?Alvin_=C5=A0ipraga?= , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Marcin Wojtas , "Russell King (Oracle)" , Lars Povlsen , Steen Hegelund , Daniel Machon , Radhey Shyam Pandey , =?utf-8?b?QXLEsW7DpyA=?= =?utf-8?b?w5xOQUw=?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Geert Uytterhoeven , Magnus Damm , Maxime Chevallier , Nicolas Ferre , Claudiu Beznea , Marek Vasut , Claudiu Manoil , Alexandre Belloni , John Crispin , Madalin Bucur , Ioana Ciornei , Lorenzo Bianconi , Felix Fietkau , Horatiu Vultur , Oleksij Rempel , Alexandre Torgue , Giuseppe Cavallaro , Jose Abreu , Grygorii Strashko , Sekhar Nori , Shyam Pandey Cc: Woojung Huh , Steen Hegelund , mithat.guner@xeront.com, erkin.bozoglu@xeront.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org Subject: [PATCH net-next v2 10/10] dt-bindings: net: marvell-armada-370-neta: convert to json-schema Date: Sat, 16 Sep 2023 14:09:02 +0300 Message-Id: <20230916110902.234273-11-arinc.unal@arinc9.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230916110902.234273-1-arinc.unal@arinc9.com> References: <20230916110902.234273-1-arinc.unal@arinc9.com> MIME-Version: 1.0 X-GND-Sasl: arinc.unal@arinc9.com Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Convert the document for Marvell Armada 370 / Armada XP / Armada 3700 Ethernet Controller (NETA) to json-schema. Signed-off-by: Arınç ÜNAL --- .../bindings/net/marvell-armada-370-neta.txt | 50 --------- .../bindings/net/marvell-armada-370-neta.yaml | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 50 deletions(-) delete mode 100644 Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt create mode 100644 Documentation/devicetree/bindings/net/marvell-armada-370-neta.yaml diff --git a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt deleted file mode 100644 index 2bf31572b08d..000000000000 --- a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.txt +++ /dev/null @@ -1,50 +0,0 @@ -* Marvell Armada 370 / Armada XP / Armada 3700 Ethernet Controller (NETA) - -Required properties: -- compatible: could be one of the following: - "marvell,armada-370-neta" - "marvell,armada-xp-neta" - "marvell,armada-3700-neta" - "marvell,armada-ac5-neta" -- reg: address and length of the register set for the device. -- interrupts: interrupt for the device -- phy: See ethernet.txt file in the same directory. -- phy-mode: See ethernet.txt file in the same directory -- clocks: List of clocks for this device. At least one clock is - mandatory for the core clock. If several clocks are given, then the - clock-names property must be used to identify them. - -Optional properties: -- tx-csum-limit: maximum mtu supported by port that allow TX checksum. - Value is presented in bytes. If not used, by default 1600B is set for - "marvell,armada-370-neta" and 9800B for others. -- clock-names: List of names corresponding to clocks property; shall be - "core" for core clock and "bus" for the optional bus clock. -- phys: comphy for the ethernet port, see ../phy/phy-bindings.txt - -Optional properties (valid only for Armada XP/38x): - -- buffer-manager: a phandle to a buffer manager node. Please refer to - Documentation/devicetree/bindings/net/marvell-neta-bm.txt -- bm,pool-long: ID of a pool, that will accept all packets of a size - higher than 'short' pool's threshold (if set) and up to MTU value. - Obligatory, when the port is supposed to use hardware - buffer management. -- bm,pool-short: ID of a pool, that will be used for accepting - packets of a size lower than given threshold. If not set, the port - will use a single 'long' pool for all packets, as defined above. - -Example: - -ethernet@70000 { - compatible = "marvell,armada-370-neta"; - reg = <0x70000 0x2500>; - interrupts = <8>; - clocks = <&gate_clk 4>; - tx-csum-limit = <9800> - phy = <&phy0>; - phy-mode = "rgmii-id"; - buffer-manager = <&bm>; - bm,pool-long = <0>; - bm,pool-short = <1>; -}; diff --git a/Documentation/devicetree/bindings/net/marvell-armada-370-neta.yaml b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.yaml new file mode 100644 index 000000000000..9283ab74cdb2 --- /dev/null +++ b/Documentation/devicetree/bindings/net/marvell-armada-370-neta.yaml @@ -0,0 +1,102 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/marvell-armada-370-neta.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Marvell Armada 370 / Armada XP / Armada 3700 Ethernet Controller (NETA) + +allOf: + - $ref: ethernet-controller.yaml# + - $ref: ethernet-controller.yaml#/$defs/phylink + +maintainers: + - Arınç ÜNAL + +properties: + compatible: + enum: + - marvell,armada-370-neta + - marvell,armada-xp-neta + - marvell,armada-3700-neta + - marvell,armada-ac5-neta + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + description: + List of clocks for this device. At least one clock is mandatory for the + core clock. If several clocks are given, then the clock-names property + must be used to identify them. + + tx-csum-limit: + description: + Maximum mtu supported by port that allow TX checksum. Value is presented + in bytes. If not used, by default 1600B is set for + "marvell,armada-370-neta" and 9800B for others. + + clock-names: + description: + List of names corresponding to clocks property; shall be "core" for core + clock and "bus" for the optional bus clock. + + phys: + description: + comphy for the ethernet port, see ../phy/phy-bindings.txt. + +if: + properties: + compatible: + enum: + - marvell,armada-370-neta + - marvell,armada-xp-neta +then: + properties: + buffer-manager: + description: + A phandle to a buffer manager node. Please refer to + Documentation/devicetree/bindings/net/marvell-neta-bm.txt. + + bm,pool-long: + description: + ID of a pool, that will accept all packets of a size higher than 'short' + pool's threshold (if set) and up to MTU value. Obligatory, when the port + is supposed to use hardware buffer management. + + bm,pool-short: + description: + ID of a pool, that will be used for accepting packets of a size lower + than given threshold. If not set, the port will use a single 'long' pool + for all packets, as defined above. + +required: + - compatible + - reg + - interrupts + - phy-mode + - clocks + +unevaluatedProperties: false + +examples: + - | + ethernet@70000 { + compatible = "marvell,armada-370-neta"; + reg = <0x70000 0x2500>; + interrupts = <8>; + clocks = <&gate_clk 4>; + tx-csum-limit = <9800>; + phy-mode = "rgmii-id"; + buffer-manager = <&bm>; + bm,pool-long = <0>; + bm,pool-short = <1>; + + fixed-link { + speed = <1000>; + full-duplex; + }; + };