[PATCH v4 23/29] efi: arm: Adjust how the monitor length is calculated
Simon Glass
sjg at chromium.org
Sat Feb 15 04:22:44 CET 2025
Adjust the conditions to support the EFI app when running on ARM.
Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Tom Rini <trini at konsulko.com>
---
(no changes since v2)
Changes in v2:
- Put the EFI-app case first in setup_mon_len(), for clarity
common/board_f.c | 6 +++---
common/board_r.c | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/common/board_f.c b/common/board_f.c
index 8baaa2341a3..5b9203fec18 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -261,7 +261,9 @@ static int init_func_i2c(void)
static int setup_mon_len(void)
{
-#if defined(CONFIG_ARCH_NEXELL)
+#if defined(CONFIG_EFI_APP)
+ gd->mon_len = (ulong)_end - (ulong)image_base;
+#elif defined(CONFIG_ARCH_NEXELL)
gd->mon_len = (ulong)__bss_end - (ulong)__image_copy_start;
#elif defined(__ARM__) || defined(__MICROBLAZE__)
gd->mon_len = (ulong)__bss_end - (ulong)_start;
@@ -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 e7d9a3b312d..41c0ba22c88 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