All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v3 06/12] binman: Support generating FITs with multiple dtbs
Date: Sat, 5 Sep 2020 18:18:11 -0600	[thread overview]
Message-ID: <CAPnjgZ09jmJi7m9EzfM__zHL4s9z1HU+iebSmoE7f1V034ixhg@mail.gmail.com> (raw)
In-Reply-To: <c9a50dba-3580-9269-93a5-cf98ae82a99d@sholland.org>

Hi Samuel,

On Sat, 5 Sep 2020 at 16:41, Samuel Holland <samuel@sholland.org> wrote:
>
> 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@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.

Yes both the input to mkimage and the output are written out. See the
build directory for these files, which are named after the node names.

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

That feature is added in a later patch. I will make sure it is documented 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]

Regards,
Simon

  parent reply	other threads:[~2020-09-06  0:18 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-01 11:13 [PATCH v3 00/12] binman: Add support for generating more complex FITs Simon Glass
2020-09-01 11:13 ` [PATCH v3 01/12] binman: Allow entry args to be required Simon Glass
2020-09-01 11:13 ` [PATCH v3 02/12] binman: Fix up a few missing comments Simon Glass
2020-09-01 11:13 ` [PATCH v3 03/12] libfdt: Detected out-of-space with fdt_finish() Simon Glass
2020-09-01 11:13 ` [PATCH v3 04/12] binman: Move 'external' support into base class Simon Glass
2020-09-01 11:13 ` [PATCH v3 05/12] binman: Add support for ATF BL31 Simon Glass
2020-09-05 22:57   ` Samuel Holland
2020-09-06  0:17     ` Simon Glass
2020-09-01 11:13 ` [PATCH v3 06/12] binman: Support generating FITs with multiple dtbs Simon Glass
2020-09-05 22:41   ` Samuel Holland
2020-09-05 23:19     ` Samuel Holland
2020-09-06  0:17       ` Simon Glass
2020-09-06  0:18     ` Simon Glass [this message]
2020-09-01 11:14 ` [PATCH v3 07/12] Makefile: Support missing external blobs always Simon Glass
2020-09-01 11:14 ` [PATCH v3 08/12] sunxi: Convert 64-bit boards to use binman Simon Glass
2020-09-05 23:10   ` Samuel Holland
2020-09-05 23:42     ` Samuel Holland
2020-09-06  0:17       ` Simon Glass
2020-09-06  0:18     ` Simon Glass
2020-09-06  1:49       ` Samuel Holland
2020-09-06  2:22         ` Simon Glass
2020-09-07 13:01       ` Michal Simek
2020-09-07 13:57         ` Simon Glass
2020-09-01 11:14 ` [PATCH v3 09/12] sunxi: Drop the FIT-generator script Simon Glass
2020-09-01 11:14 ` [PATCH v3 10/12] binman: Allow selecting default FIT configuration Simon Glass
2020-09-01 11:14 ` [PATCH v3 11/12] binman: Support help messages for missing blobs Simon Glass
2020-09-01 11:14 ` [PATCH v3 12/12] binman: sunxi: Add help message for missing sunxi ATF BL31 Simon Glass
2020-09-02 10:26 ` [PATCH v3 00/12] binman: Add support for generating more complex FITs Michal Simek
2020-09-02 17:07   ` Simon Glass
2020-09-03 13:31     ` Michal Simek
2020-09-05 21:10 ` [PATCH v3 07/12] Makefile: Support missing external blobs always Simon Glass
2020-09-05 21:10 ` [PATCH v3 06/12] binman: Support generating FITs with multiple dtbs Simon Glass
2020-09-05 21:10 ` [PATCH v3 05/12] binman: Add support for ATF BL31 Simon Glass
2020-09-05 21:10 ` [PATCH v3 04/12] binman: Move 'external' support into base class Simon Glass
2020-09-05 21:10 ` [PATCH v3 03/12] libfdt: Detected out-of-space with fdt_finish() Simon Glass
2020-09-05 21:10 ` [PATCH v3 02/12] binman: Fix up a few missing comments Simon Glass
2020-09-05 21:10 ` [PATCH v3 01/12] binman: Allow entry args to be required Simon Glass
2020-09-07  6:31   ` Michal Simek
2020-09-07 13:57     ` Simon Glass

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=CAPnjgZ09jmJi7m9EzfM__zHL4s9z1HU+iebSmoE7f1V034ixhg@mail.gmail.com \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.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 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.