All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Sander Vanheule" <sander@svanheule.net>,
	linux-kernel@vger.kernel.org,
	"René van Dorst" <opensource@vdorst.com>,
	"Eric Dumazet" <edumazet@google.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	erkin.bozoglu@xeront.com,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	devicetree@vger.kernel.org,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	linux-mediatek@lists.infradead.org,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org, netdev@vger.kernel.org,
	"Daniel Golle" <daniel@makrotopia.org>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>
Subject: Re: [PATCH v2 6/7] dt-bindings: net: dsa: mediatek,mt7530: define phy-mode for each compatible
Date: Tue, 16 Aug 2022 15:21:35 -0600	[thread overview]
Message-ID: <20220816212135.GA2747439-robh@kernel.org> (raw)
In-Reply-To: <20220813154415.349091-7-arinc.unal@arinc9.com>

On Sat, Aug 13, 2022 at 06:44:14PM +0300, Arınç ÜNAL wrote:
> Define acceptable phy-mode values for CPU port of each compatible device.
> Remove relevant information from the description of the binding.

I'm not really sure this is worth the complexity just to check 
'phy-mode'...

> 
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  .../bindings/net/dsa/mediatek,mt7530.yaml     | 103 ++++++++++++++++--
>  1 file changed, 92 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index a27cb4fa490f..530ef5a75a2f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -49,17 +49,6 @@ description: |
>    * mt7621: phy-mode = "rgmii-txid";
>    * mt7623: phy-mode = "rgmii";
>  
> -  CPU-Ports need a phy-mode property:
> -    Allowed values on mt7530 and mt7621:
> -      - "rgmii"
> -      - "trgmii"
> -    On mt7531:
> -      - "1000base-x"
> -      - "2500base-x"
> -      - "rgmii"
> -      - "sgmii"
> -
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -177,6 +166,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:

You've restricted this to ports 5 or 6 already, so you just need an 
'else' here. And you can then drop the 'allOf'.

> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -206,6 +225,38 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - rgmii
> +                                - sgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - sgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -235,6 +286,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +

Looks like the same schema duplicated. You can put it under a '$defs' 
and reference it twice.

>                      required:
>                        - phy-mode
>  
> -- 
> 2.34.1
> 
> 


WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Frank Wunderlich" <frank-w@public-files.de>,
	"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
	"Sander Vanheule" <sander@svanheule.net>,
	"René van Dorst" <opensource@vdorst.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	erkin.bozoglu@xeront.com,
	"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/7] dt-bindings: net: dsa: mediatek,mt7530: define phy-mode for each compatible
Date: Tue, 16 Aug 2022 15:21:35 -0600	[thread overview]
Message-ID: <20220816212135.GA2747439-robh@kernel.org> (raw)
In-Reply-To: <20220813154415.349091-7-arinc.unal@arinc9.com>

On Sat, Aug 13, 2022 at 06:44:14PM +0300, Arınç ÜNAL wrote:
> Define acceptable phy-mode values for CPU port of each compatible device.
> Remove relevant information from the description of the binding.

I'm not really sure this is worth the complexity just to check 
'phy-mode'...

> 
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  .../bindings/net/dsa/mediatek,mt7530.yaml     | 103 ++++++++++++++++--
>  1 file changed, 92 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index a27cb4fa490f..530ef5a75a2f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -49,17 +49,6 @@ description: |
>    * mt7621: phy-mode = "rgmii-txid";
>    * mt7623: phy-mode = "rgmii";
>  
> -  CPU-Ports need a phy-mode property:
> -    Allowed values on mt7530 and mt7621:
> -      - "rgmii"
> -      - "trgmii"
> -    On mt7531:
> -      - "1000base-x"
> -      - "2500base-x"
> -      - "rgmii"
> -      - "sgmii"
> -
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -177,6 +166,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:

You've restricted this to ports 5 or 6 already, so you just need an 
'else' here. And you can then drop the 'allOf'.

> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -206,6 +225,38 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - rgmii
> +                                - sgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - sgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -235,6 +286,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +

Looks like the same schema duplicated. You can put it under a '$defs' 
and reference it twice.

>                      required:
>                        - phy-mode
>  
> -- 
> 2.34.1
> 
> 

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

WARNING: multiple messages have this Message-ID (diff)
From: Rob Herring <robh@kernel.org>
To: "Arınç ÜNAL" <arinc.unal@arinc9.com>
Cc: "Andrew Lunn" <andrew@lunn.ch>,
	"Vivien Didelot" <vivien.didelot@gmail.com>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Vladimir Oltean" <olteanv@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	"Eric Dumazet" <edumazet@google.com>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Paolo Abeni" <pabeni@redhat.com>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"Sean Wang" <sean.wang@mediatek.com>,
	"Landen Chao" <Landen.Chao@mediatek.com>,
	"DENG Qingfang" <dqfext@gmail.com>,
	"Frank Wunderlich" <frank-w@public-files.de>,
	"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
	"Sander Vanheule" <sander@svanheule.net>,
	"René van Dorst" <opensource@vdorst.com>,
	"Daniel Golle" <daniel@makrotopia.org>,
	erkin.bozoglu@xeront.com,
	"Sergio Paracuellos" <sergio.paracuellos@gmail.com>,
	netdev@vger.kernel.org, devicetree@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/7] dt-bindings: net: dsa: mediatek,mt7530: define phy-mode for each compatible
Date: Tue, 16 Aug 2022 15:21:35 -0600	[thread overview]
Message-ID: <20220816212135.GA2747439-robh@kernel.org> (raw)
In-Reply-To: <20220813154415.349091-7-arinc.unal@arinc9.com>

On Sat, Aug 13, 2022 at 06:44:14PM +0300, Arınç ÜNAL wrote:
> Define acceptable phy-mode values for CPU port of each compatible device.
> Remove relevant information from the description of the binding.

I'm not really sure this is worth the complexity just to check 
'phy-mode'...

> 
> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
> ---
>  .../bindings/net/dsa/mediatek,mt7530.yaml     | 103 ++++++++++++++++--
>  1 file changed, 92 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index a27cb4fa490f..530ef5a75a2f 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -49,17 +49,6 @@ description: |
>    * mt7621: phy-mode = "rgmii-txid";
>    * mt7623: phy-mode = "rgmii";
>  
> -  CPU-Ports need a phy-mode property:
> -    Allowed values on mt7530 and mt7621:
> -      - "rgmii"
> -      - "trgmii"
> -    On mt7531:
> -      - "1000base-x"
> -      - "2500base-x"
> -      - "rgmii"
> -      - "sgmii"
> -
> -
>  properties:
>    compatible:
>      oneOf:
> @@ -177,6 +166,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:

You've restricted this to ports 5 or 6 already, so you just need an 
'else' here. And you can then drop the 'allOf'.

> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -206,6 +225,38 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - rgmii
> +                                - sgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - 1000base-x
> +                                - 2500base-x
> +                                - sgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +
>                      required:
>                        - phy-mode
>  
> @@ -235,6 +286,36 @@ allOf:
>                          items:
>                            - const: cpu
>                    then:
> +                    allOf:
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 5
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - gmii
> +                                - mii
> +                                - rgmii
> +
> +                      - if:
> +                          properties:
> +                            reg:
> +                              const: 6
> +                        then:
> +                          properties:
> +                            phy-mode:
> +                              enum:
> +                                - rgmii
> +                                - trgmii
> +
> +                    properties:
> +                      reg:
> +                        enum:
> +                          - 5
> +                          - 6
> +

Looks like the same schema duplicated. You can put it under a '$defs' 
and reference it twice.

>                      required:
>                        - phy-mode
>  
> -- 
> 2.34.1
> 
> 

  reply	other threads:[~2022-08-16 21:21 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-13 15:44 [PATCH v2 0/7] completely rework mediatek,mt7530 binding Arınç ÜNAL
2022-08-13 15:44 ` Arınç ÜNAL
2022-08-13 15:44 ` [PATCH v2 1/7] dt-bindings: net: dsa: mediatek,mt7530: make trivial changes Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 20:49   ` Rob Herring
2022-08-16 20:49     ` Rob Herring
2022-08-16 20:49     ` Rob Herring
2022-08-13 15:44 ` [PATCH v2 2/7] dt-bindings: net: dsa: mediatek,mt7530: fix reset lines Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 20:52   ` Rob Herring
2022-08-16 20:52     ` Rob Herring
2022-08-16 20:52     ` Rob Herring
2022-08-16 22:25     ` Arınç ÜNAL
2022-08-16 22:25       ` Arınç ÜNAL
2022-08-16 22:25       ` Arınç ÜNAL
2022-08-13 15:44 ` [PATCH v2 3/7] dt-bindings: net: dsa: mediatek,mt7530: update examples Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 21:02   ` Rob Herring
2022-08-16 21:02     ` Rob Herring
2022-08-16 21:02     ` Rob Herring
2022-08-16 22:15     ` Arınç ÜNAL
2022-08-16 22:15       ` Arınç ÜNAL
2022-08-16 22:15       ` Arınç ÜNAL
2022-08-13 15:44 ` [PATCH v2 4/7] dt-bindings: net: dsa: mediatek,mt7530: define port binding per compatible Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-19 12:43   ` Krzysztof Kozlowski
2022-08-19 12:43     ` Krzysztof Kozlowski
2022-08-20  7:34     ` Arınç ÜNAL
2022-08-20  7:34       ` Arınç ÜNAL
2022-08-23 10:48       ` Krzysztof Kozlowski
2022-08-23 10:48         ` Krzysztof Kozlowski
2022-08-13 15:44 ` [PATCH v2 5/7] dt-bindings: net: dsa: mediatek,mt7530: remove unnecesary lines Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 21:14   ` Rob Herring
2022-08-16 21:14     ` Rob Herring
2022-08-16 21:14     ` Rob Herring
2022-08-16 22:21     ` Arınç ÜNAL
2022-08-16 22:21       ` Arınç ÜNAL
2022-08-16 22:21       ` Arınç ÜNAL
2022-08-13 15:44 ` [PATCH v2 6/7] dt-bindings: net: dsa: mediatek,mt7530: define phy-mode for each compatible Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 21:21   ` Rob Herring [this message]
2022-08-16 21:21     ` Rob Herring
2022-08-16 21:21     ` Rob Herring
2022-08-16 22:09     ` Arınç ÜNAL
2022-08-16 22:09       ` Arınç ÜNAL
2022-08-16 22:09       ` Arınç ÜNAL
2022-08-13 15:44 ` [PATCH v2 7/7] dt-bindings: net: dsa: mediatek,mt7530: update binding description Arınç ÜNAL
2022-08-13 15:44   ` Arınç ÜNAL
2022-08-16 21:25   ` Rob Herring
2022-08-16 21:25     ` Rob Herring
2022-08-16 21:25     ` Rob Herring
2022-08-16 21:53     ` Arınç ÜNAL
2022-08-16 21:53       ` Arınç ÜNAL
2022-08-16 21:53       ` Arınç ÜNAL

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220816212135.GA2747439-robh@kernel.org \
    --to=robh@kernel.org \
    --cc=Landen.Chao@mediatek.com \
    --cc=andrew@lunn.ch \
    --cc=arinc.unal@arinc9.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=erkin.bozoglu@xeront.com \
    --cc=f.fainelli@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luizluca@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=opensource@vdorst.com \
    --cc=pabeni@redhat.com \
    --cc=sander@svanheule.net \
    --cc=sean.wang@mediatek.com \
    --cc=sergio.paracuellos@gmail.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.