public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Alper Nebi Yasak <alpernebiyasak@gmail.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>,
	huang lin <hl@rock-chips.com>,
	Jeffy Chen <jeffy.chen@rock-chips.com>,
	Kever Yang <kever.yang@rock-chips.com>,
	Tom Rini <trini@konsulko.com>,
	Philippe Reynes <philippe.reynes@softathome.com>,
	Ivan Mikhaylov <ivan.mikhaylov@siemens.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Subject: Re: [PATCH 20/24] binman: Support splitting an ELF file into multiple nodes
Date: Fri, 4 Mar 2022 00:07:30 +0300	[thread overview]
Message-ID: <4829ce0f-89ef-59c6-864a-2af5f0140183@gmail.com> (raw)
In-Reply-To: <CAPnjgZ3ebmWcfATygmZaLS=5eeRv-sJN-i=ZzdKgi8AK-vu_=g@mail.gmail.com>

On 24/02/2022 01:59, Simon Glass wrote:
> On Tue, 15 Feb 2022 at 04:53, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote:
>> On 08/02/2022 21:50, Simon Glass wrote:
>>> +    fit,load
>>> +        Generates a `load = <...>` property with the load address of the
>>> +        segmnet
>>> +
>>> +    fit,entry
>>> +        Generates a `entry = <...>` property with the entry address of the
>>> +        ELF. This is only produced for the first entry
>>> +
>>> +    fit,data
>>> +        Generates a `data = <...>` property with the contents of the segment
>>
>> I think all these should be done by default. I don't see the point of
>> not setting the properties, or setting them manually to values that will
>> be the same for multiple nodes.
> 
> My intent is to make things discoverable and obvious, so that magic
> processing is explicit.

OK then.

>> Instead of putting these into the images subnode, we could have
>> images-level subnodes for the operations. For example, instead of the above:
>>
>>            images@gen-fdt-nodes {
>>                fdt-list = "of-list";
>>
>>                fdt {
>>                    type = "flat_dt";
>>                    compression = "none";
>>                };
>>            };
> 
> What does that mean, though? I presume it creates a second images {}
> node, which is fine as dtc will merge them. But what about ordering?

I imagined images@oper, configurations@oper would be binman-only control
nodes that generate and append arbitrary nodes/entries inside whatever
node name precedes the @oper. The meaning of what's inside the @oper
nodes and what's generated would be solely defined by the operation.

Honestly, I didn't think of ordering because I assumed it didn't matter
inside FIT. It's a shortcoming of this design if it's important.

> I certainly prefer this in terms of elegance. I'm just not convinced
> that people will understand it as well.
> 
>>
>> We can remove the -SEQ if we always append a sequence number, and we can
>> set "description" to "NAME.dtb" when it's missing, or do the replacement
>> when it's given. We can go further and use "%s", "%(name)s" or "{name}"
>> instead of "NAME" for python-ish formatting and likewise for the
>> sequence number.
> 
> Yes, but again this adds more magic. For the Python formatting, we
> still need to restrict what is put in there - e.g. we cannot just eval
> an arbitrary varaible.

Python only formats with what you give it (except for f-strings):

    >>> val = "test"
    >>> vals = {"name": "rk3399-gru-kevin", "seq": 1}

    >>> "conf-%(seq)d: %(name)s.dtb" % vals
    'conf-1: rk3399-gru-kevin.dtb'

    >>> "%(val)s" % vals
    KeyError: 'val'

    >>> "conf-{seq}: {name}.dtb".format(**vals)
    'conf-1: rk3399-gru-kevin.dtb'

    >>> "{val}".format(**vals)
    KeyError: 'val'

But neither format style can go in a node name, so if you want the
sequence number explicit in those I guess we're stuck with -SEQ and
everything consistent with it.

>>> [...]
> 
> We should talk about this some more though. I'm a bit worried it will
> get complaints about too much magic. I am trying to make it obvious
> that nodes get generated in certain places.

OK. I know I'm too biased towards magic, so won't insist much on those
parts.

> [...]
> 
> Thanks for all the comments and ideas. I think this all need a little
> more thought...

I'll try replying to the v2 for the things changed in v2.

  reply	other threads:[~2022-03-03 21:15 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-08 18:49 [PATCH 00/24] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Simon Glass
2022-02-08 18:49 ` [PATCH 01/24] moveconfig: Show the config name rather than the defconfig Simon Glass
2022-02-15 11:40   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-23  2:43       ` Simon Glass
2022-02-08 18:49 ` [PATCH 02/24] moveconfig: Allow regex matches when finding combinations Simon Glass
2022-02-15 11:41   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-08 18:49 ` [PATCH 03/24] spl: x86: Correct the binman symbols for SPL Simon Glass
2022-02-15 11:42   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-23 22:58     ` Simon Glass
2022-03-03 21:06       ` Alper Nebi Yasak
2022-03-06  3:07         ` Simon Glass
2022-02-08 18:49 ` [PATCH 04/24] spl: Allow disabling binman symbols in SPL Simon Glass
2022-02-15 11:42   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-08 18:49 ` [PATCH 05/24] rockchip: evb-rk3288: Drop raw-image support Simon Glass
2022-02-08 18:49 ` [PATCH 06/24] dtoc: Support adding a string list to a device tree Simon Glass
2022-02-15 11:43   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-23 22:58     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak
2022-03-06  3:07         ` Simon Glass
2022-02-08 18:49 ` [PATCH 07/24] dtoc: Support deleting a node Simon Glass
2022-02-08 18:49 ` [PATCH 08/24] dtoc: Allow deleting nodes and adding them in the same sync Simon Glass
2022-02-08 18:49 ` [PATCH 09/24] dtoc: Support reading a list of arguments Simon Glass
2022-02-15 11:43   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-23 22:58     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak
2022-02-08 18:49 ` [PATCH 10/24] binman: Update docs to indicate mkimage is supported Simon Glass
2022-02-23  2:35   ` Simon Glass
2022-02-08 18:49 ` [PATCH 11/24] elf: Add a way to read segment information from an ELF file Simon Glass
2022-02-15 11:44   ` Alper Nebi Yasak
2022-02-23  2:35     ` Simon Glass
2022-02-23 22:58     ` Simon Glass
2022-02-08 18:49 ` [PATCH 12/24] WIP: binman: Add support for OP-TEE Simon Glass
2022-02-08 18:49 ` [PATCH 13/24] binman: Add to the TODO Simon Glass
2022-02-08 18:49 ` [PATCH 14/24] binman: Support a list of strings with the mkimage etype Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23  2:34     ` Simon Glass
2022-02-23 22:59     ` Simon Glass
2022-02-08 18:49 ` [PATCH 15/24] binman: Add a ELF test file with disjoint text sections Simon Glass
2022-02-08 18:50 ` [PATCH 16/24] binman: Move entry-data collection into a Entry method Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23  2:34     ` Simon Glass
2022-02-08 18:50 ` [PATCH 17/24] binman: fit: Refactor to reduce function size Simon Glass
2022-02-15 11:45   ` Alper Nebi Yasak
2022-02-23  2:34     ` Simon Glass
2022-02-23 22:59     ` Simon Glass
2022-02-08 18:50 ` [PATCH 18/24] binman: Tidy up the docs a little with fit Simon Glass
2022-02-08 18:50 ` [PATCH 19/24] binman: Allow different operations in FIT generator nodes Simon Glass
2022-02-23  2:34   ` Simon Glass
2022-02-08 18:50 ` [PATCH 20/24] binman: Support splitting an ELF file into multiple nodes Simon Glass
2022-02-15 11:46   ` Alper Nebi Yasak
2022-02-23 22:59     ` Simon Glass
2022-03-03 21:07       ` Alper Nebi Yasak [this message]
2022-03-06  3:07         ` Simon Glass
2022-02-08 18:50 ` [PATCH 21/24] rockchip: Include binman script in 64-bit boards Simon Glass
2022-02-08 18:50 ` [PATCH 22/24] rockchip: Support building the all output files in binman Simon Glass
2022-02-10 15:03   ` Peter Geis
2022-02-10 18:57     ` Simon Glass
2022-02-10 19:32       ` Peter Geis
2022-02-14  1:28         ` Peter Geis
2022-02-15 11:48   ` Alper Nebi Yasak
2022-02-08 18:50 ` [PATCH 23/24] rockchip: Convert all boards to use binman Simon Glass
2022-02-08 18:50 ` [PATCH 24/24] rockchip: Drop the FIT generator script Simon Glass
2022-02-11 15:22 ` [PATCH 00/24] binman: rockchip: Migrate from rockchip SPL_FIT_GENERATOR script Alper Nebi Yasak

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=4829ce0f-89ef-59c6-864a-2af5f0140183@gmail.com \
    --to=alpernebiyasak@gmail.com \
    --cc=hl@rock-chips.com \
    --cc=ivan.mikhaylov@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jeffy.chen@rock-chips.com \
    --cc=kever.yang@rock-chips.com \
    --cc=philippe.reynes@softathome.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox