Skip to contentSkip to conversation

dt-bindings: mfd: atmel,at91sam9260: Convert to json schema

PATCH Superseded Charan Pedumuru 2 participants 5 messages Dec 11, 2024 – Dec 17, 2024

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: mfd: atmel,at91sam9260: Convert to json schema

Convert old text based binding to json schema. Changes during conversion:
Add a fallback for all compatibles as the IP core is compatible with syscon.

---
 .../bindings/mfd/atmel,at91sam9260-matrix.yaml     | 54 ++++++++++++++++++++++
 .../devicetree/bindings/mfd/atmel-matrix.txt       | 26 -----------
 2 files changed, 54 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +54 -0
new file mode 100644
index 000000000000..0e827882823f
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/atmel,at91sam9260-matrix.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip AT91 Bus Matrix
+
+maintainers:
+  - Nicolas Ferre <[email protected]>
+
+description:
+  The Bus Matrix (MATRIX) implements a multi-layer AHB, based on the
+  AHB-Lite protocol, that enables parallel access paths between multiple
+  masters and slaves in a system, thus increasing the overall bandwidth.
+
+properties:
+  compatible:
+    anyOf:
+      - items:
+          - enum:
+              - atmel,at91sam9260-matrix
+              - atmel,at91sam9261-matrix
+              - atmel,at91sam9263-matrix
+              - atmel,at91sam9rl-matrix
+              - atmel,at91sam9g45-matrix
+              - atmel,at91sam9n12-matrix
+              - atmel,at91sam9x5-matrix
+              - atmel,sama5d3-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x60-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x7-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    matrix@ffffec00 {
+        compatible = "atmel,sama5d3-matrix", "syscon";
+        reg = <0xffffec00 0x200>;
+    };
Documentation/devicetree/bindings/mfd/atmel-matrix.txt deleted +0 -26
deleted file mode 100644
index 6e5f83614e83..000000000000
@@ -1,26 +0,0 @@
-* Device tree bindings for Atmel Bus Matrix
-
-The Bus Matrix registers are used to configure Atmel SoCs internal bus
-behavior (master/slave priorities, undefined burst length type, ...)
-
-Required properties:
-- compatible:		Should be one of the following
-			"atmel,at91sam9260-matrix", "syscon"
-			"atmel,at91sam9261-matrix", "syscon"
-			"atmel,at91sam9263-matrix", "syscon"
-			"atmel,at91sam9rl-matrix", "syscon"
-			"atmel,at91sam9g45-matrix", "syscon"
-			"atmel,at91sam9n12-matrix", "syscon"
-			"atmel,at91sam9x5-matrix", "syscon"
-			"atmel,sama5d3-matrix", "syscon"
-			"microchip,sam9x60-matrix", "syscon"
-			"microchip,sam9x7-matrix", "atmel,at91sam9x5-matrix", "syscon"
-- reg:			Contains offset/length value of the Bus Matrix
-			memory region.
-
-Example:
-
-matrix: matrix@ffffec00 {
-	compatible = "atmel,sama5d3-matrix", "syscon";
-	reg = <0xffffec00 0x200>;
-};

---
base-commit: 1b2ab8149928c1cea2d7eca30cd35bb7fe014053
change-id: 20241210-matrix-30021676fb6f

Best regards,

Signature · 1 line
Charan Pedumuru <[email protected]>
#1 lore raw
Quoted 4 lines · Charan Pedumuru

Convert old text based binding to json schema. Changes during conversion:
Add a fallback for all compatibles as the IP core is compatible with syscon.

I don't understand. The syscon was already there. You added different fallback, so provide explanation why do you think they are compatible.

Quoted 22 lines
---
 .../bindings/mfd/atmel,at91sam9260-matrix.yaml     | 54 ++++++++++++++++++++++
 .../devicetree/bindings/mfd/atmel-matrix.txt       | 26 -----------
 2 files changed, 54 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +9 -0
new file mode 100644
index 000000000000..0e827882823f
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/atmel,at91sam9260-matrix.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip AT91 Bus Matrix
+
+maintainers:

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 19

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +10 -0
+  - Nicolas Ferre <[email protected]>
+
+description:
+  The Bus Matrix (MATRIX) implements a multi-layer AHB, based on the
+  AHB-Lite protocol, that enables parallel access paths between multiple
+  masters and slaves in a system, thus increasing the overall bandwidth.
+
+properties:
+  compatible:
+    anyOf:

oneOf
See other bindings for preferred syntax. There is never anyOf.

Quoted 7 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +7 -0
+      - items:
+          - enum:
+              - atmel,at91sam9260-matrix
+              - atmel,at91sam9261-matrix
+              - atmel,at91sam9263-matrix
+              - atmel,at91sam9rl-matrix
+              - atmel,at91sam9g45-matrix

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +10 -0
+              - atmel,at91sam9n12-matrix
+              - atmel,at91sam9x5-matrix
+              - atmel,sama5d3-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x60-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x7-matrix

So that's just enum with previous group.

Quoted 5 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +5 -0
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+
+  reg:
+    maxItems: 1

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 51

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +10 -0
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    matrix@ffffec00 {

syscon@
or system-controller@

Best regards,
Krzysztof

#2 lore raw
Quoted 9 lines · Krzysztof Kozlowski

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 4 lines · Charan Pedumuru

Convert old text based binding to json schema. Changes during conversion:
Add a fallback for all compatibles as the IP core is compatible with syscon.

I don't understand. The syscon was already there. You added different fallback, so provide explanation why do you think they are compatible.

The old binding was misleading, microchip,sam9x60-matrix has a compatible atmel,at91sam9x5-matrix and atmel,at91sam9x5-matrix has a compatible syscon, which was missing in the old binding. I will add this to the commit message.

Quoted 26 lines
Quoted 26 lines
---
  .../bindings/mfd/atmel,at91sam9260-matrix.yaml     | 54 ++++++++++++++++++++++
  .../devicetree/bindings/mfd/atmel-matrix.txt       | 26 -----------
  2 files changed, 54 insertions(+), 26 deletions(-)
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +13 -0
new file mode 100644
index 000000000000..0e827882823f
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mfd/atmel,at91sam9260-matrix.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip AT91 Bus Matrix
+
+maintainers:
+  - Nicolas Ferre <[email protected]>
+
+description:
+  The Bus Matrix (MATRIX) implements a multi-layer AHB, based on the
Quoted 8 lines

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 19

Quoted 6 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +6 -0
+  AHB-Lite protocol, that enables parallel access paths between multiple
+  masters and slaves in a system, thus increasing the overall bandwidth.
+
+properties:
+  compatible:
+    anyOf:

oneOf
See other bindings for preferred syntax. There is never anyOf.

Yes, I will change that.

Quoted 18 lines
Quoted 8 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +7 -0
+      - items:
+          - enum:
+              - atmel,at91sam9260-matrix
+              - atmel,at91sam9261-matrix
+              - atmel,at91sam9263-matrix
+              - atmel,at91sam9rl-matrix
+              - atmel,at91sam9g45-matrix

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 36

Quoted 10 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +10 -0
+              - atmel,at91sam9n12-matrix
+              - atmel,at91sam9x5-matrix
+              - atmel,sama5d3-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x60-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x7-matrix
Quoted 1 line

So that's just enum with previous group.

Yes, as both boards have 2 compatibles one after another, I defined them as two different groups to resolve dt_check warnings.

Quoted 11 lines
Quoted 11 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +9 -0
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
Quoted 8 lines

Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml line 51

Quoted 6 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +6 -0
+
+additionalProperties: false
+
+examples:
+  - |
+    matrix@ffffec00 {

syscon@
or system-controller@

Will use syscon@ instead of  matrix@ in next revision.

Quoted 5 lines

Best regards,
Krzysztof

Signature · 2 lines
Best Regards,
Charan.
#3 lore raw
Quoted 18 lines · On 17/12/2024 06:00, [email protected] wrote:
Quoted 18 lines
Quoted 18 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +17 -0
+      - items:
+          - enum:
+              - atmel,at91sam9260-matrix
+              - atmel,at91sam9261-matrix
+              - atmel,at91sam9263-matrix
+              - atmel,at91sam9rl-matrix
+              - atmel,at91sam9g45-matrix
+              - atmel,at91sam9n12-matrix
+              - atmel,at91sam9x5-matrix
+              - atmel,sama5d3-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x60-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x7-matrix
Quoted 4 lines
Quoted 1 line

So that's just enum with previous group.

Yes, as both boards have 2 compatibles one after another, I defined them as two different groups to resolve dt_check warnings.

My comment stands. I understand your "Yes" means you will fix it.

Best regards,
Krzysztof

#4 lore raw
Quoted 20 lines · Krzysztof Kozlowski

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 17 lines · On 17/12/2024 06:00, [email protected] wrote:
Quoted 17 lines
Quoted 17 lines
Documentation/devicetree/bindings/mfd/atmel,at91sam9260-matrix.yaml new file +17 -0
+      - items:
+          - enum:
+              - atmel,at91sam9260-matrix
+              - atmel,at91sam9261-matrix
+              - atmel,at91sam9263-matrix
+              - atmel,at91sam9rl-matrix
+              - atmel,at91sam9g45-matrix
+              - atmel,at91sam9n12-matrix
+              - atmel,at91sam9x5-matrix
+              - atmel,sama5d3-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x60-matrix
+          - const: atmel,at91sam9x5-matrix
+          - const: syscon
+      - items:
+          - const: microchip,sam9x7-matrix
Quoted 4 lines
Quoted 3 lines
Quoted 1 line

So that's just enum with previous group.

Yes, as both boards have 2 compatibles one after another, I defined them as two different groups to resolve dt_check warnings.

My comment stands. I understand your "Yes" means you will fix it.

Yes, I will remove the other group and define both microchip,sam9x60-matrix and microchip,sam9x7-matrix in enum under items and add const.

Quoted 4 lines

Best regards,
Krzysztof

Signature · 2 lines
Best Regards,
Charan.