Skip to contentSkip to conversation

dt-bindings: net: dsa: mediatek,mt7530: correct brand name

PATCH In review [email protected] 3 participants 11 messages Apr 7, 2023 – Apr 12, 2023

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/7 dt-bindings: net: dsa: mediatek,mt7530: correct brand name

From: Arınç ÜNAL <[email protected]>

The brand name is MediaTek, change it to that.

---
 Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +1 -1
index e532c6b795f4..6df995478275 100644
@@ -4,7 +4,7 @@
 $id: http://devicetree.org/schemas/net/dsa/mediatek,mt7530.yaml#
 $schema: http://devicetree.org/meta-schemas/core.yaml#
 
-title: Mediatek MT7530 and MT7531 Ethernet Switches
+title: MediaTek MT7530 and MT7531 Ethernet Switches
 
 maintainers:
   - Arınç ÜNAL <[email protected]>
Signature · 1 line
2.37.2
#1 lore raw

PATCH v2 2/7 dt-bindings: net: dsa: mediatek,mt7530: improve MCM and MT7988 information

From: Arınç ÜNAL <[email protected]>

Improve the description of the schema.

The MT7620 SoCs described are not part of the multi-chip module but rather built into the SoC. Mention the MT7530 MMIO driver not supporting them.

Move information for the switch on the MT7988 SoC below MT7531, and improve it.

List maintainers in alphabetical order by first name.

---
 .../bindings/net/dsa/mediatek,mt7530.yaml     | 25 ++++++++++---------
 1 file changed, 13 insertions(+), 12 deletions(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +13 -12
index 6df995478275..7045a98d9593 100644
@@ -8,29 +8,30 @@ title: MediaTek MT7530 and MT7531 Ethernet Switches
 
 maintainers:
   - Arınç ÜNAL <[email protected]>
+  - Daniel Golle <[email protected]>
   - Landen Chao <[email protected]>
   - DENG Qingfang <[email protected]>
   - Sean Wang <[email protected]>
-  - Daniel Golle <[email protected]>
 
 description: |
-  There are three versions of MT7530, standalone, in a multi-chip module and
-  built-into a SoC.
+  There are three versions of MT7530, standalone, in a multi-chip module, and
+  built into an SoC.
 
-  MT7530 is a part of the multi-chip module in MT7620AN, MT7620DA, MT7620DAN,
-  MT7620NN, MT7621AT, MT7621DAT, MT7621ST and MT7623AI SoCs.
-
-  The MT7988 SoC comes with a built-in switch similar to MT7531 as well as four
-  Gigabit Ethernet PHYs. The switch registers are directly mapped into the SoC's
-  memory map rather than using MDIO. The switch got an internally connected 10G
-  CPU port and 4 user ports connected to the built-in Gigabit Ethernet PHYs.
+  MT7530 is a part of the multi-chip module in MT7621AT, MT7621DAT, MT7621ST and
+  MT7623AI SoCs.
 
   MT7530 in MT7620AN, MT7620DA, MT7620DAN and MT7620NN SoCs has got 10/100 PHYs
-  and the switch registers are directly mapped into SoC's memory map rather than
-  using MDIO. The DSA driver currently doesn't support MT7620 variants.
+  and the switch registers are directly mapped into the SoC's memory map rather
+  than using MDIO. The MT7530 MMIO driver currently doesn't support these SoCs.
 
   There is only the standalone version of MT7531.
 
+  The MT7988 SoC comes with a built-in switch with four Gigabit Ethernet PHYs.
+  The characteristics of the switch is similar to MT7531. The switch registers
+  are directly mapped into the SoC's memory map rather than using MDIO. The
+  switch has got an internally connected 10G CPU port and 4 user ports connected
+  to the built-in Gigabit Ethernet PHYs.
+
   Port 5 on MT7530 has got various ways of configuration:
 
     - Port 5 can be used as a CPU port.
Signature · 1 line
2.37.2
#2 lore raw

PATCH v2 3/7 dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

In reply to [email protected]

From: Arınç ÜNAL <[email protected]>

The switch on MT7988 has got only port 6 as a CPU port. The only phy-mode to be used is internal. Add this.

Some bindings are incorrect for this switch now, so move them to more specific places.

Address the incorrect information of which ports can be used as a user port. Any port can be used as a user port.

---
 .../bindings/net/dsa/mediatek,mt7530.yaml     | 71 ++++++++++++-------
 1 file changed, 46 insertions(+), 25 deletions(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +46 -25
index 7045a98d9593..922865a2aabf 100644
@@ -152,30 +152,6 @@ properties:
       ethsys.
     maxItems: 1
 
-patternProperties:
-  "^(ethernet-)?ports$":
-    type: object
-
-    patternProperties:
-      "^(ethernet-)?port@[0-9]+$":
-        type: object
-
-        properties:
-          reg:
-            description:
-              Port address described must be 5 or 6 for CPU port and from 0 to 5
-              for user ports.
-
-        allOf:
-          - if:
-              required: [ ethernet ]
-            then:
-              properties:
-                reg:
-                  enum:
-                    - 5
-                    - 6
-
 required:
   - compatible
   - reg
@@ -186,9 +162,21 @@ $defs:
       "^(ethernet-)?ports$":
         patternProperties:
           "^(ethernet-)?port@[0-9]+$":
+            properties:
+              reg:
+                description:
+                  Port address described must be 5 or 6 for the CPU port. User
+                  ports can be 0 to 6.
+
             if:
               required: [ ethernet ]
             then:
+              properties:
+                reg:
+                  enum:
+                    - 5
+                    - 6
+
               if:
                 properties:
                   reg:
@@ -212,9 +200,21 @@ $defs:
       "^(ethernet-)?ports$":
         patternProperties:
           "^(ethernet-)?port@[0-9]+$":
+            properties:
+              reg:
+                description:
+                  Port address described must be 5 or 6 for the CPU port. User
+                  ports can be 0 to 6.
+
             if:
               required: [ ethernet ]
             then:
+              properties:
+                reg:
+                  enum:
+                    - 5
+                    - 6
+
               if:
                 properties:
                   reg:
@@ -235,6 +235,27 @@ $defs:
                       - 2500base-x
                       - sgmii
 
+  mt7988-dsa-port:
+    patternProperties:
+      "^(ethernet-)?ports$":
+        patternProperties:
+          "^(ethernet-)?port@[0-9]+$":
+            properties:
+              reg:
+                description:
+                  Port address described must be 6 for the CPU port. User ports
+                  can be 0 to 3, and 6.
+
+            if:
+              required: [ ethernet ]
+            then:
+              properties:
+                reg:
+                  const: 6
+
+                phy-mode:
+                  const: internal
+
 allOf:
   - $ref: dsa.yaml#/$defs/ethernet-ports
   - if:
@@ -285,7 +306,7 @@ allOf:
         compatible:
           const: mediatek,mt7988-switch
     then:
-      $ref: "#/$defs/mt7530-dsa-port"
+      $ref: "#/$defs/mt7988-dsa-port"
       properties:
         gpio-controller: false
         mediatek,mcm: false
Signature · 1 line
2.37.2
#3 lore raw

PATCH v2 4/7 dt-bindings: net: dsa: mediatek,mt7530: allow delayed rgmii phy-modes

In reply to [email protected]

From: Arınç ÜNAL <[email protected]>

According to mt7530_mac_port_get_caps() and mt7531_mac_port_get_caps(), all rgmii phy-modes on port 5 are supported. Add the remaining to mt7530-dsa-ports and mt7531-dsa-ports definitions.

---
 .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml        | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +6 -0
index 922865a2aabf..79ddd16e530b 100644
@@ -188,6 +188,9 @@ $defs:
                       - gmii
                       - mii
                       - rgmii
+                      - rgmii-id
+                      - rgmii-rxid
+                      - rgmii-txid
               else:
                 properties:
                   phy-mode:
@@ -226,6 +229,9 @@ $defs:
                       - 1000base-x
                       - 2500base-x
                       - rgmii
+                      - rgmii-id
+                      - rgmii-rxid
+                      - rgmii-txid
                       - sgmii
               else:
                 properties:
Signature · 1 line
2.37.2
#4 lore raw

PATCH v2 5/7 dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

In reply to [email protected]

From: Arınç ÜNAL <[email protected]>

The resets and reset-names properties are used only if mediatek,mcm is used. Set them to false if mediatek,mcm is not used.

Remove now unnecessary 'reset-names: false' from MT7988.

---
 .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +4 -1
index 79ddd16e530b..b5db0f50aa59 100644
@@ -274,6 +274,10 @@ allOf:
       required:
         - resets
         - reset-names
+    else:
+      properties:
+        resets: false
+        reset-names: false
 
   - dependencies:
       interrupt-controller: [ interrupts ]
@@ -316,7 +320,6 @@ allOf:
       properties:
         gpio-controller: false
         mediatek,mcm: false
-        reset-names: false
 
 unevaluatedProperties: false
 
Signature · 1 line
2.37.2
#5 lore raw

PATCH v2 6/7 dt-bindings: net: dsa: mediatek,mt7530: disallow core-supply and io-supply

In reply to [email protected]

From: Arınç ÜNAL <[email protected]>

The core-supply and io-supply properties are used only on hardware that uses the mediatek,mt7530 compatible string. Set them to false if the compatible string is not mediatek,mt7530.

---
 .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml          | 4 ++++
 1 file changed, 4 insertions(+)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +4 -0
index b5db0f50aa59..3b85063d5b5a 100644
@@ -291,6 +291,10 @@ allOf:
       required:
         - core-supply
         - io-supply
+    else:
+      properties:
+        core-supply: false
+        io-supply: false
 
   - if:
       properties:
Signature · 1 line
2.37.2
#6 lore raw

PATCH v2 7/7 dt-bindings: net: dsa: mediatek,mt7530: allow mediatek,mcm on MT7531

In reply to [email protected]

From: Arınç ÜNAL <[email protected]>

Allow mediatek,mcm on MT7531. There's code specific to MT7531 that checks if the switch is part of an MCM.

---
 Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 1 -
 1 file changed, 1 deletion(-)
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml +0 -1
index 3b85063d5b5a..71ae431c61d1 100644
@@ -304,7 +304,6 @@ allOf:
       $ref: "#/$defs/mt7531-dsa-port"
       properties:
         gpio-controller: false
-        mediatek,mcm: false
 
   - if:
       properties:
Signature · 1 line
2.37.2
maintainer
#7 lore raw
In reply to [email protected]

Hi Arınç,

Quoted 8 lines · On Fri, Apr 07, 2023 at 03:50:03PM +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

The brand name is MediaTek, change it to that.

---

It is good practice for series larger than 2 patches to create a cover letter, which gives the overview for the changes. Its contents gets used as the merge commit description when the series is accepted.

#8 lore raw
Quoted 7 lines · Vladimir Oltean

Hi Arınç,

Quoted 4 lines · On Fri, Apr 07, 2023 at 03:50:03PM +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

The brand name is MediaTek, change it to that.

Quoted 8 lines
Quoted 4 lines

---

It is good practice for series larger than 2 patches to create a cover letter, which gives the overview for the changes. Its contents gets used as the merge commit description when the series is accepted.

Ok, will do on the next version. I'll also split the schema while at it.

Arınç

maintainer
#9 lore raw
Quoted 13 lines · Arınç ÜNAL
Quoted 12 lines · Vladimir Oltean

Hi Arınç,

Quoted 8 lines · On Fri, Apr 07, 2023 at 03:50:03PM +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

The brand name is MediaTek, change it to that.

---

Quoted 5 lines
Quoted 3 lines

It is good practice for series larger than 2 patches to create a cover letter, which gives the overview for the changes. Its contents gets used as the merge commit description when the series is accepted.

Ok, will do on the next version. I'll also split the schema while at it.

Ok. I wasn't sure if you and Krzysztof were in agreement about that, so this is why I didn't mention it. FWIW, it's also pretty unreviewable to me too.

#10 lore raw
Quoted 18 lines · Vladimir Oltean
Quoted 17 lines · Arınç ÜNAL
Quoted 15 lines · Vladimir Oltean

Hi Arınç,

Quoted 8 lines · On Fri, Apr 07, 2023 at 03:50:03PM +0300, [email protected] wrote:

From: Arınç ÜNAL <[email protected]>

The brand name is MediaTek, change it to that.

---

It is good practice for series larger than 2 patches to create a cover letter, which gives the overview for the changes. Its contents gets used as the merge commit description when the series is accepted.

Quoted 5 lines
Quoted 1 line

Ok, will do on the next version. I'll also split the schema while at it.

Ok. I wasn't sure if you and Krzysztof were in agreement about that, so this is why I didn't mention it. FWIW, it's also pretty unreviewable to me too.

I already agreed but was planning to do that later. I prefer to divide things into smaller parts so I improve progressively without being overwhelmed. My RFC series for this driver along with this series are growing which has become a bit overwhelming but I'll manage.

Arınç