Skip to contentSkip to conversation

dt-bindings: clock: imx8m: Integrate duplicated i.MX 8M schemas

PATCH In review Krzysztof Kozlowski 2 participants 12 messages Aug 29, 2020 – Sep 4, 2020

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

PATCH 1/7 dt-bindings: clock: imx8m: Integrate duplicated i.MX 8M schemas

The clock controller schemas for i.MX 8M Mini, 8M Nano, 8M Plus and 8M Quad are basically the same. The only minor difference appears on 8M Quad which needs one more clock.

There is no point to have four schemas for almost the same binding. Any fixes or changes would have to be duplicated four times.

---
 .../bindings/clock/imx8m-clock.yaml           | 125 ++++++++++++++++++
 .../bindings/clock/imx8mm-clock.yaml          |  68 ----------
 .../bindings/clock/imx8mn-clock.yaml          |  70 ----------
 .../bindings/clock/imx8mp-clock.yaml          |  70 ----------
 .../bindings/clock/imx8mq-clock.yaml          |  72 ----------
 5 files changed, 125 insertions(+), 280 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/clock/imx8m-clock.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/imx8mm-clock.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/imx8mn-clock.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/imx8mp-clock.yaml
 delete mode 100644 Documentation/devicetree/bindings/clock/imx8mq-clock.yaml
Documentation/devicetree/bindings/clock/imx8m-clock.yaml new file +125 -0
new file mode 100644
index 000000000000..31e7cc9693c3
@@ -0,0 +1,125 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/clock/imx8m-clock.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NXP i.MX8M Family Clock Control Module Binding
+
+maintainers:
+  - Anson Huang <[email protected]>
+
+description: |
+  NXP i.MX8M Mini/Nano/Plus/Quad clock control module is an integrated clock
+  controller, which generates and supplies to all modules.
+
+properties:
+  compatible:
+    enum:
+      - fsl,imx8mm-ccm
+      - fsl,imx8mn-ccm
+      - fsl,imx8mp-ccm
+      - fsl,imx8mq-ccm
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    minItems: 6
+    maxItems: 7
+
+  clock-names:
+    minItems: 6
+    maxItems: 7
+
+  '#clock-cells':
+    const: 1
+    description:
+      The clock consumer should specify the desired clock by having the clock
+      ID in its "clocks" phandle cell. See include/dt-bindings/clock/imx8m-clock.h
+      for the full list of i.MX8M clock IDs.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - '#clock-cells'
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: fsl,imx8mq-ccm
+    then:
+      properties:
+        clocks:
+          minItems: 7
+          maxItems: 7
+          items:
+            - description: 32k osc
+            - description: 25m osc
+            - description: 27m osc
+            - description: ext1 clock input
+            - description: ext2 clock input
+            - description: ext3 clock input
+            - description: ext4 clock input
+        clock-names:
+          minItems: 7
+          maxItems: 7
+          items:
+            - const: ckil
+            - const: osc_25m
+            - const: osc_27m
+            - const: clk_ext1
+            - const: clk_ext2
+            - const: clk_ext3
+            - const: clk_ext4
+    else:
+      properties:
+        clocks:
+          items:
+            - description: 32k osc
+            - description: 24m osc
+            - description: ext1 clock input
+            - description: ext2 clock input
+            - description: ext3 clock input
+            - description: ext4 clock input
+
+        clock-names:
+          items:
+            - const: osc_32k
+            - const: osc_24m
+            - const: clk_ext1
+            - const: clk_ext2
+            - const: clk_ext3
+            - const: clk_ext4
+
+unevaluatedProperties: false
+
+examples:
+  # Clock Control Module node:
+  - |
+    clock-controller@30380000 {
+        compatible = "fsl,imx8mm-ccm";
+        reg = <0x30380000 0x10000>;
+        #clock-cells = <1>;
+        clocks = <&osc_32k>, <&osc_24m>, <&clk_ext1>, <&clk_ext2>,
+                 <&clk_ext3>, <&clk_ext4>;
+        clock-names = "osc_32k", "osc_24m", "clk_ext1", "clk_ext2",
+                      "clk_ext3", "clk_ext4";
+    };
+
+  - |
+    clock-controller@30390000 {
+        compatible = "fsl,imx8mq-ccm";
+        reg = <0x30380000 0x10000>;
+        #clock-cells = <1>;
+        clocks = <&ckil>, <&osc_25m>, <&osc_27m>, <&clk_ext1>,
+                 <&clk_ext2>, <&clk_ext3>, <&clk_ext4>;
+        clock-names = "ckil", "osc_25m", "osc_27m", "clk_ext1",
+                      "clk_ext2", "clk_ext3", "clk_ext4";
+    };
+
+...
Documentation/devicetree/bindings/clock/imx8mm-clock.yaml deleted +0 -68

68 lines not on this page · raw message

Documentation/devicetree/bindings/clock/imx8mn-clock.yaml deleted +0 -70

70 lines not on this page · raw message

Documentation/devicetree/bindings/clock/imx8mp-clock.yaml deleted +0 -70

70 lines not on this page · raw message

Documentation/devicetree/bindings/clock/imx8mq-clock.yaml deleted +0 -72

72 lines not on this page · raw message

Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

PATCH 2/7 dt-bindings: mailbox: fsl,mu: Fix i.MX 8QXP compatible matching

The Mailbox on i.MX 8QXP (fsl,imx8qxp-mu) can also be compatible with fsl,imx8-mu-scu (for fast IPC) so adjust the compatibles to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml: mailbox@5d1f0000:
compatible: ['fsl,imx8-mu-scu', 'fsl,imx8qxp-mu', 'fsl,imx6sx-mu'] is not valid under any of the given schemas (Possible causes of the failure):

arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml: mailbox@5d1f0000:

    compatible: ['fsl,imx8-mu-scu', 'fsl,imx8qxp-mu', 'fsl,imx6sx-mu'] is too long
---
 Documentation/devicetree/bindings/mailbox/fsl,mu.yaml | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mailbox/fsl,mu.yaml +2 -1
index 8a3470b64d06..7ed096360be2 100644
@@ -38,8 +38,9 @@ properties:
           - const: fsl,imx6sx-mu
       - description: To communicate with i.MX8 SCU with fast IPC
         items:
-          - const: fsl,imx8qxp-mu
           - const: fsl,imx8-mu-scu
+          - const: fsl,imx8qxp-mu
+          - const: fsl,imx6sx-mu
 
   reg:
     maxItems: 1
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw

PATCH 3/7 dt-bindings: mailbox: fsl,mu: Use unevaluatedProperties

In reply to Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml:

    mailbox@5d280000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
---
 Documentation/devicetree/bindings/mailbox/fsl,mu.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/mailbox/fsl,mu.yaml +1 -1
index 7ed096360be2..3ce6cd0ea173 100644
@@ -78,7 +78,7 @@ required:
   - interrupts
   - "#mbox-cells"
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#3 lore raw

Re: [PATCH 3/7] dt-bindings: mailbox: fsl,mu: Use unevaluatedProperties

Quoted 10 lines · Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml:

    mailbox@5d280000: 'power-domains' does not match any of the regexes: 'pinctrl-[0-9]+'
---
 Documentation/devicetree/bindings/mailbox/fsl,mu.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

NAK. See https://lore.kernel.org/r/CAL_JsqKPXJxsHPS34_TCf9bwgKxZNSV4mvQR-WKRnknQVtGGxQ@mail.gmail.com/

#4 lore raw

PATCH 4/7 dt-bindings: i2c: imx-lpi2c: Use unevaluatedProperties

In reply to Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dt.yaml: i2c@5a800000:
'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+'

---
 Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml +1 -1
index ac0bc5dd64d6..594e174e2cde 100644
@@ -31,7 +31,7 @@ required:
   - interrupts
   - clocks
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#5 lore raw

Re: [PATCH 4/7] dt-bindings: i2c: imx-lpi2c: Use unevaluatedProperties

Quoted 10 lines · Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-ai_ml.dt.yaml: i2c@5a800000:
'assigned-clock-rates', 'assigned-clocks', 'clock-names', 'power-domains' do not match any of the regexes: 'pinctrl-[0-9]+'

---
 Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

NAK. See https://lore.kernel.org/r/CAL_JsqKPXJxsHPS34_TCf9bwgKxZNSV4mvQR-WKRnknQVtGGxQ@mail.gmail.com/

#6 lore raw

PATCH 5/7 dt-bindings: i2c: imx-lpi2c: Fix i.MX 8QXP compatible matching

In reply to Krzysztof Kozlowski

The i.MX 8QXP DTSes use two compatibles so update the binding to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8qxp-mek.dt.yaml: i2c@5a820000:
compatible: ['fsl,imx8qxp-lpi2c', 'fsl,imx7ulp-lpi2c'] is too long

---
 .../devicetree/bindings/i2c/i2c-imx-lpi2c.yaml        | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/i2c/i2c-imx-lpi2c.yaml +7 -4
index 594e174e2cde..319147b780cb 100644
@@ -11,10 +11,13 @@ maintainers:
 
 properties:
   compatible:
-    enum:
-      - fsl,imx7ulp-lpi2c
-      - fsl,imx8qxp-lpi2c
-      - fsl,imx8qm-lpi2c
+    oneOf:
+      - enum:
+          - fsl,imx7ulp-lpi2c
+          - fsl,imx8qm-lpi2c
+      - items:
+          - const: fsl,imx8qxp-lpi2c
+          - const: fsl,imx7ulp-lpi2c
 
   reg:
     maxItems: 1
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#7 lore raw

PATCH 6/7 dt-bindings: i2c: imx: Use unevaluatedProperties

In reply to Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains or child nodes) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8mn-evk.dt.yaml: i2c@30a20000:

    '#address-cells', '#size-cells', 'pmic@25' do not match any of the regexes: 'pinctrl-[0-9]+'
---
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/i2c/i2c-imx.yaml +1 -1
index 810536953177..73b4e628802c 100644
@@ -75,7 +75,7 @@ required:
   - interrupts
   - clocks
 
-additionalProperties: false
+unevaluatedProperties: false
 
 examples:
   - |
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
maintainer
#8 lore raw

Re: [PATCH 6/7] dt-bindings: i2c: imx: Use unevaluatedProperties

Quoted 10 lines · Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains or child nodes) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8mn-evk.dt.yaml: i2c@30a20000:

    '#address-cells', '#size-cells', 'pmic@25' do not match any of the regexes: 'pinctrl-[0-9]+'
---
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

NAK. See https://lore.kernel.org/r/CAL_JsqKPXJxsHPS34_TCf9bwgKxZNSV4mvQR-WKRnknQVtGGxQ@mail.gmail.com/

#9 lore raw

Re: [PATCH 6/7] dt-bindings: i2c: imx: Use unevaluatedProperties

Quoted 8 lines · Rob Herring
Quoted 6 lines · Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains or child nodes) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8mn-evk.dt.yaml: i2c@30a20000:

    '#address-cells', '#size-cells', 'pmic@25' do not match any of the regexes: 'pinctrl-[0-9]+'
Quoted 6 lines
Quoted 4 lines
---
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

NAK. See https://lore.kernel.org/r/CAL_JsqKPXJxsHPS34_TCf9bwgKxZNSV4mvQR-WKRnknQVtGGxQ@mail.gmail.com/

I can reference the generic i2c-controller schema and add missing properties but what to do with children (pmic@25 and many other)? I see that all of the other I2C controller dtschema files solve it by skipping "additionalProperties: false". Is this the way to go with I2C controllers?

Best regards,
Krzysztof

maintainer
#10 lore raw

Re: [PATCH 6/7] dt-bindings: i2c: imx: Use unevaluatedProperties

Quoted 15 lines · Krzysztof Kozlowski
Quoted 13 lines · Rob Herring
Quoted 10 lines · Krzysztof Kozlowski

Additional properties actually might appear (e.g. power-domains or child nodes) so use unevaluatedProperties to fix dtbs_check warnings like:

arch/arm64/boot/dts/freescale/imx8mn-evk.dt.yaml: i2c@30a20000:

    '#address-cells', '#size-cells', 'pmic@25' do not match any of the regexes: 'pinctrl-[0-9]+'
---
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 7 lines
Quoted 1 line

NAK. See https://lore.kernel.org/r/CAL_JsqKPXJxsHPS34_TCf9bwgKxZNSV4mvQR-WKRnknQVtGGxQ@mail.gmail.com/

I can reference the generic i2c-controller schema and add missing properties but what to do with children (pmic@25 and many other)? I see that all of the other I2C controller dtschema files solve it by skipping "additionalProperties: false". Is this the way to go with I2C controllers?

If there's a $ref to the i2c schema, then using unevaluatedProperties is correct.

Rob

#11 lore raw

PATCH 7/7 dt-bindings: i2c: imx: Fix i.MX 7 compatible matching

In reply to Krzysztof Kozlowski

The i.MX 7 DTSes use two compatibles so update the binding to fix dtbs_check warnings like:

arch/arm/boot/dts/imx7d-cl-som-imx7.dt.yaml: i2c@30a20000:
compatible: ['fsl,imx7d-i2c', 'fsl,imx21-i2c'] is not valid under any of the given schemas (Possible causes of the failure):

arch/arm/boot/dts/imx7d-cl-som-imx7.dt.yaml: i2c@30a20000:

    compatible: ['fsl,imx7d-i2c', 'fsl,imx21-i2c'] is too long
---
 Documentation/devicetree/bindings/i2c/i2c-imx.yaml | 3 +++
 1 file changed, 3 insertions(+)
Documentation/devicetree/bindings/i2c/i2c-imx.yaml +3 -0
index 73b4e628802c..2d555d5bacc5 100644
@@ -18,6 +18,9 @@ properties:
       - items:
           - const: fsl,imx35-i2c
           - const: fsl,imx1-i2c
+      - items:
+          - const: fsl,imx7d-i2c
+          - const: fsl,imx21-i2c
       - items:
           - enum:
               - fsl,imx25-i2c
Signature · 7 lines
2.17.1


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel