[PATCH] board: rpi: Enable capsule updates
Ilias Apalodimas
ilias.apalodimas at linaro.org
Tue Sep 10 15:54:24 CEST 2024
Hi Matthias,
On Tue, 10 Sept 2024 at 16:50, Matthias Brugger <mbrugger at suse.com> wrote:
>
>
>
> On 10/09/2024 08:39, Ilias Apalodimas wrote:
> > Since RPI works well using EFI and has no size limitations with regards
> > to U-Boot, add the needed structures and Kconfig options needed to
> > enable capsule updates
> > ---
> > board/raspberrypi/rpi/rpi.c | 22 ++++++++++++++++++++++
> > configs/rpi_4_defconfig | 2 ++
> > 2 files changed, 24 insertions(+)
> >
> > diff --git a/board/raspberrypi/rpi/rpi.c b/board/raspberrypi/rpi/rpi.c
> > index ab5ea85cf9f8..1f342eee12b2 100644
> > --- a/board/raspberrypi/rpi/rpi.c
> > +++ b/board/raspberrypi/rpi/rpi.c
> > @@ -63,6 +63,28 @@ struct msg_get_clock_rate {
> > u32 end_tag;
> > };
> >
> > +struct efi_fw_image fw_images[] = {
> > + {
> > + .fw_name = u"RPI_UBOOT",
> > + .image_index = 1,
> > + },
> > +};
> > +
> > +struct efi_capsule_update_info update_info = {
> > + .dfu_string = "mmc 0=u-boot.bin fat 0 1",
> > + .num_images = ARRAY_SIZE(fw_images),
> > + .images = fw_images,
> > +};
> > +
> > +#if IS_ENABLED(CONFIG_SET_DFU_ALT_INFO)
> > +void set_dfu_alt_info(char *interface, char *devstr)
> > +{
> > + if (IS_ENABLED(CONFIG_EFI_HAVE_CAPSULE_SUPPORT))
> > + env_set("dfu_alt_info", update_info.dfu_string);
> > +}
> > +#endif
> > +
> > +
> > #ifdef CONFIG_ARM64
> > #define DTB_DIR "broadcom/"
> > #else
> > diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
> > index f5fb322aa8fc..c70414e6fcaf 100644
> > --- a/configs/rpi_4_defconfig
> > +++ b/configs/rpi_4_defconfig
> > @@ -65,3 +65,5 @@ CONFIG_SYS_WHITE_ON_BLACK=y
> > CONFIG_VIDEO_BCM2835=y
> > CONFIG_CONSOLE_SCROLL_LINES=10
> > CONFIG_PHYS_TO_BUS=y
> > +CONFIG_EFI_RUNTIME_UPDATE_CAPSULE=y
> > +CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
>
> Would you mind to enable this in all corresponding configs.
>
> That would be at least: rpi_3_b_plus_defconfig, rpi_3_defconfig,
> rpi_arm64_defconfig.
No I don't, I just didn't have the hardware to test it. In practice
different boards should have different GUIDS -- so you dont end up
updating and RPI4 with an RPI3 firmware. I am about to send a PR that
enables a dynamic GUID generation (which this patch depends on). That
patch reads the root compatible node and uses it to derive unique
UUIDs. I assume that all those boards have a different compatible node
and we wont have clashes?
Thanks
/Ilias
>
> Thanks,
> Matthias
More information about the U-Boot
mailing list