2023-04-06 08:02:55

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index e532c6b795f4..6df995478275 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -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]>
--
2.37.2


2023-04-06 08:03:21

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
.../bindings/net/dsa/mediatek,mt7530.yaml | 25 ++++++++++---------
1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 6df995478275..7045a98d9593 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -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.
--
2.37.2

2023-04-06 08:03:29

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
.../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
1 file changed, 46 insertions(+), 17 deletions(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 7045a98d9593..605888ce2bc6 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -160,22 +160,6 @@ 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 +170,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 +208,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 +243,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 +314,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
--
2.37.2

2023-04-06 08:03:49

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 4/7] dt-bindings: net: dsa: mediatek,mt7530: allow delayed rgmii phy-modes

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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
.../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 605888ce2bc6..9d99f7303453 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -196,6 +196,9 @@ $defs:
- gmii
- mii
- rgmii
+ - rgmii-id
+ - rgmii-rxid
+ - rgmii-txid
else:
properties:
phy-mode:
@@ -234,6 +237,9 @@ $defs:
- 1000base-x
- 2500base-x
- rgmii
+ - rgmii-id
+ - rgmii-rxid
+ - rgmii-txid
- sgmii
else:
properties:
--
2.37.2

2023-04-06 08:04:52

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 5/7] dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
.../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 9d99f7303453..3fd953b1453e 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -282,6 +282,10 @@ allOf:
required:
- resets
- reset-names
+ else:
+ properties:
+ resets: false
+ reset-names: false

- dependencies:
interrupt-controller: [ interrupts ]
@@ -324,7 +328,6 @@ allOf:
properties:
gpio-controller: false
mediatek,mcm: false
- reset-names: false

unevaluatedProperties: false

--
2.37.2

2023-04-06 08:05:22

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 7/7] dt-bindings: net: dsa: mediatek,mt7530: allow mediatek,mcm on MT7531

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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 1 -
1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 0095b7fcef72..b1dc1600f0dc 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -312,7 +312,6 @@ allOf:
$ref: "#/$defs/mt7531-dsa-port"
properties:
gpio-controller: false
- mediatek,mcm: false

- if:
properties:
--
2.37.2

2023-04-06 08:05:30

by Arınç ÜNAL

[permalink] [raw]
Subject: [PATCH 6/7] dt-bindings: net: dsa: mediatek,mt7530: disallow core-supply and io-supply

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.

Signed-off-by: Arınç ÜNAL <[email protected]>
---
.../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
index 3fd953b1453e..0095b7fcef72 100644
--- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
+++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
@@ -299,6 +299,10 @@ allOf:
required:
- core-supply
- io-supply
+ else:
+ properties:
+ core-supply: false
+ io-supply: false

- if:
properties:
--
2.37.2

2023-04-06 09:57:34

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 1/7] dt-bindings: net: dsa: mediatek,mt7530: correct brand name

On Thu, Apr 06, 2023 at 11:01:35AM +0300, [email protected] wrote:
> From: Arınç ÜNAL <[email protected]>
>
> The brand name is MediaTek, change it to that.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index e532c6b795f4..6df995478275 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -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]>
> --
> 2.37.2
>

2023-04-06 09:57:39

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On Thu, Apr 06, 2023 at 11:01:37AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
> 1 file changed, 46 insertions(+), 17 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 7045a98d9593..605888ce2bc6 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -160,22 +160,6 @@ 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 +170,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 +208,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 +243,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 +314,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
> --
> 2.37.2
>

2023-04-06 09:58:02

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 4/7] dt-bindings: net: dsa: mediatek,mt7530: allow delayed rgmii phy-modes

On Thu, Apr 06, 2023 at 11:01:38AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 605888ce2bc6..9d99f7303453 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -196,6 +196,9 @@ $defs:
> - gmii
> - mii
> - rgmii
> + - rgmii-id
> + - rgmii-rxid
> + - rgmii-txid
> else:
> properties:
> phy-mode:
> @@ -234,6 +237,9 @@ $defs:
> - 1000base-x
> - 2500base-x
> - rgmii
> + - rgmii-id
> + - rgmii-rxid
> + - rgmii-txid
> - sgmii
> else:
> properties:
> --
> 2.37.2
>

2023-04-06 09:58:14

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 5/7] dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

On Thu, Apr 06, 2023 at 11:01:39AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 9d99f7303453..3fd953b1453e 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -282,6 +282,10 @@ allOf:
> required:
> - resets
> - reset-names
> + else:
> + properties:
> + resets: false
> + reset-names: false
>
> - dependencies:
> interrupt-controller: [ interrupts ]
> @@ -324,7 +328,6 @@ allOf:
> properties:
> gpio-controller: false
> mediatek,mcm: false
> - reset-names: false
>
> unevaluatedProperties: false
>
> --
> 2.37.2
>

2023-04-06 09:59:00

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 7/7] dt-bindings: net: dsa: mediatek,mt7530: allow mediatek,mcm on MT7531

On Thu, Apr 06, 2023 at 11:01:41AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 0095b7fcef72..b1dc1600f0dc 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -312,7 +312,6 @@ allOf:
> $ref: "#/$defs/mt7531-dsa-port"
> properties:
> gpio-controller: false
> - mediatek,mcm: false
>
> - if:
> properties:
> --
> 2.37.2
>

2023-04-06 09:59:25

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 2/7] dt-bindings: net: dsa: mediatek,mt7530: improve MCM and MT7988 information

On Thu, Apr 06, 2023 at 11:01:36AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> .../bindings/net/dsa/mediatek,mt7530.yaml | 25 ++++++++++---------
> 1 file changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 6df995478275..7045a98d9593 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -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.
> --
> 2.37.2
>

2023-04-06 09:59:48

by Daniel Golle

[permalink] [raw]
Subject: Re: [PATCH 6/7] dt-bindings: net: dsa: mediatek,mt7530: disallow core-supply and io-supply

On Thu, Apr 06, 2023 at 11:01:40AM +0300, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>

Acked-by: Daniel Golle <[email protected]>

> ---
> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 3fd953b1453e..0095b7fcef72 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -299,6 +299,10 @@ allOf:
> required:
> - core-supply
> - io-supply
> + else:
> + properties:
> + core-supply: false
> + io-supply: false
>
> - if:
> properties:
> --
> 2.37.2
>

2023-04-06 19:03:09

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 1/7] dt-bindings: net: dsa: mediatek,mt7530: correct brand name

On 06/04/2023 10:01, [email protected] wrote:
> From: Arınç ÜNAL <[email protected]>
>
> The brand name is MediaTek, change it to that.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>
> ---
> Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 2 +-


Acked-by: Krzysztof Kozlowski <[email protected]>

although maybe this would be a lot of churn if done per-file.

Best regards,
Krzysztof

2023-04-06 19:03:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/7] dt-bindings: net: dsa: mediatek,mt7530: improve MCM and MT7988 information

On 06/04/2023 10:01, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>
> ---


Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2023-04-06 19:09:06

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 06/04/2023 10:01, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>
> ---
> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
> 1 file changed, 46 insertions(+), 17 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 7045a98d9593..605888ce2bc6 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -160,22 +160,6 @@ 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
> -

I have doubts that the binding is still maintainable/reviewable. First,
why do you need all above patterns after removal of entire contents?

Second, amount of if-then-if-then located in existing blocks (not
top-level) is quite big. I counted if-then-using defs, where defs has
patternProps-patternProps-if-then-if-then-properties.... OMG. :)

Best regards,
Krzysztof

2023-04-06 19:09:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 5/7] dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

On 06/04/2023 10:01, [email protected] wrote:
> 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.
>
> Signed-off-by: Arınç ÜNAL <[email protected]>
> ---
> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> index 9d99f7303453..3fd953b1453e 100644
> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
> @@ -282,6 +282,10 @@ allOf:
> required:
> - resets
> - reset-names
> + else:
> + properties:
> + resets: false
> + reset-names: false
>
> - dependencies:
> interrupt-controller: [ interrupts ]
> @@ -324,7 +328,6 @@ allOf:
> properties:
> gpio-controller: false
> mediatek,mcm: false
> - reset-names: false

I don't see such hunk in linux-next.


Best regards,
Krzysztof

2023-04-06 19:26:06

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
> On 06/04/2023 10:01, [email protected] wrote:
>> 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.
>>
>> Signed-off-by: Arınç ÜNAL <[email protected]>
>> ---
>> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
>> 1 file changed, 46 insertions(+), 17 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> index 7045a98d9593..605888ce2bc6 100644
>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> @@ -160,22 +160,6 @@ 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
>> -
>
> I have doubts that the binding is still maintainable/reviewable. First,
> why do you need all above patterns after removal of entire contents?

The 'type: object' item is still globally used. I'd have to define that
on each definitions, I suppose?

>
> Second, amount of if-then-if-then located in existing blocks (not
> top-level) is quite big. I counted if-then-using defs, where defs has
> patternProps-patternProps-if-then-if-then-properties.... OMG. :)

Yup, not much to do if we want to keep the information. I'm still
maintaining this though. ¯\_(ツ)_/¯

Arınç

2023-04-06 19:26:54

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH 5/7] dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

On 6.04.2023 22:08, Krzysztof Kozlowski wrote:
> On 06/04/2023 10:01, [email protected] wrote:
>> 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.
>>
>> Signed-off-by: Arınç ÜNAL <[email protected]>
>> ---
>> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 ++++-
>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> index 9d99f7303453..3fd953b1453e 100644
>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>> @@ -282,6 +282,10 @@ allOf:
>> required:
>> - resets
>> - reset-names
>> + else:
>> + properties:
>> + resets: false
>> + reset-names: false
>>
>> - dependencies:
>> interrupt-controller: [ interrupts ]
>> @@ -324,7 +328,6 @@ allOf:
>> properties:
>> gpio-controller: false
>> mediatek,mcm: false
>> - reset-names: false
>
> I don't see such hunk in linux-next.

This was added very recently so it's only on net-next at the moment.

Arınç

2023-04-06 19:28:48

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH 1/7] dt-bindings: net: dsa: mediatek,mt7530: correct brand name

On 6.04.2023 22:00, Krzysztof Kozlowski wrote:
> On 06/04/2023 10:01, [email protected] wrote:
>> From: Arınç ÜNAL <[email protected]>
>>
>> The brand name is MediaTek, change it to that.
>>
>> Signed-off-by: Arınç ÜNAL <[email protected]>
>> ---
>> Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 2 +-
>
>
> Acked-by: Krzysztof Kozlowski <[email protected]>
>
> although maybe this would be a lot of churn if done per-file.

I don't intend to. There's only this schema of MediaTek for DSA, and I
happen to maintain it. Maybe I can do a treewide change for other
schemas in the future.

Arınç

2023-04-07 09:23:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 5/7] dt-bindings: net: dsa: mediatek,mt7530: disallow reset without mediatek,mcm

On 06/04/2023 21:19, Arınç ÜNAL wrote:
> On 6.04.2023 22:08, Krzysztof Kozlowski wrote:
>> On 06/04/2023 10:01, [email protected] wrote:
>>> 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.
>>>
>>> Signed-off-by: Arınç ÜNAL <[email protected]>
>>> ---
>>> .../devicetree/bindings/net/dsa/mediatek,mt7530.yaml | 5 ++++-
>>> 1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> index 9d99f7303453..3fd953b1453e 100644
>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> @@ -282,6 +282,10 @@ allOf:
>>> required:
>>> - resets
>>> - reset-names
>>> + else:
>>> + properties:
>>> + resets: false
>>> + reset-names: false
>>>
>>> - dependencies:
>>> interrupt-controller: [ interrupts ]
>>> @@ -324,7 +328,6 @@ allOf:
>>> properties:
>>> gpio-controller: false
>>> mediatek,mcm: false
>>> - reset-names: false
>>
>> I don't see such hunk in linux-next.
>
> This was added very recently so it's only on net-next at the moment.

OK, I was checking one few days old.

Acked-by: Krzysztof Kozlowski <[email protected]>

Best regards,
Krzysztof

2023-04-07 09:23:26

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 06/04/2023 21:18, Arınç ÜNAL wrote:
> On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
>> On 06/04/2023 10:01, [email protected] wrote:
>>> 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.
>>>
>>> Signed-off-by: Arınç ÜNAL <[email protected]>
>>> ---
>>> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
>>> 1 file changed, 46 insertions(+), 17 deletions(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> index 7045a98d9593..605888ce2bc6 100644
>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>> @@ -160,22 +160,6 @@ 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
>>> -
>>
>> I have doubts that the binding is still maintainable/reviewable. First,
>> why do you need all above patterns after removal of entire contents?
>
> The 'type: object' item is still globally used. I'd have to define that
> on each definitions, I suppose?

Doesn't it come from dsa.yaml/dsa-port.yaml schema?

>
>>
>> Second, amount of if-then-if-then located in existing blocks (not
>> top-level) is quite big. I counted if-then-using defs, where defs has
>> patternProps-patternProps-if-then-if-then-properties.... OMG. :)
>
> Yup, not much to do if we want to keep the information. I'm still
> maintaining this though. ¯\_(ツ)_/¯

Maybe it should be split into few bindings sharing common part.

Best regards,
Krzysztof

2023-04-07 09:58:33

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 7.04.2023 12:07, Krzysztof Kozlowski wrote:
> On 06/04/2023 21:18, Arınç ÜNAL wrote:
>> On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
>>> On 06/04/2023 10:01, [email protected] wrote:
>>>> 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.
>>>>
>>>> Signed-off-by: Arınç ÜNAL <[email protected]>
>>>> ---
>>>> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
>>>> 1 file changed, 46 insertions(+), 17 deletions(-)
>>>>
>>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>> index 7045a98d9593..605888ce2bc6 100644
>>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>> @@ -160,22 +160,6 @@ 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
>>>> -
>>>
>>> I have doubts that the binding is still maintainable/reviewable. First,
>>> why do you need all above patterns after removal of entire contents?
>>
>> The 'type: object' item is still globally used. I'd have to define that
>> on each definitions, I suppose?
>
> Doesn't it come from dsa.yaml/dsa-port.yaml schema?

It comes from dsa.yaml#/$defs/ethernet-ports which this schema already
refers to. I'll remove the patterns above.

Though 'type: object' is not there for "^(ethernet-)?port@[0-9]+$". I
think I should add it there as the dsa-port.yaml schema defines the
properties of the DSA switch port object. So the value matching the
"^(ethernet-)?port@[0-9]+$" regular expression is expected to be an
object conforming to the structure defined in dsa-port.yaml.

Does that make sense?

>
>>
>>>
>>> Second, amount of if-then-if-then located in existing blocks (not
>>> top-level) is quite big. I counted if-then-using defs, where defs has
>>> patternProps-patternProps-if-then-if-then-properties.... OMG. :)
>>
>> Yup, not much to do if we want to keep the information. I'm still
>> maintaining this though. ¯\_(ツ)_/¯
>
> Maybe it should be split into few bindings sharing common part.

Agreed, I think it makes sense to split this to MT7530, MT7531, and
MT7988. I will do this after this series.

Arınç

2023-04-12 16:45:13

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 07/04/2023 11:46, Arınç ÜNAL wrote:
> On 7.04.2023 12:07, Krzysztof Kozlowski wrote:
>> On 06/04/2023 21:18, Arınç ÜNAL wrote:
>>> On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
>>>> On 06/04/2023 10:01, [email protected] wrote:
>>>>> 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.
>>>>>
>>>>> Signed-off-by: Arınç ÜNAL <[email protected]>
>>>>> ---
>>>>> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
>>>>> 1 file changed, 46 insertions(+), 17 deletions(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>> index 7045a98d9593..605888ce2bc6 100644
>>>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>> @@ -160,22 +160,6 @@ 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
>>>>> -
>>>>
>>>> I have doubts that the binding is still maintainable/reviewable. First,
>>>> why do you need all above patterns after removal of entire contents?
>>>
>>> The 'type: object' item is still globally used. I'd have to define that
>>> on each definitions, I suppose?
>>
>> Doesn't it come from dsa.yaml/dsa-port.yaml schema?
>
> It comes from dsa.yaml#/$defs/ethernet-ports which this schema already
> refers to. I'll remove the patterns above.
>
> Though 'type: object' is not there for "^(ethernet-)?port@[0-9]+$". I
> think I should add it there as the dsa-port.yaml schema defines the
> properties of the DSA switch port object.

It has ref, which is enough.

> So the value matching the
> "^(ethernet-)?port@[0-9]+$" regular expression is expected to be an
> object conforming to the structure defined in dsa-port.yaml.
>
> Does that make sense?

Hm, no, sorry, I still do not see what exactly is missing from
dsa.yaml/port that you need to define here.


Best regards,
Krzysztof

2023-04-12 17:55:36

by Arınç ÜNAL

[permalink] [raw]
Subject: Re: [PATCH 3/7] dt-bindings: net: dsa: mediatek,mt7530: add port bindings for MT7988

On 12.04.2023 19:39, Krzysztof Kozlowski wrote:
> On 07/04/2023 11:46, Arınç ÜNAL wrote:
>> On 7.04.2023 12:07, Krzysztof Kozlowski wrote:
>>> On 06/04/2023 21:18, Arınç ÜNAL wrote:
>>>> On 6.04.2023 22:07, Krzysztof Kozlowski wrote:
>>>>> On 06/04/2023 10:01, [email protected] wrote:
>>>>>> 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.
>>>>>>
>>>>>> Signed-off-by: Arınç ÜNAL <[email protected]>
>>>>>> ---
>>>>>> .../bindings/net/dsa/mediatek,mt7530.yaml | 63 ++++++++++++++-----
>>>>>> 1 file changed, 46 insertions(+), 17 deletions(-)
>>>>>>
>>>>>> diff --git a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>>> index 7045a98d9593..605888ce2bc6 100644
>>>>>> --- a/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>>> +++ b/Documentation/devicetree/bindings/net/dsa/mediatek,mt7530.yaml
>>>>>> @@ -160,22 +160,6 @@ 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
>>>>>> -
>>>>>
>>>>> I have doubts that the binding is still maintainable/reviewable. First,
>>>>> why do you need all above patterns after removal of entire contents?
>>>>
>>>> The 'type: object' item is still globally used. I'd have to define that
>>>> on each definitions, I suppose?
>>>
>>> Doesn't it come from dsa.yaml/dsa-port.yaml schema?
>>
>> It comes from dsa.yaml#/$defs/ethernet-ports which this schema already
>> refers to. I'll remove the patterns above.
>>
>> Though 'type: object' is not there for "^(ethernet-)?port@[0-9]+$". I
>> think I should add it there as the dsa-port.yaml schema defines the
>> properties of the DSA switch port object.
>
> It has ref, which is enough.
>
>> So the value matching the
>> "^(ethernet-)?port@[0-9]+$" regular expression is expected to be an
>> object conforming to the structure defined in dsa-port.yaml.
>>
>> Does that make sense?
>
> Hm, no, sorry, I still do not see what exactly is missing from
> dsa.yaml/port that you need to define here.

Nothing, I forgot defining either ref or type is enough.

Arınç