Re: [PATCH v5 14/23] dt/bindings: firmware: Add FWU metadata on MTD devices binding

2022-06-21 Thread Patrick DELAUNAY

Hi,

On 6/9/22 14:30, Sughosh Ganu wrote:

From: Masami Hiramatsu 

Add a devicetree-binding YAML file for the FWU metadata on MTD
devices without GPT.

Signed-off-by: Masami Hiramatsu 
Signed-off-by: Sughosh Ganu 
---
  .../firmware/uboot,fwu-mdata-mtd.yaml | 38 +++
  1 file changed, 38 insertions(+)
  create mode 100644 doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml

diff --git a/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml 
b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
new file mode 100644
index 00..4f5404f999
--- /dev/null
+++ b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-sf.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: FWU metadata on MTD device without GPT
+
+maintainers:
+ - Masami Hiramatsu 
+
+properties:
+  compatible:
+items:
+  - const: u-boot,fwu-mdata-mtd
+
+  fwu-mdata-store:
+maxItems: 1
+description: Phandle of the MTD device which contains the FWU medatata.
+
+  mdata-offsets:
+minItems: 2
+description: Offsets of the primary and secondary FWU metadata in the NOR 
flash.
+
+required:
+  - compatible
+  - fwu-mdata-store
+  - mdata-offsets
+
+additionalProperties: false
+
+examples:
+  - |
+fwu-mdata {
+compatible = "u-boot,fwu-mdata-mtd";
+fwu-mdata-store = <>;
+mdata-offsets = <0x50 0x53>;
+};


Do you need to have offset her => normally it is already managed by mtd 
partition



    spi-flash@0 {
    #address-cells = <1>;
    #size-cells = <1>;
    compatible = "spi-flash", "jedec,spi-nor";

    metadata1: partition@metadata1 {
        reg = <0x50 0x3>;
        label = "metadata1";
    };
    metadata2: partition@metadata2 {
        reg = <0x53 0x3>;
        label = "metadata2";
    };

    };


So the needed offset information can be found with 2 handles

to the MTD partitions in the device tree !

+fwu-mdata {
+compatible = "u-boot,fwu-mdata-mtd";
+fwu-mdata-store = <>, <>;
+};


This proposal can simplify the binding

+  fwu-mdata-store:
+maxItems: 2
+description: Phandle of the two MTD partitions which contains the FWU 
medatata.

+required:
+  - compatible
+  - fwu-mdata-store

Patrick



Re: [PATCH v5 14/23] dt/bindings: firmware: Add FWU metadata on MTD devices binding

2022-06-21 Thread Etienne Carriere
On Thu, 9 Jun 2022 at 14:31, Sughosh Ganu  wrote:
>
> From: Masami Hiramatsu 
>
> Add a devicetree-binding YAML file for the FWU metadata on MTD
> devices without GPT.
>
> Signed-off-by: Masami Hiramatsu 
> Signed-off-by: Sughosh Ganu 
> ---
>  .../firmware/uboot,fwu-mdata-mtd.yaml | 38 +++
>  1 file changed, 38 insertions(+)
>  create mode 100644 doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
>
> diff --git a/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml 
> b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
> new file mode 100644
> index 00..4f5404f999
> --- /dev/null
> +++ b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
> @@ -0,0 +1,38 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-sf.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: FWU metadata on MTD device without GPT
> +
> +maintainers:
> + - Masami Hiramatsu 
> +
> +properties:
> +  compatible:
> +items:
> +  - const: u-boot,fwu-mdata-mtd
> +
> +  fwu-mdata-store:
> +maxItems: 1
> +description: Phandle of the MTD device which contains the FWU medatata.
> +
> +  mdata-offsets:
> +minItems: 2
> +description: Offsets of the primary and secondary FWU metadata in the 
> NOR flash.
> +
> +required:
> +  - compatible
> +  - fwu-mdata-store
> +  - mdata-offsets
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +fwu-mdata {
> +compatible = "u-boot,fwu-mdata-mtd";
> +fwu-mdata-store = <>;
> +mdata-offsets = <0x50 0x53>;

Is a single 32bit value sufficient to define a block offset in an MTD
device? I was thinking of NAND with a density > 4GByte.

> +};

> --
> 2.25.1
>


[PATCH v5 14/23] dt/bindings: firmware: Add FWU metadata on MTD devices binding

2022-06-09 Thread Sughosh Ganu
From: Masami Hiramatsu 

Add a devicetree-binding YAML file for the FWU metadata on MTD
devices without GPT.

Signed-off-by: Masami Hiramatsu 
Signed-off-by: Sughosh Ganu 
---
 .../firmware/uboot,fwu-mdata-mtd.yaml | 38 +++
 1 file changed, 38 insertions(+)
 create mode 100644 doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml

diff --git a/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml 
b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
new file mode 100644
index 00..4f5404f999
--- /dev/null
+++ b/doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
@@ -0,0 +1,38 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-sf.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: FWU metadata on MTD device without GPT
+
+maintainers:
+ - Masami Hiramatsu 
+
+properties:
+  compatible:
+items:
+  - const: u-boot,fwu-mdata-mtd
+
+  fwu-mdata-store:
+maxItems: 1
+description: Phandle of the MTD device which contains the FWU medatata.
+
+  mdata-offsets:
+minItems: 2
+description: Offsets of the primary and secondary FWU metadata in the NOR 
flash.
+
+required:
+  - compatible
+  - fwu-mdata-store
+  - mdata-offsets
+
+additionalProperties: false
+
+examples:
+  - |
+fwu-mdata {
+compatible = "u-boot,fwu-mdata-mtd";
+fwu-mdata-store = <>;
+mdata-offsets = <0x50 0x53>;
+};
-- 
2.25.1