Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp2081802rdg; Sun, 13 Aug 2023 08:28:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEzSrtffxgBWNwyJGEpIngTJ3vaxAbzLQn3io9FgafwOD/neA3sBs7MebSNwyKUKGN8vee9 X-Received: by 2002:a05:6a00:a89:b0:676:8fac:37 with SMTP id b9-20020a056a000a8900b006768fac0037mr8259868pfl.4.1691940506330; Sun, 13 Aug 2023 08:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691940506; cv=none; d=google.com; s=arc-20160816; b=xX1nanjTJO8vglssXFfGluxE4ELO+ElMqMVtV7Y//UMAZS6c4pY+j5q8KWLJnpXALd dzDYYccG4K1a7yhZVGPW5YkQIVy9GipePN6FNQubHL5zilm2nC1dkwHnNBnNcXmgi7FI wKThrKxSR6dOFZecFf5M0D1hwHfGKt9vQaiIWCPznu8dK44wk8xtkbCfderGmWBmisDM UXTcH8N9UK9eIZjIAbrKK2VocZRQohGFOWWK7Iby1powlgrWToJIaucGMd/EzM4GDzro hUEbDSOcGfNqRzpnr36y96Ibh3etYUKTZtlKTvLQiyLfg9LTgNolQrnPo6LGni3iW042 ralw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :content-language:references:cc:to:from:subject:user-agent :mime-version:date:message-id:dkim-signature; bh=vbfJ1w4vh9YoBeVEGEmzngRytdBt78w8hV92B1PwD0w=; fh=diOJO6Qy+/q6WgscNcFcx4SQikYu5tqlNait1U7N6yc=; b=V6UDTh0c2PlOGGgeoGnqEuQil6pnSTPlGENqM+JHCRLqUYiZ3a6u5ycikUKdsCzWn2 aYpK52McjztPARzbidDd8VF8h1BB5Ehpw/oXJ9gyI8MRvdNS0Sd1vwRwD4zsmrAeVGmP 0DDuqDBP/24RsECRFZP/rn+KyZckd1qwgKy6ksMtQkwKaKNwhNA5EUA31DhhI5J7SA4D 5VATeMBkd7N0Sdg2Vvq0YWVooGIN12xhFH5QNiYFp2Y3Pb00RgVC7FeieRjz5wVINxDl FZLiTkPbTv88UvZ3Qi41cIIUYJ8w0LX/LF+j/qH0ydC1Qkj0REcxTPTO+aHSq9R8I7N8 YF5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b="Zrz/Jo7H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o6-20020a056a001bc600b006878350b928si6483982pfw.236.2023.08.13.08.28.14; Sun, 13 Aug 2023 08:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@arinc9.com header.s=gm1 header.b="Zrz/Jo7H"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arinc9.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231312AbjHMO7K (ORCPT + 99 others); Sun, 13 Aug 2023 10:59:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230257AbjHMO7J (ORCPT ); Sun, 13 Aug 2023 10:59:09 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF62E4B; Sun, 13 Aug 2023 07:59:09 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPSA id 4E9BAC0003; Sun, 13 Aug 2023 14:58:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1691938747; 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=vbfJ1w4vh9YoBeVEGEmzngRytdBt78w8hV92B1PwD0w=; b=Zrz/Jo7HSDyWNAVlKAx9QLmmLp0ngnZoSEwxn4kw9tPJat6WjyJXyEV5i+jyX6p9CL6Urc m8t9x3Pk52MAyX5BJeR0Hw+gXNBK9ze9V2pcd5Lw3WWIx2n7sSE1sk9sXfI4+Vm1rzdpcN dw2CbphKiuUmzRM1kcq88sWEzsjoheclqsWZazQOe2VW3Vc4zxss0NC84zLzj2bBYGwV43 MJ23nSifNSw1hpsDn+2NLrHEcmWeRCpEXFE6xdHbYjjSVVT2muXFgsvl614TxiE5K8gRxm X1p5BpNm09wOmAZB693eYrQ3xpa9a8rQxxOyChOrq9aDorKKgD3VDT4sdtdgjg== Message-ID: <891c0b67-abe1-416c-aa94-675f7f3d8044@arinc9.com> Date: Sun, 13 Aug 2023 17:58:57 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/4] dt-bindings: net: dsa: document internal MDIO bus From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= To: Vladimir Oltean Cc: Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Woojung Huh , UNGLinuxDriver@microchip.com, Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Matthias Brugger , AngeloGioacchino Del Regno , 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 References: <20230812091708.34665-1-arinc.unal@arinc9.com> <20230812091708.34665-3-arinc.unal@arinc9.com> <20230812091708.34665-1-arinc.unal@arinc9.com> <20230812091708.34665-3-arinc.unal@arinc9.com> <47b61929-5c2d-4906-b153-2046a94858c8@arinc9.com> <47b61929-5c2d-4906-b153-2046a94858c8@arinc9.com> <20230813112026.ohsx6srbt2staxma@skbuf> <8a8e14f1-0493-4298-a2cc-6e7ae7929334@arinc9.com> Content-Language: en-US In-Reply-To: <8a8e14f1-0493-4298-a2cc-6e7ae7929334@arinc9.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13.08.2023 15:59, Arınç ÜNAL wrote: > On 13.08.2023 14:53, Vladimir Oltean wrote: >> On Sat, Aug 12, 2023 at 10:20:43PM +0300, Arınç ÜNAL wrote: >>> diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> index 4d5f5cc6d031e2..82dda8fae8b16e 100644 >>> --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> @@ -72,6 +72,10 @@ properties: >>>             - compatible >>>             - reg >>> +  mdio: >>> +    $ref: dsa.yaml#/properties/mdio >>> +    unevaluatedProperties: false >> >> sja1105 does not support an "mdio" child property. I haven't checked the >> others. Don't add properties that aren't supported. > > Adding the mdio property to the dsa.yaml schema will allow it on all of the > schemas that refer to dsa.yaml such as this one. This addition here is only > to disallow additional properties under the mdio property for this specific > schema. > > That said, my understanding is that the internal MDIO bus exists on all of > the switches controlled by DSA. Whether each individual DSA subdriver > supports registering it does not matter in terms of documenting the > internal MDIO bus for all DSA switches. On top of this, I'd argue to document the internal MDIO bus on the ethernet-switch.yaml schema instead. Arınç > > SJA1110 uses the mdios property instead because it's got two internal mdio > buses, which is why I invalidate the mdio property for it. If SJA1105 has > also got two internal mdio buses, let me know. > >> >>> + >>>   patternProperties: >>>     "^(ethernet-)?ports$": >>>       patternProperties: >>> >>> The nxp,sja1105.yaml schema also needed some changes. >>> >>> dt-bindings: net: dsa: nxp,sja1105: improve internal MDIO bus bindings >>> >>> SJA1110 Ethernet Switch uses the mdios property for its internal MDIO bus. >>> Therefore, disallow the mdios property for SJA1105, and the mdio property >>> for SJA1110. >>> >>> Require the phy-handle property on the non-CPU ports if the mdios property >>> is being used. >>> >>> Refer to dsa.yaml#/properties/mdio to point the human readers to the >>> description on the dsa.yaml schema. >>> >>> --- >>>   .../bindings/net/dsa/nxp,sja1105.yaml         | 20 ++++++++++++++++++- >>>   1 file changed, 19 insertions(+), 1 deletion(-) >>> >>> diff --git a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> index 82dda8fae8b16e..7d92350f1065b2 100644 >>> --- a/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> +++ b/Documentation/devicetree/bindings/net/dsa/nxp,sja1105.yaml >>> @@ -52,7 +52,7 @@ properties: >>>       patternProperties: >>>         "^mdio@[0-1]$": >>> -        $ref: /schemas/net/mdio.yaml# >>> +        $ref: dsa.yaml#/properties/mdio >>>           unevaluatedProperties: false >>>           properties: >>> @@ -128,14 +128,32 @@ allOf: >>>       then: >>>         properties: >>>           spi-cpol: false >>> +        mdios: false >>> + >>>         required: >>>           - spi-cpha >>>       else: >>>         properties: >>>           spi-cpha: false >>> +        mdio: false >>> + >>>         required: >>>           - spi-cpol >>> +  - if: >>> +      required: [ mdios ] >>> +    then: >>> +      patternProperties: >>> +        "^(ethernet-)?ports$": >>> +          patternProperties: >>> +            "^(ethernet-)?port@[0-9]+$": >>> +              if: >>> +                not: >>> +                  required: [ ethernet ] >>> +              then: >>> +                required: >>> +                  - phy-handle >> >> For sja1105, phylink-compatible bindings (phy-handle, fixed-link or managed) >> are required for all ports (user, dsa or cpu). >> >> Also, sja1105 does not populate the slave_mii_bus, so it never uses the >> fallback where ports implicitly connect to an internal PHY if no phylink >> bindings are present. > > I'll handle these accordingly with your answer to my question above. > > Arınç