[PATCH 09/10] efi: Drop EFI_GRUB_ARM32_WORKAROUND

Simon Glass sjg at chromium.org
Wed Jan 7 20:02:27 CET 2026


On Tue, 6 Jan 2026 at 19:42, Peter Robinson <pbrobinson at gmail.com> wrote:
>
> On Wed, 7 Jan 2026 at 00:33, Simon Glass <sjg at chromium.org> wrote:
> >
> > From: Simon Glass <sjg at chromium.org>
> >
> > This work-around dates from 2019 and grub 2.04 which is quite old. New
> > builds of grub don't have the problem and old boards presumably use an
> > older U-Boot, so don't need this.
> >
> > Drop it.
> >
> > Signed-off-by: Simon Glass <sjg at chromium.org>
> > Signed-off-by: Simon Glass <simon.glass at canonical.com>
> > ---
> >
> >  configs/mt7623n_bpir2_defconfig |  1 -
> >  lib/efi_loader/Kconfig          | 10 ----------
> >  lib/efi_loader/efi_boottime.c   | 26 --------------------------
> >  3 files changed, 37 deletions(-)
> >
> > diff --git a/configs/mt7623n_bpir2_defconfig b/configs/mt7623n_bpir2_defconfig
> > index 404380558f2..d75168a72ed 100644
> > --- a/configs/mt7623n_bpir2_defconfig
> > +++ b/configs/mt7623n_bpir2_defconfig
> > @@ -13,7 +13,6 @@ CONFIG_DEFAULT_DEVICE_TREE="mt7623n-bananapi-bpi-r2"
> >  CONFIG_TARGET_MT7623=y
> >  CONFIG_SYS_BOOTM_LEN=0x4000000
> >  CONFIG_SYS_LOAD_ADDR=0x84000000
> > -# CONFIG_EFI_GRUB_ARM32_WORKAROUND is not set
> >  CONFIG_FIT=y
> >  CONFIG_FIT_VERBOSE=y
> >  CONFIG_DISTRO_DEFAULTS=y
> > diff --git a/lib/efi_loader/Kconfig b/lib/efi_loader/Kconfig
> > index 13e44be1d06..5585c841c27 100644
> > --- a/lib/efi_loader/Kconfig
> > +++ b/lib/efi_loader/Kconfig
> > @@ -505,16 +505,6 @@ config EFI_LOADER_BOUNCE_BUFFER
> >           hardware we can create a bounce buffer so that payloads don't have to
> >           worry about platform details.
> >
> > -config EFI_GRUB_ARM32_WORKAROUND
> > -       bool "Workaround for GRUB on 32bit ARM"
> > -       default n if ARCH_BCM283X || ARCH_SUNXI || ARCH_QEMU
> > -       default y
> > -       depends on ARM && !ARM64
> > -       help
> > -         GRUB prior to version 2.04 requires U-Boot to disable caches. This
> > -         workaround currently is also needed on systems with caches that
> > -         cannot be managed via CP15.
>
> This also states that it's needed for systems that can't be managed by
> CP15, what systems are they, how are those platforms addressed?

I'm guessing that some systems have level2 caches with their own
software interface. I certainly have seen this with Tegra2/3, for
example.


>
> >  config EFI_ESRT
> >         bool "Enable the UEFI ESRT generation"
> >         depends on EFI_CAPSULE_FIRMWARE_MANAGEMENT
> > diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> > index 0bc66ee61a8..c31ee53cde6 100644
> > --- a/lib/efi_loader/efi_boottime.c
> > +++ b/lib/efi_loader/efi_boottime.c
> > @@ -2139,29 +2139,6 @@ error:
> >         return EFI_EXIT(ret);
> >  }
> >
> > -/**
> > - * efi_exit_caches() - fix up caches for EFI payloads if necessary
> > - */
> > -static void efi_exit_caches(void)
> > -{
> > -#if defined(CONFIG_EFI_GRUB_ARM32_WORKAROUND)
> > -       /*
> > -        * Boooting Linux via GRUB prior to version 2.04 fails on 32bit ARM if
> > -        * caches are enabled.
> > -        *
> > -        * TODO:
> > -        * According to the UEFI spec caches that can be managed via CP15
> > -        * operations should be enabled. Caches requiring platform information
> > -        * to manage should be disabled. This should not happen in
> > -        * ExitBootServices() but before invoking any UEFI binary is invoked.
> > -        *
> > -        * We want to keep the current workaround while GRUB prior to version
> > -        * 2.04 is still in use.
> > -        */
> > -       cleanup_before_linux();
> > -#endif
> > -}
> > -
> >  /**
> >   * efi_exit_boot_services() - stop all boot services
> >   * @image_handle: handle of the loaded image
> > @@ -2245,9 +2222,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
> >         /* Patch out unsupported runtime function */
> >         efi_runtime_detach();
> >
> > -       /* Fix up caches for EFI payloads if necessary */
> > -       efi_exit_caches();
> > -
> >         /* Disable boot time services */
> >         systab.con_in_handle = NULL;
> >         systab.con_in = NULL;
> > --
> > 2.43.0
> >


More information about the U-Boot mailing list