All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions
@ 2021-03-29 15:07 ` Rafał Miłecki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2021-03-29 15:07 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Ansuel Smith
  Cc: linux-mtd, devicetree, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
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(-)

diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
index 7b113e5e3421..28aa3bdd1103 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
@@ -32,7 +32,9 @@ patternProperties:
     $ref: "partition.yaml#"
     properties:
       compatible:
-        const: brcm,bcm4908-firmware
+        enum:
+          - brcm,bcm4908-firmware
+          - nvmem-cells
     unevaluatedProperties: false
 
 required:
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions
@ 2021-03-29 15:07 ` Rafał Miłecki
  0 siblings, 0 replies; 4+ messages in thread
From: Rafał Miłecki @ 2021-03-29 15:07 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Rob Herring, Ansuel Smith
  Cc: linux-mtd, devicetree, Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

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

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
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(-)

diff --git a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
index 7b113e5e3421..28aa3bdd1103 100644
--- a/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
+++ b/Documentation/devicetree/bindings/mtd/partitions/brcm,bcm4908-partitions.yaml
@@ -32,7 +32,9 @@ patternProperties:
     $ref: "partition.yaml#"
     properties:
       compatible:
-        const: brcm,bcm4908-firmware
+        enum:
+          - brcm,bcm4908-firmware
+          - nvmem-cells
     unevaluatedProperties: false
 
 required:
-- 
2.26.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions
  2021-03-29 15:07 ` Rafał Miłecki
@ 2021-03-30 22:19   ` Rob Herring
  -1 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-03-30 22:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Ansuel Smith, linux-mtd, devicetree, Rafał Miłecki

On Mon, Mar 29, 2021 at 05:07:23PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Every MTD partition can be NVMEM provider now. It's not handled by the
> shared partition.yaml so add proper "compatible" to the BCM4908.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> 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.

> 
> 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.

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions
@ 2021-03-30 22:19   ` Rob Herring
  0 siblings, 0 replies; 4+ messages in thread
From: Rob Herring @ 2021-03-30 22:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
	Ansuel Smith, linux-mtd, devicetree, Rafał Miłecki

On Mon, Mar 29, 2021 at 05:07:23PM +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Every MTD partition can be NVMEM provider now. It's not handled by the
> shared partition.yaml so add proper "compatible" to the BCM4908.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
> 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.

> 
> 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.

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

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-03-30 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29 15:07 [PATCH RFC] dt-bindings: mtd: allow NVMEM cells in BCM4908 partitions Rafał Miłecki
2021-03-29 15:07 ` Rafał Miłecki
2021-03-30 22:19 ` Rob Herring
2021-03-30 22:19   ` Rob Herring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.