From: Tom Rini <trini@konsulko.com>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Simon Glass <sjg@chromium.org>,
Michal Simek <michal.simek@amd.com>,
U-Boot Mailing List <u-boot@lists.denx.de>,
Marek Vasut <marex@denx.de>, Baruch Siach <baruch@tkos.co.il>,
Bin Meng <bmeng.cn@gmail.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Nikhil M Jain <n-jain1@ti.com>, Qu Wenruo <wqu@suse.com>,
Stefan Roese <sr@denx.de>
Subject: Re: [PATCH 30/32] fdt: Allow the devicetree to come from a bloblist
Date: Fri, 20 Oct 2023 09:59:49 -0400 [thread overview]
Message-ID: <20231020135949.GI3119521@bill-the-cat> (raw)
In-Reply-To: <CAC_iWjJwLtF7L-NRo-nkO4qM8wotd0FyePYVS9mGewCjQkjbRQ@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 8173 bytes --]
On Fri, Oct 20, 2023 at 11:21:29AM +0300, Ilias Apalodimas wrote:
> Hi Simon,
>
> On Wed, 18 Oct 2023 at 18:26, Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Ilias,
> >
> > On Mon, 25 Sept 2023 at 04:19, Ilias Apalodimas
> > <ilias.apalodimas@linaro.org> wrote:
> > >
> > > Hi Simon,
> > >
> > > [...]
> > >
> > > > > > >>>>>>>>>> +config OF_BLOBLIST
> > > > > > >>>>>>>>>> + bool "DTB is provided by a bloblist"
> > > > > > >>>>>>>>>> + help
> > > > > > >>>>>>>>>> + Select this to read the devicetree from the bloblist. This allows
> > > > > > >>>>>>>>>> + using a bloblist to transfer the devicetree between U-Boot phases.
> > > > > > >>>>>>>>>> + The devicetree is stored in the bloblist by an early phase so that
> > > > > > >>>>>>>>>> + U-Boot can read it.
> > > > > > >>>>>>>>>> +
> > > > > > >>>>>>>>>
> > > > > > >>>>>>>>> I dont think this is a good idea. We used to have 4-5 different options
> > > > > > >>>>>>>>> here, which we tried to clean up and ended up with two very discrete
> > > > > > >>>>>>>>> options. Why do we have to reintroduce a new one? Doesn't that bloblist
> > > > > > >>>>>>>>> have a header of some sort? The bloblist literally comes from a previous
> > > > > > >>>>>>>>> stage bootloader which is what OF_BOARD is here for. So why can't we just
> > > > > > >>>>>>>>> read the header and figure out if the magic of the bloblist matches?
> > > > > > >>>>>>>>
> > > > > > >>>>>>>> No, OF_BOARD is a hack to allow boards to do what they like with the FDT.
> > > > > > >>>>>>>>
> > > > > > >>>>>>>> This patch is a standard mechanism to pass the DT from one firmware
> > > > > > >>>>>>>> phase to the next. We have spent quite a bit of time creating a spec
> > > > > > >>>>>>>> for it, and we should use it.
> > > > > > >>>>>>>
> > > > > > >>>>>>> Where exactly am I objecting using the spec? Can you please re-read my email?
> > > > > > >>>>>>> I am actually pointing out we should use the spec *properly*. So
> > > > > > >>>>>>> instead of having a Kconfig option for the DT, which is pretty
> > > > > > >>>>>>> pointless, we should parse the bloblist. If the header defined by
> > > > > > >>>>>>> the *spec* is found, we should just search for the DT in there.
> > > > > > >>>>>>> What you are doing here, is take the spec, pick a very specific item
> > > > > > >>>>>>> that the list contains, and create a Kconfig option out of it. Which
> > > > > > >>>>>>> basically ignores the discoverable options of the bloblist. For
> > > > > > >>>>>>> example, that bloblist can also contain an entry to a TPM eventlog.
> > > > > > >>>>>>> Should we start creating Kconfig options for all the firmware handoff
> > > > > > >>>>>>> entries that are defined on that spec?
> > > > > > >>>>>>
> > > > > > >>>>>> OK so that is a different thing. What should it do if it expects to find a bloblist but cannot? I want it to throw an error, because I am trying to make the boot deterministic. What do you think?
> > > > > > >>>>>
> > > > > > >>>>> That's fine by me. You can even put that under IS_ENABLED for the
> > > > > > >>>>> bloblist inside the existing OF_BOARD check. So I was thinking
> > > > > > >>>>> - If no bloblist is required in Kconfig options we do the hacks we used to
> > > > > > >>>>> - if bloblist is selected and the config option is OF_BOARD, throw an
> > > > > > >>>>> error and mention that the previous stage loader should hand over a DT
> > > > > > >>>>>
> > > > > > >>>>> Is that what you had in mind?
> > > > > > >>>>
> > > > > > >>>> Yes, that sounds good to me.
> > > > > > >>>>
> > > > > > >>>> But I still think we need an OF_BLOBLIST option to control whether the
> > > > > > >>>> devicetree comes from there.
> > > > > > >>>> Otherwise we will end up with people
> > > > > > >>>> using OF_BOARD to work around it. We also have the SPL case which does
> > > > > > >>>> not pass the DT in a bloblist...in fact SPL typically doesn't even
> > > > > > >>>> have the full DT.
> > > > > > >>>
> > > > > > >>> Wouldn't IS_ENABLED(BLOBLIST) || IS_ENABLED(SPL_BLOBLIST) be enough?
> > > > > > >>> Inside the OF_BOARD portion of the function, search for a bloblist if
> > > > > > >>> the option is enabled. If you can't find a bloblist and the DT within
> > > > > > >>> that bloblist, then error out
> > > > > > >>
> > > > > > >> Just my 2c here.
> > > > > > >> I think all options should be possible to disable. It means I can imagine to
> > > > > > >> disable u-boot not to take care about DT provided from previous stage. The same
> > > > > > >> is for TPM event log. IMHO every stage should have an option to simply ignore
> > > > > > >> data pass from previous stage. I don't really mind how it is done but there
> > > > > > >> should be an option to by purpose say to ignore the part of pass data.
> > > > > > >
> > > > > > > That would be done by disabling BLOBLIST. I don't think having a Kconfig to say
> > > > > > > "I want a bloblist, but I only want the DT from there" is reasonable
> > > > > > > (or for any other item the bloblist can carry). OF_BOARD means the
> > > > > > > DT will come from a previous stage loader. If bloblist is enabled then
> > > > > > > the DT must come from there.
> > > > > >
> > > > > > I don't agree on this. If bloblist is enabled and DT is passed SW should have a
> > > > > > freedom to ignore it.
> > > > > >
> > > > > > At start everything is likely in sync but later stages before U-Boot can stay at
> > > > > > certain version but there could be a need to update u-boot where DT from
> > > > > > previous stage could be broken.
> > > > >
> > > > > But you *can* ignore it and load a different one later. The only
> > > > > restriction is that if you compile u-boot with the assumption an early
> > > > > stage bootloader provides a DT you *must* find it. But we will still
> > > > > just keep 2 options in U-Boot of how you get a DT.
> > > > > A previous loader provided it or U-Boot provided it. Whether that
> > > > > comes from a bloblist or a register is irrelevant no ?
> > > >
> > > > I'm not sure what is being requested here, so I'll leave this as is for v2.
> > >
> > > Please don't. A few mails above there's a discussion of how I'd
> > > prefer things to look like, please have a look and let me know if
> > > something isn't clear.
> > > tl;dr
> > > "That's fine by me. You can even put that under IS_ENABLED for the
> > > bloblist inside the existing OF_BOARD check. So I was thinking
> > > - If no bloblist is required in Kconfig options we do the hacks we used to
> > > - if bloblist is selected and the config option is OF_BOARD, throw an
> > > error and mention that the previous stage loader should hand over a DT"
> > >
> > > >
> > > > The main struggle I have is how to tell whether you expect to
> > > > *receive* the DT in the bloblist, or expect it to be attached to the
> > > > image and be *sent* to the next phase.
> > >
> > > bloblist
> > >
> > > >
> > > > SPL - attached to image, send in bloblist
> > > > U-Boot proper - not attached to image, receive it from bloblist
> > > >
> > > > This is exactly the problem that is solved by the 'standard passage'
> > > > stuff [1] but that depends on Firmware Handoff and [2] which are not
> > > > ready yet...
> > > >
> > > > So I think what I have is the best we can do for now.
> > >
> > > We can avoid the extra complication in Kconfigs. The DT either comes
> > > from u-boot itself or from a previous stage loader. we don't need the
> > > extra "it comes from a bloblist".
> > > If they come from a previous stage loader and BLOBLIST *is* enabled,
> > > then just scan for the DT, if you don't find it error out.
> >
> > Are you planning to send a patch for this? Otherwise, what do you
> > think about going with this one and dealing with OF_BOARD board by
> > board?
>
> Yes, I can do that. Since this patch is part of your series, I'll
> send it over to you and carry it there
The rest of this series, minus this patch has been merged. We should
just start a new series I think.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-10-20 13:59 UTC|newest]
Thread overview: 86+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 18:04 [PATCH 00/32] spl: Preparation for Universal Payload Simon Glass
2023-08-30 18:04 ` [PATCH 01/32] dm: core: support reading a single indexed u64 value Simon Glass
2023-08-30 18:04 ` [PATCH 02/32] spl: Use CONFIG_SPL... instead of CONFIG_..._SPL_ Simon Glass
2023-08-31 7:37 ` Marcel Ziswiler
2023-08-31 8:42 ` Martyn Welch
2023-08-31 9:22 ` Svyatoslav Ryhel
2023-08-30 18:04 ` [PATCH 03/32] spl: Rename SYS_SPL_ARGS_ADDR to SPL_SYS_ARGS_ADDR Simon Glass
2023-08-30 21:37 ` Tom Rini
2023-08-30 18:04 ` [PATCH 04/32] spl: Avoid #ifdef with CONFIG_SPL_SYS_MALLOC Simon Glass
2023-08-30 21:32 ` Tom Rini
2023-08-30 18:04 ` [PATCH 05/32] spl: mx6: powerpc: Drop the condition on timer_init() Simon Glass
2023-08-31 17:50 ` Tom Rini
2023-09-21 1:03 ` Simon Glass
2023-09-26 11:37 ` Simon Glass
2023-09-26 13:38 ` Christophe Leroy
2023-08-30 18:04 ` [PATCH 06/32] spl: Drop #ifdefs for BOARD_INIT and watchdog Simon Glass
2023-08-30 18:04 ` [PATCH 07/32] spl: Avoid #ifdef with CONFIG_SPL_SYS_ARGS_ADDR Simon Glass
2023-08-30 21:34 ` Tom Rini
2023-08-30 18:04 ` [PATCH 08/32] spl: Drop the switch() statement for OS selection Simon Glass
2023-08-30 18:04 ` [PATCH 09/32] spl: Avoid an #ifdef when printing gd->malloc_ptr Simon Glass
2023-08-30 21:39 ` Tom Rini
2023-09-21 1:03 ` Simon Glass
2023-09-21 15:35 ` Tom Rini
2023-09-22 18:27 ` Simon Glass
2023-09-22 19:28 ` Tom Rini
2023-09-22 23:06 ` Simon Glass
2023-08-30 18:04 ` [PATCH 10/32] spl: Remove #ifdefs with BOOTSTAGE Simon Glass
2023-08-30 18:04 ` [PATCH 11/32] spl: Rename spl_load_fit_image() to load_simple_fit() Simon Glass
2023-08-30 18:04 ` [PATCH 12/32] spl: Move the full FIT code to spl_fit.c Simon Glass
2023-08-30 18:04 ` [PATCH 13/32] spl: Use the correct FIT_..._PROP constants Simon Glass
2023-08-30 18:04 ` [PATCH 14/32] spl: Move bloblist writing until the image is known Simon Glass
2023-08-30 18:04 ` [PATCH 15/32] dm: core: Reverse the argument order in ofnode_copy_props() Simon Glass
2023-08-30 18:04 ` [PATCH 16/32] dm: core: Ensure we run flattree tests on ofnode Simon Glass
2023-08-30 18:04 ` [PATCH 17/32] dm: core: Tidy up comments in the ofnode tests Simon Glass
2023-08-30 18:04 ` [PATCH 18/32] dm: core: Add a function to create an empty tree Simon Glass
2023-08-30 18:04 ` [PATCH 19/32] dm: core: Add a way to copy a node Simon Glass
2023-08-30 18:04 ` [PATCH 20/32] dm: core: Add a way to delete " Simon Glass
2023-08-30 18:04 ` [PATCH 21/32] dm: core: Add a way to convert a devicetree to a dtb Simon Glass
2023-08-30 18:04 ` [PATCH 22/32] dm: core: Support writing a boolean Simon Glass
2023-08-30 18:04 ` [PATCH 23/32] dm: core: Support writing a 64-bit value Simon Glass
2023-08-30 18:04 ` [PATCH 24/32] dm: core: Add tests for oftree_path() Simon Glass
2023-08-30 18:04 ` [PATCH 25/32] sandbox: Move reading the RAM buffer into a better place Simon Glass
2023-08-30 18:04 ` [PATCH 26/32] sandbox: Init the EC properly even if no state file is available Simon Glass
2023-08-30 18:04 ` [PATCH 27/32] sandbox: Only read the state if we have a state file Simon Glass
2023-08-30 18:04 ` [PATCH 28/32] sandbox: Move the bloblist down a little in memory Simon Glass
2023-08-30 18:05 ` [PATCH 29/32] bloblist: Support initing from multiple places Simon Glass
2023-08-30 18:05 ` [PATCH 30/32] fdt: Allow the devicetree to come from a bloblist Simon Glass
2023-08-31 7:06 ` Ilias Apalodimas
2023-08-31 19:02 ` Simon Glass
2023-09-01 7:49 ` Ilias Apalodimas
2023-09-01 15:51 ` Simon Glass
2023-09-04 9:30 ` Ilias Apalodimas
2023-09-10 19:13 ` Simon Glass
2023-09-11 6:17 ` Ilias Apalodimas
2023-09-11 6:38 ` Michal Simek
2023-09-11 7:56 ` Ilias Apalodimas
2023-09-11 10:58 ` Michal Simek
2023-09-11 11:47 ` Ilias Apalodimas
2023-09-21 1:03 ` Simon Glass
2023-09-25 10:18 ` Ilias Apalodimas
2023-10-18 15:26 ` Simon Glass
2023-10-20 8:21 ` Ilias Apalodimas
2023-10-20 13:59 ` Tom Rini [this message]
2023-10-20 15:13 ` Simon Glass
2023-08-30 18:05 ` [PATCH 31/32] command: Include a required header in command.h Simon Glass
2023-08-30 18:05 ` [PATCH 32/32] pci: serial: Support reading PCI-register size with base Simon Glass
2023-08-30 18:14 ` Pali Rohár
2023-08-30 18:17 ` Tom Rini
2023-08-30 18:39 ` Pali Rohár
2023-08-30 19:04 ` Tom Rini
2023-08-30 19:10 ` Pali Rohár
2023-08-30 19:41 ` Tom Rini
2023-08-30 19:44 ` Pali Rohár
2023-08-30 20:51 ` Pali Rohár
2023-08-30 21:08 ` Tom Rini
2023-08-30 21:13 ` Pali Rohár
2023-08-30 21:26 ` Tom Rini
2023-08-30 21:29 ` Pali Rohár
2023-08-30 21:42 ` Tom Rini
2023-09-03 20:36 ` Pali Rohár
2023-09-04 19:55 ` Tom Rini
2023-09-04 20:07 ` Pali Rohár
2023-09-03 20:39 ` Pali Rohár
2023-09-04 20:15 ` Pali Rohár
2023-09-04 20:27 ` Tom Rini
2023-09-04 21:07 ` Pali Rohár
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=20231020135949.GI3119521@bill-the-cat \
--to=trini@konsulko.com \
--cc=baruch@tkos.co.il \
--cc=bmeng.cn@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=marex@denx.de \
--cc=michal.simek@amd.com \
--cc=n-jain1@ti.com \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
--cc=wqu@suse.com \
--cc=xypron.glpk@gmx.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.