[PATCH v2 1/3] apple: Set up file system firmware loader
Mark Kettenis
mark.kettenis at xs4all.nl
Tue Sep 30 16:49:30 CEST 2025
> Date: Tue, 30 Sep 2025 01:03:41 +0200
> From: Marek Vasut <marek.vasut at mailbox.org>
Hi Marek,
> On 9/29/25 9:52 PM, Mark Kettenis wrote:
> > Find the appropriate EFI system partition on the internal NVMe
> > storage and set the U-Boot environment variables such that
> > the file system firmware loader can load firmware from it.
> >
> > Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> > ---
> > arch/arm/mach-apple/board.c | 59 +++++++++++++++++++++++++++++++++++++
> > 1 file changed, 59 insertions(+)
> >
> > diff --git a/arch/arm/mach-apple/board.c b/arch/arm/mach-apple/board.c
> > index 4cd8979bdc2..d8b6787c705 100644
> > --- a/arch/arm/mach-apple/board.c
> > +++ b/arch/arm/mach-apple/board.c
> > @@ -8,6 +8,8 @@
> > #include <efi_loader.h>
> > #include <env.h>
> > #include <lmb.h>
> > +#include <nvme.h>
> > +#include <part.h>
> >
> > #include <asm/armv8/mmu.h>
> > #include <asm/global_data.h>
> > @@ -771,6 +773,60 @@ u64 get_page_table_size(void)
> > return SZ_256K;
> > }
> >
> > +static char *asahi_esp_devpart(void)
> > +{
> Maybe try request_firmware_into_buf_via_script() instead ?
>
> That might make this more flexible /wrt firmware location and user
> preferences.
I'm not sure about that. For one thing, I thought there was a push to
move away from scripts. At least that was a major driver for
replacing distroboot with bootstd. Granted, the motivation for that
was secure/trusted/verified boot, which is something I personally
don't care all that much about.
Writing a script that implements the logic of asahi_esp_devpart() is
also not trivial. Especially because there are no actual working
examples of such a script in U-Boot. At least I can't find any
definitions of the "mt7987_i2p5ge_load_pmb_firmware",
"mt7987_i2p5ge_load_dspbit_firmware" or
"mt7988_i2p5ge_load_pmb_firmware" scripts that are used by
drivers/net/phy/mediatek/mtk-2p5ge.c. And that is currently the only
driver that uses request_firmware_into_buf_via_script().
I'd prefer to keep using request_firmware_into_buf() until there is an
actual use case that requires more flexibility. For now I'm not aware
of any hardware besides the Apple M2 and M2 Pro machines that have an
ASMedia PCI XHCI controller that requires loading firmware.
More information about the U-Boot
mailing list