Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2656332rdh; Sun, 26 Nov 2023 14:36:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWGLTlmdq4eZyVModdx9Xg/F+qXYhfDk8Cs/H5C/fUu4/XHyaFPr3Gl0JmJLkHGBTA+bkl X-Received: by 2002:a05:6a00:a29:b0:6cb:a60c:33 with SMTP id p41-20020a056a000a2900b006cba60c0033mr10371378pfh.27.1701038175128; Sun, 26 Nov 2023 14:36:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701038175; cv=none; d=google.com; s=arc-20160816; b=qK4psrBt1LYe8Q/Wgdi1vUz4LtkQ6YZ6rDSncjTZlqZpz9EPNSWD8IUSfnqeWFvFPN XhCz1Xlnmg6Sb6wCSqlT6KnqQhEh0Nq7Jl1uxsghWQdeiB4XiuKxfXIeKwnO7dvTkcJ2 rkXQlyURp+r90mTcWbLXIZtm36funJlcKLNTgnTRmB+smBW4J3hyGgDVdOVimgXydAQD fT6Prx4eAzPVZ6hhjtdE8Wvd4Y3lRwYmz9H2CEX4bTzBGbgszcTFK9D49BMM2e4Tpytt dx0y5W12cUE7A/fkHZtAnr+GG1MzAYGDOibAsFTyNh4cqn46RLRhTd0P4VkQNqwl7fAG AkKw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=n75xW8UQy4lFaf5wY1ktBsIXGQQJtA1B4wLYbneEbC0=; fh=XfTwZ2VJ5NoZfP32a9DL2KjJKy8Dg4plhzKuQUD8XqA=; b=AAvUmwc9XN9kzGgsQHyDf0wRTpz3oEn2DJKCf7+Rf5mZ5RHXDybT/s8lqSz/UN+1G0 2l1AzkE5nqSDDWUE37AjLgSHYOZrR0q3+jnk5UE/b6nM2GRJf1ryX2sUhINZrOaFhRMG UShavfMGUXr4TFDf7PFa3AzU3Afw7tTbqEiR83voZeenJn+Swx0wsCmzmqu0+Oai6fip W2vpep0Lryb0vQjYaYTrv5jPUBs/TSLTU3XD93O2ep5DiED9OBoQ8KiVENqiTuikefI/ FeQGyYYOwDMf34cSPvKPkP5Tqokr5koe9vR3y5PusTJkEJi9aYm0pj7qgGle8cT9qX9f ZVAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bi6-20020a056a02024600b005c2203bfc01si9706282pgb.170.2023.11.26.14.36.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 14:36:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id AB0A7803E9E4; Sun, 26 Nov 2023 14:36:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbjKZWfy (ORCPT + 99 others); Sun, 26 Nov 2023 17:35:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjKZWfw (ORCPT ); Sun, 26 Nov 2023 17:35:52 -0500 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24BF9E3; Sun, 26 Nov 2023 14:35:59 -0800 (PST) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96.2) (envelope-from ) id 1r7NjA-0002M0-22; Sun, 26 Nov 2023 22:35:49 +0000 Date: Sun, 26 Nov 2023 22:35:45 +0000 From: Daniel Golle To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Vladimir Oltean , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , 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: Re: [PATCH RESEND net-next 2/2] dt-bindings: net: dsa: mediatek,mt7530: document MDIO-bus Message-ID: References: <6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org> <9aec0fe0cb676b76132c388bb3ead46f596a6e6e.1691246461.git.daniel@makrotopia.org> <20230808121707.chona7hakapp6whe@skbuf> <44fde617-1159-4961-84c4-372fe265fbd8@arinc9.com> <20230809220102.t3dqw7iojez5xsq3@skbuf> <3f262579-eec1-4b21-9b18-1d1d612e715b@arinc9.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <3f262579-eec1-4b21-9b18-1d1d612e715b@arinc9.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sun, 26 Nov 2023 14:36:12 -0800 (PST) On Sat, Aug 12, 2023 at 01:45:29AM +0300, Arınç ÜNAL wrote: > On 10.08.2023 01:01, Vladimir Oltean wrote: > > [...] > > Since commit fe7324b93222 ("net: dsa: OF-ware slave_mii_bus"), DSA as a > > framework also supports auto-creating an internal MDIO bus based on the > > presence of the "mdio" node name, so I guess it makes sense for the > > "mdio" to appear in the generic dsa.yaml if there's nothing else that's > > special about it. > > I agree with this. I've done this which works. It's even found a port > node with the ethernet property missing, as it should've. Are you planning to complete/submit your work below? I'm asking because being able to reference the PHYs on the internal MDIO bus is mandatory on MT7988 which requires calibration data from NVMEM for each PHY, so supporting MT7988 depends on the associated driver change[1]. [1]: https://patchwork.kernel.org/project/netdevbpf/patch/6eb1b7b8dbc3a4b14becad15f0707d4f624ee18b.1691246461.git.daniel@makrotopia.org/ > > diff --git a/Documentation/devicetree/bindings/net/dsa/dsa.yaml b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > index ec74a660beda..03ccedbc49dc 100644 > --- a/Documentation/devicetree/bindings/net/dsa/dsa.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/dsa.yaml > @@ -31,6 +31,24 @@ properties: > (single device hanging off a CPU port) must not specify this property > $ref: /schemas/types.yaml#/definitions/uint32-array > + mdio: > + description: The internal MDIO bus of the switch > + $ref: /schemas/net/mdio.yaml# > + > +if: > + required: [ mdio ] > +then: > + patternProperties: > + "^(ethernet-)?ports$": > + patternProperties: > + "^(ethernet-)?port@[0-9]+$": > + if: > + not: > + required: [ ethernet ] > + then: > + required: > + - phy-handle > + > additionalProperties: true > $defs: > diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml > index 8d7e878b84dc..fe1e2008995d 100644 > --- a/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/microchip,lan937x.yaml > @@ -78,6 +78,16 @@ examples: > }; > }; > + macb1 { > + #address-cells = <1>; > + #size-cells = <0>; > + > + fixed-link { > + speed = <1000>; > + full-duplex; > + }; > + }; > + > spi { > #address-cells = <1>; > #size-cells = <0>; > @@ -138,6 +148,7 @@ examples: > phy-mode = "rgmii"; > tx-internal-delay-ps = <2000>; > rx-internal-delay-ps = <2000>; > + ethernet = <&macb0>; > fixed-link { > speed = <1000>; > diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml > index cfd69c2604ea..f600e65fc990 100644 > --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml > +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml > @@ -6,9 +6,6 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# > title: Realtek switches for unmanaged switches > -allOf: > - - $ref: dsa.yaml#/$defs/ethernet-ports > - > maintainers: > - Linus Walleij > @@ -95,37 +92,41 @@ properties: > - '#address-cells' > - '#interrupt-cells' > - mdio: > - $ref: /schemas/net/mdio.yaml# > - unevaluatedProperties: false > - > - properties: > - compatible: > - const: realtek,smi-mdio > - > -if: > - required: > - - reg > - > -then: > - $ref: /schemas/spi/spi-peripheral-props.yaml# > - not: > - required: > - - mdc-gpios > - - mdio-gpios > - - mdio > - > - properties: > - mdc-gpios: false > - mdio-gpios: false > - mdio: false > - > -else: > - required: > - - mdc-gpios > - - mdio-gpios > - - mdio > - - reset-gpios > +allOf: > + - $ref: dsa.yaml#/$defs/ethernet-ports > + - if: > + required: [ mdio ] > + then: > + properties: > + mdio: > + properties: > + compatible: > + const: realtek,smi-mdio > + > + required: > + - compatible > + > + - if: > + required: > + - reg > + then: > + $ref: /schemas/spi/spi-peripheral-props.yaml# > + not: > + required: > + - mdc-gpios > + - mdio-gpios > + - mdio > + > + properties: > + mdc-gpios: false > + mdio-gpios: false > + mdio: false > + else: > + required: > + - mdc-gpios > + - mdio-gpios > + - mdio > + - reset-gpios > required: > - compatible >