[PATCH v4 1/3] binman: Allow selecting default FIT configuration

Simon Glass sjg at chromium.org
Wed Sep 9 01:56:11 CEST 2020


Hi Alper,

On Tue, 8 Sep 2020 at 11:33, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>
> On 06/09/2020 19:39, Simon Glass wrote:
> > Add a new entry argument to the fit entry which allows selection of the
> > default configuration to use. This is the 'default' property in the
> > 'configurations' node.
> >
> > Update the Makefile to pass in the value of DEVICE_TREE or
> > CONFIG_DEFAULT_DEVICE_TREE to provide this information.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > Suggested-by: Michal Simek <michal.simek at xilinx.com>
> > ---
> >
> > Changes in v4:
> > - Add more documentation for DEFAULT-SEQ
>
> I might be too late to say this but the SEQ thing looks ugly to me.
> Maybe there could be some generic control-flow-like nodes that could
> generate and insert things in their own place. If it makes sense, I'm
> imagining something like:
>
>     fit {
>         images {
>             __for__ {
>                 for,variable = "name";
>                 for,in-args = "of-list";
>
>                 fdt-#name {
>                     description = "fdt-$name.dtb";
>                     type = "flat_dt";
>                     compression = "none";
>                 };
>             };
>         };
>
>         configurations {
>             __for__ {
>                 for,variable = "name"
>                 for,in-args = "of-list";
>
>                 __if__ {
>                     if,arg-equals = "default-dt", "$name";
>                     default = "config-#name";
>                 };
>
>                 config-#name {
>                     description = "conf-$name.dtb";
>                     fdt = "fdt-#name";
>                 };
>             };
>         };
>     };

I certainly like the flexibility of this and I fiddled with something
similar (without the __if__ as I didn't have 'default support) before
going with a hard-coded approach. I agree what I have is ugly and I'm
pleased to get some feedback.

I think we could use _for instead of __for__.

For $name I avoided that because it only works if there is a
non-character afterwards, e.g. $namex is ambiguous. I briefly played
with ${name} and {name} but ended up with the ugly capitals.

The biggest question in my mind is whether we want our device-tree
templates to be turing-complete. It seems nice but I feel that what
you have above is much harder to understand and get right.

Regards,
Simon


More information about the U-Boot mailing list