All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v4 1/3] binman: Allow selecting default FIT configuration
Date: Sat, 26 Sep 2020 18:59:41 -0700	[thread overview]
Message-ID: <CAPnjgZ0e1OYvgio9TLEpZ1_Zf=60_pA0RTxjsaf9Z6R7Jd3Ghw@mail.gmail.com> (raw)
In-Reply-To: <95d2a41c-4de9-6e10-c4bc-2166f0bbd074@gmail.com>

On 09/09/2020 02:56, Simon Glass wrote:
> On Tue, 8 Sep 2020 at 11:33, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>> 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__.

That works too, I just wanted it to feel very out-of-place as a node
name and that was the first thing to pop into my mind.

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

I was thinking that it'd only substitute the thing in "for,variable" so
it wouldn't be ambiguous, but indeed ${name} is better.

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

That's true. At least, better to put it off until it's needed in other
places and then attempt a proper design. I'm not sure that something
like this has to be turing-complete to be useful, though it could easily
end up turing-complete by accident.

Applied to u-boot-dm/next, thanks!

  parent reply	other threads:[~2020-09-27  1:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-06 16:39 [PATCH v4 0/3] binman: Further updates for FIT support Simon Glass
2020-09-06 16:39 ` [PATCH v4 1/3] binman: Allow selecting default FIT configuration Simon Glass
2020-09-08 17:33   ` Alper Nebi Yasak
2020-09-08 23:56     ` Simon Glass
2020-09-09 20:27       ` Alper Nebi Yasak
2020-09-27  1:59       ` Simon Glass [this message]
2020-09-06 16:39 ` [PATCH v4 2/3] binman: Support help messages for missing blobs Simon Glass
2020-09-08 16:37   ` Alper Nebi Yasak
2020-09-08 23:56     ` Simon Glass
2020-09-09 20:29       ` Alper Nebi Yasak
2020-09-27  1:59       ` Simon Glass
2020-09-06 16:39 ` [PATCH v4 3/3] binman: sunxi: Add help message for missing sunxi ATF BL31 Simon Glass
2020-09-07  8:44 ` [PATCH v4 0/3] binman: Further updates for FIT support Michal Simek
2020-09-07 13:57   ` Simon Glass
2020-09-12 20:43   ` Samuel Holland
2020-09-14  6:48     ` Michal Simek

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='CAPnjgZ0e1OYvgio9TLEpZ1_Zf=60_pA0RTxjsaf9Z6R7Jd3Ghw@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.