From 3f301a2800786dd57174a0f3f010c8449f5f6c37 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Mon, 12 Sep 2022 20:50:56 +0300 Subject: [PATCH 1/3] dt-bindings: net: dsa: mt7530: replace label = "cpu" with proper checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fact that some DSA device trees use 'label = "cpu"' for the CPU port is nothing but blind cargo cult copying. The 'label' property was never part of the DSA DT bindings for anything except the user ports, where it provided a hint as to what name the created netdevs should use. DSA does use the "cpu" port label to identify a CPU port in dsa_port_parse(), but this is only for non-OF code paths (platform data). The proper way to identify a CPU port is to look at whether the 'ethernet' phandle is present. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski --- .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index f9e7b6e20b35e..fa271ee16b5e8 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -163,9 +163,7 @@ patternProperties: allOf: - $ref: dsa-port.yaml# - if: - properties: - label: - const: cpu + required: [ ethernet ] then: required: - phy-mode @@ -187,9 +185,7 @@ $defs: patternProperties: "^(ethernet-)?port@[0-9]+$": if: - properties: - label: - const: cpu + required: [ ethernet ] then: if: properties: @@ -215,9 +211,7 @@ $defs: patternProperties: "^(ethernet-)?port@[0-9]+$": if: - properties: - label: - const: cpu + required: [ ethernet ] then: if: properties: From cdd3e486d705b1efc368a06abd2d08e34ce749dd Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Mon, 12 Sep 2022 20:50:57 +0300 Subject: [PATCH 2/3] dt-bindings: net: dsa: mt7530: stop requiring phy-mode on CPU ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The common dsa-port.yaml does this (and more) since commit 2ec2fb8331af ("dt-bindings: net: dsa: make phylink bindings required for CPU/DSA ports"). Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Reviewed-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski --- Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index fa271ee16b5e8..84bb36cab5182 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -165,9 +165,6 @@ patternProperties: - if: required: [ ethernet ] then: - required: - - phy-mode - properties: reg: enum: From 9cc115d8d6f73dd260de1609182f3645844d6907 Mon Sep 17 00:00:00 2001 From: Vladimir Oltean Date: Mon, 12 Sep 2022 20:50:58 +0300 Subject: [PATCH 3/3] dt-bindings: net: dsa: remove label = "cpu" from examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is not used by the DSA dt-binding, so remove it from all examples. Signed-off-by: Vladimir Oltean Reviewed-by: Florian Fainelli Acked-by: Arınç ÜNAL Acked-by: Rob Herring Signed-off-by: Jakub Kicinski --- Documentation/devicetree/bindings/net/dsa/ar9331.txt | 1 - .../devicetree/bindings/net/dsa/arrow,xrs700x.yaml | 1 - Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml | 2 -- .../devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml | 1 - Documentation/devicetree/bindings/net/dsa/lan9303.txt | 2 -- Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt | 1 - .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 7 ------- .../devicetree/bindings/net/dsa/microchip,ksz.yaml | 2 -- Documentation/devicetree/bindings/net/dsa/qca8k.yaml | 3 --- Documentation/devicetree/bindings/net/dsa/realtek.yaml | 2 -- .../devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml | 1 - .../devicetree/bindings/net/dsa/vitesse,vsc73xx.txt | 2 -- 12 files changed, 25 deletions(-) diff --git a/Documentation/devicetree/bindings/net/dsa/ar9331.txt b/Documentation/devicetree/bindings/net/dsa/ar9331.txt index 320607cbbb176..f824fdae0da20 100644 --- a/Documentation/devicetree/bindings/net/dsa/ar9331.txt +++ b/Documentation/devicetree/bindings/net/dsa/ar9331.txt @@ -76,7 +76,6 @@ eth1: ethernet@1a000000 { switch_port0: port@0 { reg = <0x0>; - label = "cpu"; ethernet = <ð1>; phy-mode = "gmii"; diff --git a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml index eb01a8f37ce44..259a0c6547f30 100644 --- a/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml +++ b/Documentation/devicetree/bindings/net/dsa/arrow,xrs700x.yaml @@ -61,7 +61,6 @@ examples: }; ethernet-port@3 { reg = <3>; - label = "cpu"; ethernet = <&fec1>; phy-mode = "rgmii-id"; diff --git a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml index 2e01371b8288c..1219b830b1a46 100644 --- a/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml +++ b/Documentation/devicetree/bindings/net/dsa/brcm,b53.yaml @@ -169,7 +169,6 @@ examples: port@8 { reg = <8>; - label = "cpu"; phy-mode = "rgmii-txid"; ethernet = <ð0>; fixed-link { @@ -252,7 +251,6 @@ examples: port@8 { ethernet = <&amac2>; - label = "cpu"; reg = <8>; phy-mode = "internal"; diff --git a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml index 1ff44dd68a612..73b774eadd0b1 100644 --- a/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/hirschmann,hellcreek.yaml @@ -91,7 +91,6 @@ examples: port@0 { reg = <0>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "mii"; diff --git a/Documentation/devicetree/bindings/net/dsa/lan9303.txt b/Documentation/devicetree/bindings/net/dsa/lan9303.txt index 464d6bf876053..46a732087f5ca 100644 --- a/Documentation/devicetree/bindings/net/dsa/lan9303.txt +++ b/Documentation/devicetree/bindings/net/dsa/lan9303.txt @@ -46,7 +46,6 @@ I2C managed mode: port@0 { /* RMII fixed link to master */ reg = <0>; - label = "cpu"; ethernet = <&master>; }; @@ -83,7 +82,6 @@ MDIO managed mode: port@0 { reg = <0>; - label = "cpu"; ethernet = <&master>; }; diff --git a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt index e3829d3e480e7..8bb1eff21cb1a 100644 --- a/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt +++ b/Documentation/devicetree/bindings/net/dsa/lantiq-gswip.txt @@ -96,7 +96,6 @@ switch@e108000 { port@6 { reg = <0x6>; - label = "cpu"; ethernet = <ð0>; }; }; diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml index 84bb36cab5182..bc6446e1f55ad 100644 --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml @@ -325,7 +325,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "rgmii"; @@ -389,7 +388,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "trgmii"; @@ -454,7 +452,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "2500base-x"; @@ -521,7 +518,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "trgmii"; @@ -610,7 +606,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "trgmii"; @@ -699,7 +694,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "trgmii"; @@ -787,7 +781,6 @@ examples: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "trgmii"; diff --git a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml index 456802affc9d8..4da75b1f95339 100644 --- a/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml +++ b/Documentation/devicetree/bindings/net/dsa/microchip,ksz.yaml @@ -107,7 +107,6 @@ examples: }; port@5 { reg = <5>; - label = "cpu"; ethernet = <ð0>; phy-mode = "rgmii"; @@ -146,7 +145,6 @@ examples: }; port@6 { reg = <6>; - label = "cpu"; ethernet = <ð0>; phy-mode = "rgmii"; diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml index f3c88371d76ce..978162df51f73 100644 --- a/Documentation/devicetree/bindings/net/dsa/qca8k.yaml +++ b/Documentation/devicetree/bindings/net/dsa/qca8k.yaml @@ -159,7 +159,6 @@ examples: port@0 { reg = <0>; - label = "cpu"; ethernet = <&gmac1>; phy-mode = "rgmii"; @@ -221,7 +220,6 @@ examples: port@0 { reg = <0>; - label = "cpu"; ethernet = <&gmac1>; phy-mode = "rgmii"; @@ -268,7 +266,6 @@ examples: port@6 { reg = <0>; - label = "cpu"; ethernet = <&gmac1>; phy-mode = "sgmii"; diff --git a/Documentation/devicetree/bindings/net/dsa/realtek.yaml b/Documentation/devicetree/bindings/net/dsa/realtek.yaml index 4f99aff029dc9..1a7d45a8ad66a 100644 --- a/Documentation/devicetree/bindings/net/dsa/realtek.yaml +++ b/Documentation/devicetree/bindings/net/dsa/realtek.yaml @@ -189,7 +189,6 @@ examples: }; port@5 { reg = <5>; - label = "cpu"; ethernet = <&gmac0>; phy-mode = "rgmii"; fixed-link { @@ -277,7 +276,6 @@ examples: }; port@6 { reg = <6>; - label = "cpu"; ethernet = <&fec1>; phy-mode = "rgmii"; tx-internal-delay-ps = <2000>; diff --git a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml index 14a1f0b4c32b3..7ca9c19a157c6 100644 --- a/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml +++ b/Documentation/devicetree/bindings/net/dsa/renesas,rzn1-a5psw.yaml @@ -130,7 +130,6 @@ examples: port@4 { reg = <4>; ethernet = <&gmac2>; - label = "cpu"; phy-mode = "internal"; fixed-link { diff --git a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.txt b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.txt index bbf4a13f6d755..258bef483673f 100644 --- a/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.txt +++ b/Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.txt @@ -75,7 +75,6 @@ switch@0 { }; vsc: port@6 { reg = <6>; - label = "cpu"; ethernet = <&gmac1>; phy-mode = "rgmii"; fixed-link { @@ -117,7 +116,6 @@ switch@2,0 { }; vsc: port@6 { reg = <6>; - label = "cpu"; ethernet = <&enet0>; phy-mode = "rgmii"; fixed-link {