SHA256
1
0
forked from pool/u-boot
u-boot/0007-Revert-efi_loader-remove-efi_exit_c.patch
Guillaume GARDET 818d48706c Accepting request 649328 from hardware👢staging
- Update to v2018.11
- Update from arm-trusted-firmware-pine64 to arm-trusted-firmware-sun50ia64
- pineh64: Use new arm-trusted-firmware-sun50ih6
- Add bananapim64
- u-boot.spec.in, u-boot-board.spec.in: Update to use https
- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2018.11
* Patches added:
  0007-Revert-efi_loader-remove-efi_exit_c.patch
- Update to v2018.11-rc3
- Update to v2018.11-rc2
- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2018.11
* Patches dropped:
  0007-rockchip-make_fit_atf-use-elf-entry.patch
  0008-rockchip-make_fit_atf-make-python3-.patch
  0009-rockchip-make_fit_atf.py-depends-on.patch
- Update to v2018.11-rc1
- Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2018.11
* Patches dropped:
  0010-ARM-tegra-reserve-unmapped-RAM-so-E.patch
- nanopia64, orangepipc2: Conditionally enable ATF
- Add pineh64 (ATF TBD)

OBS-URL: https://build.opensuse.org/request/show/649328
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=28
2018-11-15 17:08:45 +00:00

73 lines
2.3 KiB
Diff

From 36a7d1d794e636d19902ffaf8e9540a1cbcc7bcc Mon Sep 17 00:00:00 2001
From: Guillaume GARDET <guillaume.gardet@free.fr>
Date: Mon, 5 Nov 2018 10:22:16 +0100
Subject: [PATCH] Revert "efi_loader: remove efi_exit_caches()" This reverts
commit 3170db63c41a2eda6ee6573353bb4de8c7c1b9d5.
Grub in Tumbleweed is not ready for this change.
Remove this revert once Grub is updated in TW
---
lib/efi_loader/efi_boottime.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index da978d2b34..54c597f042 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -26,6 +26,14 @@ LIST_HEAD(efi_obj_list);
/* List of all events */
LIST_HEAD(efi_events);
+/*
+ * If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
+ * we need to do trickery with caches. Since we don't want to break the EFI
+ * aware boot path, only apply hacks when loading exiting directly (breaking
+ * direct Linux EFI booting along the way - oh well).
+ */
+static bool efi_is_direct_boot = true;
+
#ifdef CONFIG_ARM
/*
* The "gd" pointer lives in a register on ARM and AArch64 that we declare
@@ -1678,6 +1686,8 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
EFI_ENTRY("%p, %p, %p", image_handle, exit_data_size, exit_data);
+ efi_is_direct_boot = false;
+
/* call the image! */
if (setjmp(&image_obj->exit_jmp)) {
/*
@@ -1785,6 +1795,21 @@ static efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
return EFI_EXIT(EFI_SUCCESS);
}
+/**
+ * efi_exit_caches() - fix up caches for EFI payloads if necessary
+ */
+static void efi_exit_caches(void)
+{
+#if defined(CONFIG_ARM) && !defined(CONFIG_ARM64)
+ /*
+ * Grub on 32bit ARM needs to have caches disabled before jumping into
+ * a zImage, but does not know of all cache layers. Give it a hand.
+ */
+ if (efi_is_direct_boot)
+ cleanup_before_linux();
+#endif
+}
+
/**
* efi_exit_boot_services() - stop all boot services
* @image_handle: handle of the loaded image
@@ -1838,6 +1863,9 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
board_quiesce_devices();
+ /* Fix up caches for EFI payloads if necessary */
+ efi_exit_caches();
+
/* This stops all lingering devices */
bootm_disable_interrupts();