Skip to contentSkip to conversation

dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions

RFC PATCH In review Rafał Miłecki 2 participants 2 messages Mar 29, 2021 – Mar 30, 2021

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

RFC PATCH 1/1 dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions

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

Every MTD partition can be NVMEM provider now. It's not handled by the shared partition.yaml so add proper "compatible" to the BCM4908.

---
Ideally I'd like to have:
1. partition.yaml allowing "nvmem-cells" by using nvmem-cells.yaml
2. brcm,bcm4908-partitions.yaml using partition.yaml and extending the compatible list by "brcm,bcm4908-firmware"

I don't know if such a solution is possible to implement using YAML?

Proposed solution (RFC) isn't a really clean one:
1. It duplicates "nvmem-cells" which is already in the nvmem-cells.yaml
2. Generic "nvmem-cells" should be part of the partition.yaml

Rob? Help? :)

---
 .../bindings/mtd/partitions/brcm,bcm4908-partitions.yaml      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml +3 -1
index 7b113e5e3421..28aa3bdd1103 100644
@@ -32,7 +32,9 @@ patternProperties:
     $ref: "partition.yaml#"
     properties:
       compatible:
-        const: brcm,bcm4908-firmware
+        enum:
+          - brcm,bcm4908-firmware
+          - nvmem-cells
     unevaluatedProperties: false
 
 required:
Signature · 1 line
2.26.2
maintainer
#1 lore raw
Quoted 5 lines · Rafał Miłecki

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

Every MTD partition can be NVMEM provider now. It's not handled by the shared partition.yaml so add proper "compatible" to the BCM4908.

Quoted 8 lines

---
Ideally I'd like to have:
1. partition.yaml allowing "nvmem-cells" by using nvmem-cells.yaml
2. brcm,bcm4908-partitions.yaml using partition.yaml and extending the compatible list by "brcm,bcm4908-firmware"

I don't know if such a solution is possible to implement using YAML?

You would have to do something like:

items:
- const: foo,bar
- {}

and then in partition.yaml:

contains:
const: nvmem-cells

But that does work if nvmem-cells is not always present.

However, do we have partition.yaml and nvmem-cells.yaml backwards? nvmem-cells.yaml should reference partition.yaml as nvmem-cells.yaml is partition.yaml plus more constraints.

And then brcm,bcm4908-partitions.yaml references nvmem-cells.yaml and the above schema would work.

Quoted 4 lines

Proposed solution (RFC) isn't a really clean one:
1. It duplicates "nvmem-cells" which is already in the nvmem-cells.yaml
2. Generic "nvmem-cells" should be part of the partition.yaml

I'm fine with this too. It's more explicit as to what the compatible strings are.

Quoted 24 lines

Rob? Help? :)

---
 .../bindings/mtd/partitions/brcm,bcm4908-partitions.yaml      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml +3 -1
index 7b113e5e3421..28aa3bdd1103 100644
@@ -32,7 +32,9 @@ patternProperties:
     $ref: "partition.yaml#"
     properties:
       compatible:
-        const: brcm,bcm4908-firmware
+        enum:
+          - brcm,bcm4908-firmware
+          - nvmem-cells
     unevaluatedProperties: false
 
 required:
Signature · 1 line
2.26.2