Skip to contentSkip to conversation

dt-bindings: memory-controllers: tegra: Fix type references

PATCH In review Rob Herring 2 participants 4 messages Dec 11, 2019 – Dec 12, 2019

Subsystems (3)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: memory-controllers: tegra: Fix type references

Json-schema requires a $ref to be under an 'allOf' if there are additional constraints otherwise the additional constraints are ignored. (Note that this behavior will be changed in draft8.)

Fixes 641262f5e1ed ("dt-bindings: memory: Add binding for NVIDIA Tegra30 External Memory Controller")
Fixes 785685b7a106 ("dt-bindings: memory: Add binding for NVIDIA Tegra30 Memory Controller")
Fixes 8da65c377b21 ("dt-bindings: memory: tegra30: Convert to Tegra124 YAML")
Cc Dmitry Osipenko <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
I'll take this via the DT tree for rc2.

 .../bindings/memory-controllers/nvidia,tegra124-mc.yaml  | 3 ++-
 .../bindings/memory-controllers/nvidia,tegra30-emc.yaml  | 9 ++++++---
 .../bindings/memory-controllers/nvidia,tegra30-mc.yaml   | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-mc.yaml +2 -1
index 30d9fb193d7f..22a94b6fdbde 100644
@@ -60,7 +60,8 @@ patternProperties:
             maximum: 1066000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "15.6.1 MC Registers" in the TRM.
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-emc.yaml +6 -3
index 7fe0ca14e324..e4135bac6957 100644
@@ -56,7 +56,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emc-auto-cal-interval:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Pad calibration interval in microseconds.
             minimum: 0
@@ -78,7 +79,8 @@ patternProperties:
               Mode Register 0.
 
           nvidia,emc-zcal-cnt-long:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Number of EMC clocks to wait before issuing any commands after
               sending ZCAL_MRW_CMD.
@@ -96,7 +98,8 @@ patternProperties:
               FBIO "read" FIFO periodic resetting enabled.
 
           nvidia,emc-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description:
               EMC timing characterization data. These are the registers
               (see section "18.13.2 EMC Registers" in the TRM) whose values
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +2 -1
index 84fd57bcf0dc..4b9196c83291 100644
@@ -77,7 +77,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "18.13.1 MC Registers" in the TRM.
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

11.12.2019 19:32, Rob Herring пишет:

Quoted 74 lines

Json-schema requires a $ref to be under an 'allOf' if there are additional constraints otherwise the additional constraints are ignored. (Note that this behavior will be changed in draft8.)

Fixes 641262f5e1ed ("dt-bindings: memory: Add binding for NVIDIA Tegra30 External Memory Controller")
Fixes 785685b7a106 ("dt-bindings: memory: Add binding for NVIDIA Tegra30 Memory Controller")
Fixes 8da65c377b21 ("dt-bindings: memory: tegra30: Convert to Tegra124 YAML")
Cc Dmitry Osipenko <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
I'll take this via the DT tree for rc2.

 .../bindings/memory-controllers/nvidia,tegra124-mc.yaml  | 3 ++-
 .../bindings/memory-controllers/nvidia,tegra30-emc.yaml  | 9 ++++++---
 .../bindings/memory-controllers/nvidia,tegra30-mc.yaml   | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-mc.yaml +2 -1
index 30d9fb193d7f..22a94b6fdbde 100644
@@ -60,7 +60,8 @@ patternProperties:
             maximum: 1066000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "15.6.1 MC Registers" in the TRM.
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-emc.yaml +6 -3
index 7fe0ca14e324..e4135bac6957 100644
@@ -56,7 +56,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emc-auto-cal-interval:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Pad calibration interval in microseconds.
             minimum: 0
@@ -78,7 +79,8 @@ patternProperties:
               Mode Register 0.
 
           nvidia,emc-zcal-cnt-long:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Number of EMC clocks to wait before issuing any commands after
               sending ZCAL_MRW_CMD.
@@ -96,7 +98,8 @@ patternProperties:
               FBIO "read" FIFO periodic resetting enabled.
 
           nvidia,emc-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description:
               EMC timing characterization data. These are the registers
               (see section "18.13.2 EMC Registers" in the TRM) whose values
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +0 -0
index 84fd57bcf0dc..4b9196c83291 100644

Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml patternProperties: · line 84

Quoted 9 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +2 -1
@@ -77,7 +77,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "18.13.1 MC Registers" in the TRM.

But the "nvidia,emem-configuration" doesn't have any extra constraints. Or you just added the "allOf" for consistency to avoid possible future copy-paste bugs?

Otherwise LGTM, thanks!

author maintainer
#2 lore raw
Quoted 77 lines · Dmitry Osipenko

11.12.2019 19:32, Rob Herring пишет:

Quoted 75 lines

Json-schema requires a $ref to be under an 'allOf' if there are additional constraints otherwise the additional constraints are ignored. (Note that this behavior will be changed in draft8.)

Fixes 641262f5e1ed ("dt-bindings: memory: Add binding for NVIDIA Tegra30 External Memory Controller")
Fixes 785685b7a106 ("dt-bindings: memory: Add binding for NVIDIA Tegra30 Memory Controller")
Fixes 8da65c377b21 ("dt-bindings: memory: tegra30: Convert to Tegra124 YAML")
Cc Dmitry Osipenko <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
I'll take this via the DT tree for rc2.

 .../bindings/memory-controllers/nvidia,tegra124-mc.yaml  | 3 ++-
 .../bindings/memory-controllers/nvidia,tegra30-emc.yaml  | 9 ++++++---
 .../bindings/memory-controllers/nvidia,tegra30-mc.yaml   | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-mc.yaml +2 -1
index 30d9fb193d7f..22a94b6fdbde 100644
@@ -60,7 +60,8 @@ patternProperties:
             maximum: 1066000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "15.6.1 MC Registers" in the TRM.
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-emc.yaml +6 -3
index 7fe0ca14e324..e4135bac6957 100644
@@ -56,7 +56,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emc-auto-cal-interval:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Pad calibration interval in microseconds.
             minimum: 0
@@ -78,7 +79,8 @@ patternProperties:
               Mode Register 0.
 
           nvidia,emc-zcal-cnt-long:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Number of EMC clocks to wait before issuing any commands after
               sending ZCAL_MRW_CMD.
@@ -96,7 +98,8 @@ patternProperties:
               FBIO "read" FIFO periodic resetting enabled.
 
           nvidia,emc-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description:
               EMC timing characterization data. These are the registers
               (see section "18.13.2 EMC Registers" in the TRM) whose values
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +0 -0
index 84fd57bcf0dc..4b9196c83291 100644
@@ -77,7 +77,8 @@ patternProperties:
             maximum: 900000000
 
Quoted 12 lines

Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml patternProperties: · line 84

Quoted 8 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +2 -1
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "18.13.1 MC Registers" in the TRM.

But the "nvidia,emem-configuration" doesn't have any extra constraints. Or you just added the "allOf" for consistency to avoid possible future copy-paste bugs?

It does have constraints. It has the 'items' list.

Note that fixing it introduces an error which I'm in the process of fixing in the schema tool.

Quoted 3 lines

Otherwise LGTM, thanks!

Thanks.

Rob

#3 lore raw

12.12.2019 17:05, Rob Herring пишет:

Quoted 91 lines · Dmitry Osipenko
Quoted 77 lines

11.12.2019 19:32, Rob Herring пишет:

Quoted 75 lines

Json-schema requires a $ref to be under an 'allOf' if there are additional constraints otherwise the additional constraints are ignored. (Note that this behavior will be changed in draft8.)

Fixes 641262f5e1ed ("dt-bindings: memory: Add binding for NVIDIA Tegra30 External Memory Controller")
Fixes 785685b7a106 ("dt-bindings: memory: Add binding for NVIDIA Tegra30 Memory Controller")
Fixes 8da65c377b21 ("dt-bindings: memory: tegra30: Convert to Tegra124 YAML")
Cc Dmitry Osipenko <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>

---
I'll take this via the DT tree for rc2.

 .../bindings/memory-controllers/nvidia,tegra124-mc.yaml  | 3 ++-
 .../bindings/memory-controllers/nvidia,tegra30-emc.yaml  | 9 ++++++---
 .../bindings/memory-controllers/nvidia,tegra30-mc.yaml   | 3 ++-
 3 files changed, 10 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra124-mc.yaml +2 -1
index 30d9fb193d7f..22a94b6fdbde 100644
@@ -60,7 +60,8 @@ patternProperties:
             maximum: 1066000000
 
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "15.6.1 MC Registers" in the TRM.
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-emc.yaml +6 -3
index 7fe0ca14e324..e4135bac6957 100644
@@ -56,7 +56,8 @@ patternProperties:
             maximum: 900000000
 
           nvidia,emc-auto-cal-interval:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Pad calibration interval in microseconds.
             minimum: 0
@@ -78,7 +79,8 @@ patternProperties:
               Mode Register 0.
 
           nvidia,emc-zcal-cnt-long:
-            $ref: /schemas/types.yaml#/definitions/uint32
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32
             description:
               Number of EMC clocks to wait before issuing any commands after
               sending ZCAL_MRW_CMD.
@@ -96,7 +98,8 @@ patternProperties:
               FBIO "read" FIFO periodic resetting enabled.
 
           nvidia,emc-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description:
               EMC timing characterization data. These are the registers
               (see section "18.13.2 EMC Registers" in the TRM) whose values
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +0 -0
index 84fd57bcf0dc..4b9196c83291 100644
@@ -77,7 +77,8 @@ patternProperties:
             maximum: 900000000
 
Quoted 12 lines

Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml patternProperties: · line 84

Quoted 8 lines
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra30-mc.yaml +2 -1
           nvidia,emem-configuration:
-            $ref: /schemas/types.yaml#/definitions/uint32-array
+            allOf:
+              - $ref: /schemas/types.yaml#/definitions/uint32-array
             description: |
               Values to be written to the EMEM register block. See section
               "18.13.1 MC Registers" in the TRM.

But the "nvidia,emem-configuration" doesn't have any extra constraints. Or you just added the "allOf" for consistency to avoid possible future copy-paste bugs?

Quoted 1 line

It does have constraints. It has the 'items' list.

Right, I missed that array-size is also a constraint.

Quoted 2 lines

Note that fixing it introduces an error which I'm in the process of fixing in the schema tool.

Okay!

Quoted 8 lines
Quoted 3 lines

Otherwise LGTM, thanks!

Thanks.

Rob