Skip to contentSkip to conversation

dt-bindings: arm: mediatek: convert MT7622-related bindings to the json-schema

PATCH In review Rafał Miłecki 3 participants 9 messages Jan 23, 2024 – Jan 31, 2024

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

cover dt-bindings: arm: mediatek: convert MT7622-related bindings to the json-schema

From: Rafał Miłecki <[email protected]>

There are more MediaTek bindings to convert but for now I focused on those used by MT7622.

Rafał Miłecki (3):
dt-bindings: arm: mediatek: convert hifsys to the json-schema
dt-bindings: arm: mediatek: convert PCIESYS to the json-schema
dt-bindings: arm: mediatek: convert SSUSBSYS to the json-schema

 .../bindings/arm/mediatek/mediatek,hifsys.txt | 26 ---------
 .../arm/mediatek/mediatek,mt2701-hifsys.yaml  | 54 +++++++++++++++++++
 .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 ++++++++++++++++
 .../mediatek/mediatek,mt7622-ssusbsys.yaml    | 47 ++++++++++++++++
 .../arm/mediatek/mediatek,pciesys.txt         | 25 ---------
 .../arm/mediatek/mediatek,ssusbsys.txt        | 25 ---------
 6 files changed, 148 insertions(+), 76 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-ssusbsys.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt
Signature · 1 line
2.35.3
#1 lore raw

PATCH 1/3 dt-bindings: arm: mediatek: convert hifsys to the json-schema

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Documented "#reset-cells" property
3. Adjusted "reg" in example

---
 .../bindings/arm/mediatek/mediatek,hifsys.txt | 26 ---------
 .../arm/mediatek/mediatek,mt2701-hifsys.yaml  | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt deleted +0 -26
deleted file mode 100644
index 323905af82c3..000000000000
@@ -1,26 +0,0 @@
-Mediatek hifsys controller
-============================
-
-The Mediatek hifsys controller provides various clocks and reset
-outputs to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt2701-hifsys", "syscon"
-	- "mediatek,mt7622-hifsys", "syscon"
-	- "mediatek,mt7623-hifsys", "mediatek,mt2701-hifsys", "syscon"
-- #clock-cells: Must be 1
-
-The hifsys controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-hifsys: clock-controller@1a000000 {
-	compatible = "mediatek,mt2701-hifsys", "syscon";
-	reg = <0 0x1a000000 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.35.3
maintainer
#2 lore raw

Re: [PATCH 1/3] dt-bindings: arm: mediatek: convert hifsys to the json-schema

Quoted 11 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Documented "#reset-cells" property
3. Adjusted "reg" in example

---
 .../bindings/arm/mediatek/mediatek,hifsys.txt | 26 ---------
 .../arm/mediatek/mediatek,mt2701-hifsys.yaml  | 54 +++++++++++++++++++

Like the other one, please move this.

Quoted 61 lines
 2 files changed, 54 insertions(+), 26 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,hifsys.txt deleted +0 -26
deleted file mode 100644
index 323905af82c3..000000000000
@@ -1,26 +0,0 @@
-Mediatek hifsys controller
-============================
-
-The Mediatek hifsys controller provides various clocks and reset
-outputs to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt2701-hifsys", "syscon"
-	- "mediatek,mt7622-hifsys", "syscon"
-	- "mediatek,mt7623-hifsys", "mediatek,mt2701-hifsys", "syscon"
-- #clock-cells: Must be 1
-
-The hifsys controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-hifsys: clock-controller@1a000000 {
-	compatible = "mediatek,mt2701-hifsys", "syscon";
-	reg = <0 0x1a000000 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml new file +19 -0
new file mode 100644
index 000000000000..7c7b7b7b1142
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt2701-hifsys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Mediatek hifsys controller
+
+description:
+  The Mediatek hifsys controller provides various clocks and reset outputs to
+  the system.
+
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml line 29

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml new file +10 -0
+          - const: mediatek,mt2701-hifsys
+          - const: syscon
+      - items:
+          - enum:
+              - mediatek,mt7623-hifsys
+          - const: mediatek,mt2701-hifsys
+          - const: syscon
+      - items:
+          - const: mediatek,mt7622-hifsys
+          - const: syscon

The 1st and 3rd entries can be combined.

Quoted 28 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt2701-hifsys.yaml new file +25 -0
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+    description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - reg
+  - "#clock-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    clock-controller@1a000000 {
+        compatible = "mediatek,mt2701-hifsys", "syscon";
+        reg = <0x1a000000 0x1000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
Signature · 1 line
2.35.3
#3 lore raw

PATCH 2/3 dt-bindings: arm: mediatek: convert PCIESYS to the json-schema

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
 .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 +++++++++++++++++++
 .../arm/mediatek/mediatek,pciesys.txt         | 25 ----------
 2 files changed, 47 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +47 -0
new file mode 100644
index 000000000000..7340a2512402
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pciesys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek PCIESYS controller
+
+description:
+  The MediaTek PCIESYS controller provides various clocks to the system.
+
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-pciesys
+          - mediatek,mt7629-pciesys
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+    description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    pciesys@1a100800 {
+        compatible = "mediatek,mt7622-pciesys", "syscon";
+        reg = <0x1a100800 0x1000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt deleted +0 -25
deleted file mode 100644
index d179a61536f4..000000000000
@@ -1,25 +0,0 @@
-MediaTek PCIESYS controller
-============================
-
-The MediaTek PCIESYS controller provides various clocks to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt7622-pciesys", "syscon"
-	- "mediatek,mt7629-pciesys", "syscon"
-- #clock-cells: Must be 1
-- #reset-cells: Must be 1
-
-The PCIESYS controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-pciesys: pciesys@1a100800 {
-	compatible = "mediatek,mt7622-pciesys", "syscon";
-	reg = <0 0x1a100800 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
Signature · 1 line
2.35.3
#4 lore raw

Re: [PATCH 2/3] dt-bindings: arm: mediatek: convert PCIESYS to the json-schema

Il 23/01/24 09:20, Rafał Miłecki ha scritto:

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml

Quoted 19 lines

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
  .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 +++++++++++++++++++
  .../arm/mediatek/mediatek,pciesys.txt         | 25 ----------
  2 files changed, 47 insertions(+), 25 deletions(-)

create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +0 -0
new file mode 100644
index 000000000000..7340a2512402

I think that we should really move all those clock controller yaml files to their proper directory, which would be

Documentation/devicetree/bindings/clock/

...because those are clock controllers anyway and the fact that they do also provide a reset controller doesn't really justify having them in arm/mediatek.

Besides, I would appreciate if you could also move mt8186/92/95 and eventual others that are there to clock/.

Quoted 12 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +11 -0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pciesys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek PCIESYS controller
+
+description:
+  The MediaTek PCIESYS controller provides various clocks to the system.
+

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +10 -0
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-pciesys
+          - mediatek,mt7629-pciesys
+      - const: syscon

I know that there's syscon all over the place and, even if I admit I didn't check, I am fairly sure that there's absolutely no reason to have syscon there, and that the syscon compatible never did anything for (most of, or all of) those clock controllers, at all.

I'm not sure - though - if removing syscon during the txt->yaml conversion is acceptable (yeah we'd be cheating a bit), but something makes me say it is, because the bindings couldn't validate before that one as well.

Of course you'd have to remove the syscon compatible from the affected device trees as well as omitting it here.

However, to be sure that we're doing the right thing here, I have to summon someone that can actually give a definitive answer to what I just said.....

Krzysztof, please? :-)

Quoted 11 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +11 -0
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+    description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
+
+  "#reset-cells":
+    const: 1
+

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml line 42

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +10 -0
+required:
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    pciesys@1a100800 {

This is a clock controller, so it is clock-controller@1a100800

Quoted 36 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +5 -0
+        compatible = "mediatek,mt7622-pciesys", "syscon";
+        reg = <0x1a100800 0x1000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt deleted +0 -25
deleted file mode 100644
index d179a61536f4..000000000000
@@ -1,25 +0,0 @@
-MediaTek PCIESYS controller
-============================
-
-The MediaTek PCIESYS controller provides various clocks to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt7622-pciesys", "syscon"
-	- "mediatek,mt7629-pciesys", "syscon"
-- #clock-cells: Must be 1
-- #reset-cells: Must be 1
-
-The PCIESYS controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-pciesys: pciesys@1a100800 {
-	compatible = "mediatek,mt7622-pciesys", "syscon";
-	reg = <0 0x1a100800 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
maintainer
#5 lore raw

Re: [PATCH 2/3] dt-bindings: arm: mediatek: convert PCIESYS to the json-schema

Quoted 24 lines · AngeloGioacchino Del Regno

Il 23/01/24 09:20, Rafał Miłecki ha scritto:

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml

Quoted 19 lines

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
  .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 +++++++++++++++++++
  .../arm/mediatek/mediatek,pciesys.txt         | 25 ----------
  2 files changed, 47 insertions(+), 25 deletions(-)

create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +0 -0
new file mode 100644
index 000000000000..7340a2512402

I think that we should really move all those clock controller yaml files to their proper directory, which would be

Quoted 7 lines

Documentation/devicetree/bindings/clock/

...because those are clock controllers anyway and the fact that they do also provide a reset controller doesn't really justify having them in arm/mediatek.

Besides, I would appreciate if you could also move mt8186/92/95 and eventual others that are there to clock/.

Yes, please move it.

Quoted 29 lines
Quoted 13 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +11 -0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pciesys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek PCIESYS controller
+
+description:
+  The MediaTek PCIESYS controller provides various clocks to the system.
+

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +10 -0
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-pciesys
+          - mediatek,mt7629-pciesys
+      - const: syscon

I know that there's syscon all over the place and, even if I admit I didn't check, I am fairly sure that there's absolutely no reason to have syscon there, and that the syscon compatible never did anything for (most of, or all of) those clock controllers, at all.

Quoted 3 lines

I'm not sure - though - if removing syscon during the txt->yaml conversion is acceptable (yeah we'd be cheating a bit), but something makes me say it is, because the bindings couldn't validate before that one as well.

As long as you state why you are removing it in the commit msg.

Quoted 3 lines

Of course you'd have to remove the syscon compatible from the affected device trees as well as omitting it here.

You could also do 'minItems: 1' and 'deprecated' in the 2nd item.

Quoted 4 lines

However, to be sure that we're doing the right thing here, I have to summon someone that can actually give a definitive answer to what I just said.....

Krzysztof, please? :-)

#6 lore raw

Re: [PATCH 2/3] dt-bindings: arm: mediatek: convert PCIESYS to the json-schema

Quoted 68 lines · Rob Herring
Quoted 24 lines · AngeloGioacchino Del Regno

Il 23/01/24 09:20, Rafał Miłecki ha scritto:

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml

Quoted 19 lines

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
   .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 +++++++++++++++++++
   .../arm/mediatek/mediatek,pciesys.txt         | 25 ----------
   2 files changed, 47 insertions(+), 25 deletions(-)

create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +0 -0
new file mode 100644
index 000000000000..7340a2512402

I think that we should really move all those clock controller yaml files to their proper directory, which would be

Quoted 7 lines

Documentation/devicetree/bindings/clock/

...because those are clock controllers anyway and the fact that they do also provide a reset controller doesn't really justify having them in arm/mediatek.

Besides, I would appreciate if you could also move mt8186/92/95 and eventual others that are there to clock/.

Yes, please move it.

Quoted 29 lines
Quoted 13 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +11 -0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pciesys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek PCIESYS controller
+
+description:
+  The MediaTek PCIESYS controller provides various clocks to the system.
+

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +10 -0
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-pciesys
+          - mediatek,mt7629-pciesys
+      - const: syscon

I know that there's syscon all over the place and, even if I admit I didn't check, I am fairly sure that there's absolutely no reason to have syscon there, and that the syscon compatible never did anything for (most of, or all of) those clock controllers, at all.

Quoted 3 lines

I'm not sure - though - if removing syscon during the txt->yaml conversion is acceptable (yeah we'd be cheating a bit), but something makes me say it is, because the bindings couldn't validate before that one as well.

Quoted 7 lines

As long as you state why you are removing it in the commit msg.

Quoted 3 lines

Of course you'd have to remove the syscon compatible from the affected device trees as well as omitting it here.

You could also do 'minItems: 1' and 'deprecated' in the 2nd item.

I expected this to be quite straightforward but I can't get it to work.

Can you tell me if I'm making some mistake or is that some meta schema limitation?

properties:
compatible:
oneOf:
- minItems: 1
items:
- enum:
- mediatek,mt2701-hifsys
- mediatek,mt7622-hifsys
- const: syscon
deprecated: true
- minItems: 2
items:
- enum:
- mediatek,mt7623-hifsys
- const: mediatek,mt2701-hifsys
- const: syscon
deprecated: true

Gives me:

Documentation/devicetree/bindings/clock/mediatek,mt2701-hifsys.yaml: properties:compatible:oneOf:0:items: 'oneOf' conditional failed, one must be fixed:
[{'enum': ['mediatek,mt2701-hifsys', 'mediatek,mt7622-hifsys']}, {'const': 'syscon', 'deprecated': True}] is not of type 'object' Additional properties are not allowed ('deprecated' was unexpected)
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml#
Documentation/devicetree/bindings/clock/mediatek,mt2701-hifsys.yaml: properties:compatible:oneOf:1:items: 'oneOf' conditional failed, one must be fixed:
[{'enum': ['mediatek,mt7623-hifsys']}, {'const': 'mediatek,mt2701-hifsys'}, {'const': 'syscon', 'deprecated': True}] is not of type 'object' Additional properties are not allowed ('deprecated' was unexpected)
from schema $id: http://devicetree.org/meta-schemas/string-array.yaml#

#7 lore raw

Re: [PATCH 2/3] dt-bindings: arm: mediatek: convert PCIESYS to the json-schema

In reply to Rob Herring

Il 30/01/24 21:34, Rob Herring ha scritto:

Quoted 68 lines · AngeloGioacchino Del Regno
Quoted 24 lines

Il 23/01/24 09:20, Rafał Miłecki ha scritto:

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml

Quoted 19 lines

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
   .../arm/mediatek/mediatek,mt7622-pciesys.yaml | 47 +++++++++++++++++++
   .../arm/mediatek/mediatek,pciesys.txt         | 25 ----------
   2 files changed, 47 insertions(+), 25 deletions(-)

create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,pciesys.txt

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +0 -0
new file mode 100644
index 000000000000..7340a2512402

I think that we should really move all those clock controller yaml files to their proper directory, which would be

Quoted 7 lines

Documentation/devicetree/bindings/clock/

...because those are clock controllers anyway and the fact that they do also provide a reset controller doesn't really justify having them in arm/mediatek.

Besides, I would appreciate if you could also move mt8186/92/95 and eventual others that are there to clock/.

Yes, please move it.

Quoted 29 lines
Quoted 13 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +11 -0
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-pciesys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek PCIESYS controller
+
+description:
+  The MediaTek PCIESYS controller provides various clocks to the system.
+

Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml line 21

Quoted 10 lines
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-pciesys.yaml new file +10 -0
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-pciesys
+          - mediatek,mt7629-pciesys
+      - const: syscon

I know that there's syscon all over the place and, even if I admit I didn't check, I am fairly sure that there's absolutely no reason to have syscon there, and that the syscon compatible never did anything for (most of, or all of) those clock controllers, at all.

Quoted 3 lines

I'm not sure - though - if removing syscon during the txt->yaml conversion is acceptable (yeah we'd be cheating a bit), but something makes me say it is, because the bindings couldn't validate before that one as well.

Quoted 8 lines

As long as you state why you are removing it in the commit msg.

Quoted 3 lines

Of course you'd have to remove the syscon compatible from the affected device trees as well as omitting it here.

You could also do 'minItems: 1' and 'deprecated' in the 2nd item.

That too. Yes. But I still really want to see the syscon compatible removed from the device trees on those nodes because it doesn't make any sense to have it :-)

Quoted 4 lines
Quoted 4 lines

However, to be sure that we're doing the right thing here, I have to summon someone that can actually give a definitive answer to what I just said.....

Krzysztof, please? :-)

#8 lore raw

PATCH 3/3 dt-bindings: arm: mediatek: convert SSUSBSYS to the json-schema

In reply to Rafał Miłecki

From: Rafał Miłecki <[email protected]>

This helps validating DTS files. Introduced changes:
1. Documented "reg" property
2. Adjusted "reg" in example

---
 .../mediatek/mediatek,mt7622-ssusbsys.yaml    | 47 +++++++++++++++++++
 .../arm/mediatek/mediatek,ssusbsys.txt        | 25 ----------
 2 files changed, 47 insertions(+), 25 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-ssusbsys.yaml
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt
Documentation/devicetree/bindings/arm/mediatek/mediatek,mt7622-ssusbsys.yaml new file +47 -0
new file mode 100644
index 000000000000..7a5343e4fcf4
@@ -0,0 +1,47 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/arm/mediatek/mediatek,mt7622-ssusbsys.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: MediaTek SSUSBSYS controller
+
+description:
+  The MediaTek SSUSBSYS controller provides various clocks to the system.
+
+maintainers:
+  - Matthias Brugger <[email protected]>
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - mediatek,mt7622-ssusbsys
+          - mediatek,mt7629-ssusbsys
+      - const: syscon
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+    description: The available clocks are defined in dt-bindings/clock/mt*-clk.h
+
+  "#reset-cells":
+    const: 1
+
+required:
+  - reg
+  - "#clock-cells"
+  - "#reset-cells"
+
+additionalProperties: false
+
+examples:
+  - |
+    ssusbsys@1a000000 {
+        compatible = "mediatek,mt7622-ssusbsys", "syscon";
+        reg = <0x1a000000 0x1000>;
+        #clock-cells = <1>;
+        #reset-cells = <1>;
+    };
Documentation/devicetree/bindings/arm/mediatek/mediatek,ssusbsys.txt deleted +0 -25
deleted file mode 100644
index 7cb02c930613..000000000000
@@ -1,25 +0,0 @@
-MediaTek SSUSBSYS controller
-============================
-
-The MediaTek SSUSBSYS controller provides various clocks to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt7622-ssusbsys", "syscon"
-	- "mediatek,mt7629-ssusbsys", "syscon"
-- #clock-cells: Must be 1
-- #reset-cells: Must be 1
-
-The SSUSBSYS controller uses the common clk binding from
-Documentation/devicetree/bindings/clock/clock-bindings.txt
-The available clocks are defined in dt-bindings/clock/mt*-clk.h.
-
-Example:
-
-ssusbsys: ssusbsys@1a000000 {
-	compatible = "mediatek,mt7622-ssusbsys", "syscon";
-	reg = <0 0x1a000000 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
Signature · 1 line
2.35.3