As gd->ram_top = board_get_usable_ram_top() in board_r
the EFI loader don't need to call this function again and after relocation.

This patch avoid issue if board assumed that this function is called
only one time and before relocation.

Signed-off-by: Patrick Delaunay <patrick.delau...@foss.st.com>
---

https://source.denx.de/u-boot/custodians/u-boot-stm/-/pipelines/7399


 lib/efi_loader/efi_memory.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_memory.c b/lib/efi_loader/efi_memory.c
index be2f655dff..f5bc37a20a 100644
--- a/lib/efi_loader/efi_memory.c
+++ b/lib/efi_loader/efi_memory.c
@@ -7,7 +7,6 @@
 
 #include <common.h>
 #include <efi_loader.h>
-#include <init.h>
 #include <malloc.h>
 #include <mapmem.h>
 #include <watchdog.h>
@@ -731,7 +730,7 @@ efi_status_t efi_add_conventional_memory_map(u64 ram_start, 
u64 ram_end,
 
 __weak void efi_add_known_memory(void)
 {
-       u64 ram_top = board_get_usable_ram_top(0) & ~EFI_PAGE_MASK;
+       u64 ram_top = gd->ram_top & ~EFI_PAGE_MASK;
        int i;
 
        /*
-- 
2.25.1

Reply via email to