Skip to contentSkip to conversation

dt-bindings: arm: mediatek: convert ethsys controller to the json-schema

PATCH Superseded Rafał Miłecki 2 participants 2 messages Nov 17, 2023 – Nov 19, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: arm: mediatek: convert ethsys controller to the json-schema

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

This helps validating DTS files. The only introduced change was fixing "reg" value in example (1 address cell + 1 size cell).

---
For the record I was trying to simplify "compatible" syntax with following but "oneOf" apparently can't be used as a single item.

items:
- oneOf:
- const: mediatek,mt2701-ethsys
- const: mediatek,mt7622-ethsys
- items:
- const: mediatek,mt7623-ethsys
- const: mediatek,mt2701-ethsys
- const: mediatek,mt7629-ethsys
- const: mediatek,mt7981-ethsys
- const: mediatek,mt7986-ethsys
- const: syscon

 .../bindings/arm/mediatek/mediatek,ethsys.txt | 29 ----------
 .../arm/mediatek/mediatek,ethsys.yaml         | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.yaml
Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt deleted +0 -29
deleted file mode 100644
index eccd4b706a78..000000000000
@@ -1,29 +0,0 @@
-Mediatek ethsys controller
-============================
-
-The Mediatek ethsys controller provides various clocks to the system.
-
-Required Properties:
-
-- compatible: Should be:
-	- "mediatek,mt2701-ethsys", "syscon"
-	- "mediatek,mt7622-ethsys", "syscon"
-	- "mediatek,mt7623-ethsys", "mediatek,mt2701-ethsys", "syscon"
-	- "mediatek,mt7629-ethsys", "syscon"
-	- "mediatek,mt7981-ethsys", "syscon"
-	- "mediatek,mt7986-ethsys", "syscon"
-- #clock-cells: Must be 1
-- #reset-cells: Must be 1
-
-The ethsys 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:
-
-ethsys: clock-controller@1b000000 {
-	compatible = "mediatek,mt2701-ethsys", "syscon";
-	reg = <0 0x1b000000 0 0x1000>;
-	#clock-cells = <1>;
-	#reset-cells = <1>;
-};
Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.yaml new file +54 -0

54 lines not on this page · raw message

Signature · 1 line
2.35.3
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Rafał Miłecki

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

This helps validating DTS files. The only introduced change was fixing "reg" value in example (1 address cell + 1 size cell).

---
For the record I was trying to simplify "compatible" syntax with following but "oneOf" apparently can't be used as a single item.

Quoted 11 lines

items:
- oneOf:
- const: mediatek,mt2701-ethsys
- const: mediatek,mt7622-ethsys
- items:
- const: mediatek,mt7623-ethsys
- const: mediatek,mt2701-ethsys
- const: mediatek,mt7629-ethsys
- const: mediatek,mt7981-ethsys
- const: mediatek,mt7986-ethsys
- const: syscon

The problem is you have nested 'items' which forms a matrix.

You generally need a 'oneOf' for each possible length of an array unless the value of each index is always the same (i.e. only the size of the list varies).

Quoted 6 lines
 .../bindings/arm/mediatek/mediatek,ethsys.txt | 29 ----------
 .../arm/mediatek/mediatek,ethsys.yaml         | 54 +++++++++++++++++++
 2 files changed, 54 insertions(+), 29 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.txt
 create mode 100644 Documentation/devicetree/bindings/arm/mediatek/mediatek,ethsys.yaml

Can you move this to bindings/clock/

With that,