U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@google.com>
Cc: Mark Kettenis <mark.kettenis@xs4all.nl>,
	heinrich.schuchardt@canonical.com, ilias.apalodimas@linaro.org,
	u-boot@lists.denx.de, dianders@google.com,
	Rob Herring <robh@kernel.org>
Subject: Re: [PATCH v2 1/1] efi_loader: expose the device-tree file name
Date: Fri, 3 Nov 2023 16:03:58 -0400	[thread overview]
Message-ID: <20231103200358.GT496310@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ3Yqf3-9wjVTYh5eR_=rFuf-2eWUvZmfv=U1xDCVEWSXQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4249 bytes --]

On Fri, Nov 03, 2023 at 01:17:18PM -0600, Simon Glass wrote:
> Hi,
> 
> On Mon, 23 Oct 2023 at 11:06, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
> >
> > > Date: Mon, 23 Oct 2023 12:34:55 -0400
> > > From: Tom Rini <trini@konsulko.com>
> > >
> > > On Mon, Oct 23, 2023 at 05:37:34PM +0200, Mark Kettenis wrote:
> > > > > From: Simon Glass <sjg@google.com>
> > > > > Date: Mon, 23 Oct 2023 00:08:40 -0700
> > > > >
> > > > > > > fdt_node_check_compatible() does most of the work...then you need to
> > > > > > > check which FDT has the most specific match (i.e. latest in the string
> > > > > > > list). That handles things like board revisions, variants, etc.
> > > > > > >
> > > > > > > My concern is about adding a feature when there is already a defined
> > > > > > > spec and mechanism for this to work. What happens when we load the
> > > > > > > file and the compatible is wrong?
> > > > > > >
> > > > > > > At best, I see the filename as a hint.
> > > > > > >
> > > > > > > [Perhaps this is the wrong time to ask, but why are kernels +DT not
> > > > > > > shipped in FIT on ARM?]
> > > > > >
> > > > > > FIT is U-Boot specific. For Linux distributions it is easier to use a
> > > > > > firmware agnostic method of booting.
> > > > >
> > > > > I'd like to suggest that distros use both. Then U-Boot can work as it
> > > > > was designed and we can avoid these work-arounds.
> > > > >
> > > > > FIT is actually implemented in various other bootloaders. In fact
> > > > > perhaps grub is the only one that doesn't? I can't think of any
> > > > > others.
> > > >
> > > > Simon, please stop pushing this.  OpenBSD's bootloader does not
> > > > support FIT and we have no interest in supporting it.  Our users
> > > > expect to be able to just copy a new kernel in place and use it and
> > > > our OS upgrade procedure depends on this as well.  And this is
> > > > incompatble with FIT.  I've explained this about a dozen times to you
> > > > now.
> > >
> > > In the context of this thread, genuinely, how will OpenBSD (and the rest
> > > of the BSD families) operate? I agree U-Boot doesn't want to have to
> > > know all of the UFSes, so that means the SCT will be populated either by
> > > the DT passed to U-Boot, or the DT we were built with. Is it that since
> > > the next stage is an EFI app, it will check that variable and use that
> > > hint?
> >
> > Yes, that is exactly what I want to do.  Hopefully the DT that is
> > passed to U-Boot or that U-Boot was built with will be good enough in
> > most cases.  But when it isn't users can use the OpenBSD bootloader
> > (which is an EFI app) to load an updated DT.
> >
> > I can't speak for the other BSDs, but I think both FreeBSD and NetBSD
> > have a very similar boot mechanism.
> 
> I've been thinking about this patch a bit more, and I have grave misgivings.
> 
> I predict that if we take this, it will become an ABI from U-Boot and
> we will not be able to drop it.

To be clear, if the GUID in question (and that isn't quoted in this
part of the thread) is accepted and used as suggested, it's not an ABI
for U-Boot, it's an ABI for everyone, including the rest of device tree.

> Here is what I suggest instead: provide a protocol for U-Boot to
> provide the DT over EFI. Provide any information needed by U-Boot,
> such as the directory containing the files.
> 
> We already have the ability to put a DT in the system table. We
> already have a way to package DT into a FIT and allow U-Boot to select
> the correct one.
> 
> With something like this it will be impossible for U-Boot to boot a
> distro without using grub, etc. since it won't know what DT to use.

The existing system DT is the DT that should be used, as the long term
goal, not a loaded from storage DT. Until that point however, it's
already required to know what and where to load a device tree from, and
it not being at all uniform is where some of the current pain comes
from.

> This information would be held in a script somewhere which no one can
> figure out without executing it.
> 
> I think we need to carefully think about the design of this.

Yes, we do need to be careful and intentional here.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  parent reply	other threads:[~2023-11-03 20:04 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-17 13:49 [PATCH v2 1/1] efi_loader: expose the device-tree file name Heinrich Schuchardt
2023-10-17 14:15 ` Ilias Apalodimas
2023-10-18  3:33 ` Simon Glass
2023-10-18  8:15   ` Heinrich Schuchardt
2023-10-19 13:55     ` Simon Glass
2023-10-19 14:14       ` Mark Kettenis
2023-10-19 16:09       ` Heinrich Schuchardt
2023-10-20 13:21         ` Simon Glass
2023-10-20 13:55           ` Tom Rini
2023-10-20 15:40           ` Heinrich Schuchardt
2023-10-20 16:24             ` Tom Rini
2023-10-21 15:42               ` Simon Glass
2023-10-22  4:53                 ` Heinrich Schuchardt
2023-10-23  7:08                   ` Simon Glass
2023-10-23  8:10                     ` Heinrich Schuchardt
2023-10-23 15:37                     ` Mark Kettenis
2023-10-23 16:34                       ` Tom Rini
2023-10-23 17:05                         ` Mark Kettenis
2023-11-03 19:17                           ` Simon Glass
2023-11-03 19:42                             ` Ilias Apalodimas
2023-11-03 20:00                             ` Ilias Apalodimas
2023-11-03 20:03                             ` Tom Rini [this message]
2023-11-14 19:09                             ` Mark Kettenis
2023-11-14 23:20                               ` Tom Rini
2023-12-31 14:25                       ` Peter Robinson
2023-10-20 21:19           ` 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=20231103200358.GT496310@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=dianders@google.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=mark.kettenis@xs4all.nl \
    --cc=robh@kernel.org \
    --cc=sjg@google.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