[PATCH 25/32] efi: arm: Adjust how the monitor length is calculated
Simon Glass
sjg at chromium.org
Mon Feb 3 18:42:18 CET 2025
Adjust the conditions to support the EFI app when running on ARM.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
common/board_f.c | 4 ++--
common/board_r.c | 4 +++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c
index 8baaa2341a3..6426a17edc6 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -263,6 +263,8 @@ static int setup_mon_len(void)
{
#if defined(CONFIG_ARCH_NEXELL)
gd->mon_len = (ulong)__bss_end - (ulong)__image_copy_start;
+#elif defined(CONFIG_EFI_APP)
+ gd->mon_len = (ulong)_end - (ulong)image_base;
#elif defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)__bss_end - (ulong)_start;
#elif defined(CONFIG_SANDBOX) && !defined(__riscv)
@@ -270,8 +272,6 @@ static int setup_mon_len(void)
#elif defined(CONFIG_SANDBOX)
/* gcc does not provide _init in crti.o on RISC-V */
gd->mon_len = 0;
-#elif defined(CONFIG_EFI_APP)
- gd->mon_len = (ulong)_end - (ulong)_init;
#elif defined(CONFIG_NIOS2) || defined(CONFIG_XTENSA)
gd->mon_len = CONFIG_SYS_MONITOR_LEN;
#elif defined(CONFIG_SH) || defined(CONFIG_RISCV)
diff --git a/common/board_r.c b/common/board_r.c
index c4545e9b483..3fa2d44402e 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -124,7 +124,9 @@ __weak int fixup_cpu(void)
static int initr_reloc_global_data(void)
{
-#ifdef __ARM__
+#if defined(CONFIG_EFI_APP)
+ monitor_flash_len = (ulong)_end - (ulong)image_base;
+#elif defined __ARM__
monitor_flash_len = _end - __image_copy_start;
#elif defined(CONFIG_RISCV)
monitor_flash_len = (ulong)_end - (ulong)_start;
--
2.43.0
More information about the U-Boot
mailing list