Skip to contentSkip to conversation

dt-bindings: mtd: partitions: make partition an NVMEM provider

PATCH In review Rafał Miłecki 2 participants 3 messages Jan 11, 2024 – Jan 19, 2024

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

PATCH 1/1 dt-bindings: mtd: partitions: make partition an NVMEM provider

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

MTD partition provides flash device data and can be used as NVMEM device.

---
 .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/partition.yaml +9 -7
index 1ebe9e2347ea..7b1d84ce5ef5 100644
@@ -57,13 +57,15 @@ properties:
       user space from
     type: boolean
 
-if:
-  not:
-    required: [ reg ]
-then:
-  properties:
-    $nodename:
-      pattern: '^partition-.*$'
+allOf:
+  - $ref: /schemas/nvmem/nvmem.yaml
+  - if:
+      not:
+        required: [ reg ]
+    then:
+      properties:
+        $nodename:
+          pattern: '^partition-.*$'
 
 # This is a generic file other binding inherit from and extend
 additionalProperties: true
Signature · 1 line
2.35.3
#1 lore raw

Cc Srini & Greg (please keep them in loop in case or replies)

Quoted 37 lines · Rafał Miłecki

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

MTD partition provides flash device data and can be used as NVMEM device.

---
  .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
  1 file changed, 9 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/partition.yaml +9 -7
index 1ebe9e2347ea..7b1d84ce5ef5 100644
@@ -57,13 +57,15 @@ properties:
        user space from
      type: boolean
 
-if:
-  not:
-    required: [ reg ]
-then:
-  properties:
-    $nodename:
-      pattern: '^partition-.*$'
+allOf:
+  - $ref: /schemas/nvmem/nvmem.yaml
+  - if:
+      not:
+        required: [ reg ]
+    then:
+      properties:
+        $nodename:
+          pattern: '^partition-.*$'
 
  # This is a generic file other binding inherit from and extend
  additionalProperties: true
maintainer
#2 lore raw
In reply to Rafał Miłecki
Quoted 4 lines · Rafał Miłecki

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

MTD partition provides flash device data and can be used as NVMEM device.

I don't follow what is the relationship between this and your other series.

Quoted 13 lines
---
 .../bindings/mtd/partitions/partition.yaml       | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)
Documentation/devicetree/bindings/mtd/partitions/partition.yaml +0 -0
index 1ebe9e2347ea..7b1d84ce5ef5 100644
@@ -57,13 +57,15 @@ properties:
       user space from
     type: boolean

Documentation/devicetree/bindings/mtd/partitions/partition.yaml properties: · line 61

Quoted 10 lines
Documentation/devicetree/bindings/mtd/partitions/partition.yaml +2 -7
 
-if:
-  not:
-    required: [ reg ]
-then:
-  properties:
-    $nodename:
-      pattern: '^partition-.*$'
+allOf:
+  - $ref: /schemas/nvmem/nvmem.yaml

Only some partitions are nvmem nodes, so we shouldn't always include it. Then we can't exclude nvmem properties from partition nodes which aren't. We should identify those nodes by compatible and their schema should reference partition.yaml and nvmem.yaml.

There's a general problem with the partition related schemas that undefined properties are not caught. This is partly because partition nodes can be nested and expressing that with the schema is hard.

Rob