[PATCH v3 06/12] binman: Support generating FITs with multiple dtbs

Samuel Holland samuel at sholland.org
Sun Sep 6 00:41:09 CEST 2020


On 9/1/20 6:13 AM, Simon Glass wrote:
> In some cases it is useful to generate a FIT which has a number of DTB
> images, selectable by configuration. Add support for this in binman,
> using a simple iterator and string substitution.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> 
> Changes in v3:
> - Rebase on top of earlier binman series
> 
> Changes in v2:
> - Add a check for a missing fit,fdt-list property
> - Add a check for a missing of-list property
> - Add a check for an empty of-list
> 
>  tools/binman/README.entries                   |  48 +++++++-
>  tools/binman/etype/fit.py                     |  94 +++++++++++++++-
>  tools/binman/ftest.py                         | 106 +++++++++++++++++-
>  tools/binman/test/170_fit_fdt.dts             |  55 +++++++++
>  .../binman/test/171_fit_fdt_missing_prop.dts  |  54 +++++++++
>  5 files changed, 346 insertions(+), 11 deletions(-)
>  create mode 100644 tools/binman/test/170_fit_fdt.dts
>  create mode 100644 tools/binman/test/171_fit_fdt_missing_prop.dts

[snip]

> @@ -357,7 +358,52 @@ For example, this creates an image containing a FIT with U-Boot SPL:
>          };
>      };
>  
> -Properties:
> +U-Boot supports creating fdt and config nodes automatically. To do this,
> +pass an of-list property (e.g. -a of-list=file1 file2). This tells binman
> +that you want to generates nodes for two files: file1.dtb and file2.dtb
> +The fit,fdt-list property (see above) indicates that of-list should be used.
> +If the property is missing you will get an error.
> +
> +Then add a 'generator node', a node with a name starting with '@':
> +
> +    images {
> +        @fdt-SEQ {
> +            description = "fdt-NAME";
> +            type = "flat_dt";
> +            compression = "none";
> +        };
> +    };
> +
> +This tells binman to create nodes fdt-1 and fdt-2 for each of your two
> +files. All the properties you specify will be included in the node. This
> +node acts like a template to generate the nodes. The generator node itself
> +does not appear in the output - it is replaced with what binman generates.

Is this output written anywhere? The compiled DTB has the unprocessed template
in it, and the final image created by binman requires some dissection to get to
the FIT ITS.

> +
> +You can create config nodes in a similar way:
> +
> +    configurations {
> +        default = "@config-DEFAULT-SEQ";
> +        @config-SEQ {
> +            description = "NAME";
> +            firmware = "uboot";
> +            loadables = "atf";
> +            fdt = "fdt-SEQ";
> +        };
> +    };
> +
> +This tells binman to create nodes config-1 and config-2, i.e. a config for
> +each of your two files.
> +
> +Available substitutions for '@' nodes are:
> +
> +    SEQ    Sequence number of the generated fdt (1, 2, ...)
> +    NAME   Name of the dtb as provided (i.e. without adding '.dtb')

There is no mention of DEFAULT-SEQ here.

> +
> +Note that if no devicetree files are provided (with '-a of-list' as above)
> +then no nodes will be generated.
> +
> +
> +Properties (in the 'fit' node itself):
>      fit,external-offset: Indicates that the contents of the FIT are external
>          and provides the external offset. This is passsed to mkimage via
>          the -E and -p flags.

[snip]


More information about the U-Boot mailing list