layerscape: use the lmb API's to add RAM memory

The EFI memory allocations are now being done through the LMB module,
and hence the memory map is maintained by the LMB module. Use the
lmb_arch_add_memory() API function to add the usable RAM memory to the
LMB's memory map.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
This commit is contained in:
Sughosh Ganu
2024-10-15 21:07:12 +05:30
committed by Tom Rini
parent 497da0c5ce
commit 9ec4065557
2 changed files with 5 additions and 4 deletions

View File

@@ -10,6 +10,7 @@
#include <env.h> #include <env.h>
#include <init.h> #include <init.h>
#include <hang.h> #include <hang.h>
#include <lmb.h>
#include <log.h> #include <log.h>
#include <net.h> #include <net.h>
#include <vsprintf.h> #include <vsprintf.h>
@@ -1525,8 +1526,8 @@ int dram_init_banksize(void)
return 0; return 0;
} }
#if CONFIG_IS_ENABLED(EFI_LOADER) #if CONFIG_IS_ENABLED(LMB_ARCH_MEM_MAP)
void efi_add_known_memory(void) void lmb_arch_add_memory(void)
{ {
int i; int i;
phys_addr_t ram_start; phys_addr_t ram_start;
@@ -1548,8 +1549,7 @@ void efi_add_known_memory(void)
gd->arch.resv_ram < ram_start + ram_size) gd->arch.resv_ram < ram_start + ram_size)
ram_size = gd->arch.resv_ram - ram_start; ram_size = gd->arch.resv_ram - ram_start;
#endif #endif
efi_add_memory_map(ram_start, ram_size, lmb_add(ram_start, ram_size);
EFI_CONVENTIONAL_MEMORY);
} }
} }
#endif #endif

View File

@@ -1122,6 +1122,7 @@ config SPL_LMB
config LMB_ARCH_MEM_MAP config LMB_ARCH_MEM_MAP
bool "Add an architecture specific memory map" bool "Add an architecture specific memory map"
depends on LMB depends on LMB
default y if FSL_LAYERSCAPE
help help
Some architectures have special or unique aspects which need Some architectures have special or unique aspects which need
consideration when adding memory ranges to the list of available consideration when adding memory ranges to the list of available