public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: jassisinghbrar@gmail.com
Cc: u-boot@lists.denx.de, sughosh.ganu@linaro.org,
	etienne.carriere@linaro.org, trini@konsulko.com,
	sjg@chromium.org, xypron.glpk@gmx.de,
	patrick.delaunay@foss.st.com, patrice.chotard@foss.st.com,
	Jassi Brar <jaswinder.singh@linaro.org>
Subject: Re: [PATCH v6 1/7] dt/bindings: fwu-mdata-mtd: drop changes outside FWU
Date: Fri, 9 Jun 2023 10:42:50 +0300	[thread overview]
Message-ID: <ZILX+ocE2KH3cdEX@hades> (raw)
In-Reply-To: <20230306231814.1888547-1-jassisinghbrar@gmail.com>

On Mon, Mar 06, 2023 at 05:18:14PM -0600, jassisinghbrar@gmail.com wrote:
> From: Jassi Brar <jaswinder.singh@linaro.org>
> 
> Any requirement of FWU should not require changes to bindings
> of other subsystems. For example, for mtd-backed storage we
> can do without requiring 'fixed-partitions' children to also
> carry 'uuid', a property which is non-standard and not in the
> bindings.
> 


The existing bindings were constructed like that in case we wanted to
upstream the dt-bindings.  But I think we are fine keeping it as an
internal ABI for now.  Note here that we will need to strip this eventually
before we hand over the dtb into linux, but that's a different story.  In
any case as long as the DT comes from u-boot I don't think we will have a
risk of introducing compatibility issues if we ever upstream this and go
back to the old format. 

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

>  There exists no code yet, so we can change the fwu-mtd bindings
> to contain all properties within the fwu-mdata node.
> 
> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
> ---
>  .../firmware/fwu-mdata-mtd.yaml               | 105 +++++++++++++++---
>  1 file changed, 91 insertions(+), 14 deletions(-)
> 
> diff --git a/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml b/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml
> index 4f5404f999..6a22aeea30 100644
> --- a/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml
> +++ b/doc/device-tree-bindings/firmware/fwu-mdata-mtd.yaml
> @@ -1,13 +1,13 @@
>  # 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#
> +$id: http://devicetree.org/schemas/firmware/u-boot,fwu-mdata-mtd.yaml#
> +$schema: http://devicetree.org/meta-schemas/base.yaml#
>  
>  title: FWU metadata on MTD device without GPT
>  
>  maintainers:
> - - Masami Hiramatsu <masami.hiramatsu@linaro.org>
> + - Jassi Brar <jaswinder.singh@linaro.org>
>  
>  properties:
>    compatible:
> @@ -15,24 +15,101 @@ properties:
>        - const: u-boot,fwu-mdata-mtd
>  
>    fwu-mdata-store:
> -    maxItems: 1
> -    description: Phandle of the MTD device which contains the FWU medatata.
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: Phandle of the MTD device which contains the FWU MetaData and Banks.
>  
> -  mdata-offsets:
> +  mdata-parts:
> +    $ref: /schemas/types.yaml#/definitions/non-unique-string-array
>      minItems: 2
> -    description: Offsets of the primary and secondary FWU metadata in the NOR flash.
> +    maxItems: 2
> +    description: labels of the primary and secondary FWU metadata partitions in the 'fixed-partitions' subnode of the 'jedec,spi-nor' flash device node.
> +
> +  patternProperties:
> +    "fwu-bank[0-9]":
> +    type: object
> +    description: List of FWU mtd-backed banks. Typically two banks.
> +
> +    properties:
> +      id:
> +        $ref: /schemas/types.yaml#/definitions/uint32
> +        description: Index of the bank.
> +
> +      label:
> +        $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> +        minItems: 1
> +        maxItems: 1
> +        description: label of the partition, in the 'fixed-partitions' subnode of the 'jedec,spi-nor' flash device node, that holds this bank.
> +
> +      patternProperties:
> +        "fwu-image[0-9]":
> +        type: object
> +        description: List of images in the FWU mtd-backed bank.
> +
> +        properties:
> +          id:
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +            description: Index of the bank.
> +
> +          offset:
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +            description: Offset, from start of the bank, where the image is located.
> +
> +          size:
> +            $ref: /schemas/types.yaml#/definitions/uint32
> +            description: Size reserved for the image.
> +
> +          uuid:
> +            $ref: /schemas/types.yaml#/definitions/non-unique-string-array
> +            minItems: 1
> +            maxItems: 1
> +            description: UUID of the image.
> +
> +        required:
> +          - id
> +          - offset
> +          - size
> +          - uuid
> +        additionalProperties: false
> +
> +    required:
> +      - id
> +      - label
> +      - fwu-images
> +    additionalProperties: false
>  
>  required:
>    - compatible
>    - fwu-mdata-store
> -  - mdata-offsets
> -
> +  - mdata-parts
> +  - fwu-banks
>  additionalProperties: false
>  
>  examples:
>    - |
> -    fwu-mdata {
> -        compatible = "u-boot,fwu-mdata-mtd";
> -        fwu-mdata-store = <&spi-flash>;
> -        mdata-offsets = <0x500000 0x530000>;
> -    };
> +	fwu-mdata {
> +		compatible = "u-boot,fwu-mdata-mtd";
> +		fwu-mdata-store = <&flash0>;
> +		mdata-parts = "MDATA-Pri", "MDATA-Sec";
> +
> +		fwu-bank0 {
> +			id = <0>;
> +			label = "FIP-Bank0";
> +			fwu-image0 {
> +				id = <0>;
> +				offset = <0x0>;
> +				size = <0x400000>;
> +				uuid = "5a66a702-99fd-4fef-a392-c26e261a2828";
> +			};
> +		};
> +		fwu-bank1 {
> +			id = <1>;
> +			label = "FIP-Bank1";
> +			fwu-image0 {
> +				id = <0>;
> +				offset = <0x0>;
> +				size = <0x400000>;
> +				uuid = "a8f868a1-6e5c-4757-878d-ce63375ef2c0";
> +			};
> +		};
> +	};
> +...
> -- 
> 2.34.1
> 

  reply	other threads:[~2023-06-09  7:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-06 23:17 [PATCH v6 0/7] fwu: gpt: implement read_mdata and write_mdata callbacks jassisinghbrar
2023-03-06 23:18 ` [PATCH v6 1/7] dt/bindings: fwu-mdata-mtd: drop changes outside FWU jassisinghbrar
2023-06-09  7:42   ` Ilias Apalodimas [this message]
2023-03-06 23:18 ` [PATCH v6 2/7] fwu: gpt: use cached meta-data partition numbers jassisinghbrar
2023-03-06 23:18 ` [PATCH v6 3/7] fwu: move meta-data management in core jassisinghbrar
2023-03-16  8:25   ` Ilias Apalodimas
2023-03-06 23:18 ` [PATCH v6 4/7] fwu: gpt: implement read_mdata and write_mdata callbacks jassisinghbrar
2023-03-06 23:18 ` [PATCH v6 5/7] fwu: meta-data: switch to management by common code jassisinghbrar
2023-03-16  8:26   ` Ilias Apalodimas
2023-03-16  8:47     ` Sughosh Ganu
2023-03-06 23:18 ` [PATCH v6 6/7] fwu: rename fwu_get_verified_mdata to fwu_get_mdata jassisinghbrar
2023-03-06 23:18 ` [PATCH v6 7/7] test: dm: fwu: fix for the updated api jassisinghbrar
2023-03-15  9:28   ` Ilias Apalodimas
2023-03-24 12:05 ` [PATCH v6 0/7] fwu: gpt: implement read_mdata and write_mdata callbacks Sughosh Ganu
2023-06-10  0:37 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZILX+ocE2KH3cdEX@hades \
    --to=ilias.apalodimas@linaro.org \
    --cc=etienne.carriere@linaro.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=jaswinder.singh@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox