]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
lmb: init: initialise the lmb data structures during board init
authorSughosh Ganu <sughosh.ganu@linaro.org>
Mon, 26 Aug 2024 11:59:28 +0000 (17:29 +0530)
committerTom Rini <trini@konsulko.com>
Tue, 3 Sep 2024 20:08:50 +0000 (14:08 -0600)
The memory map maintained by the LMB module is now persistent and
global. This memory map is being maintained through the alloced list
structure which can be extended at runtime -- there is one list for
the available memory, and one for the used memory. Allocate and
initialise these lists during the board init.

Signed-off-by: Sughosh Ganu <sughosh.ganu@linaro.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
common/board_r.c
common/spl/spl.c

index f445803d7a48db891aefa0e4681a3ba6866c2f28..a60da39a29e3f287026d413920daea0536ef3ba6 100644 (file)
@@ -22,6 +22,7 @@
 #include <hang.h>
 #include <image.h>
 #include <irq_func.h>
+#include <lmb.h>
 #include <log.h>
 #include <net.h>
 #include <asm/cache.h>
@@ -510,6 +511,14 @@ int initr_mem(void)
 }
 #endif
 
+static int initr_lmb(void)
+{
+       if (CONFIG_IS_ENABLED(LMB))
+               return lmb_init();
+       else
+               return 0;
+}
+
 static int dm_announce(void)
 {
        int device_count;
@@ -612,6 +621,7 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_CLOCKS
        set_cpu_clk_info, /* Setup clock information */
 #endif
+       initr_lmb,
 #ifdef CONFIG_EFI_LOADER
        efi_memory_init,
 #endif
index 7c6e322ffd7fdb6f48c109e59374d24855202ade..ad2dc6a908c8398bb1bc6d1d1eb7d5b161187870 100644 (file)
@@ -721,6 +721,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
            IS_ENABLED(CONFIG_SPL_ATF))
                dram_init_banksize();
 
+       if (IS_ENABLED(CONFIG_SPL_LMB))
+               lmb_init();
+
        if (CONFIG_IS_ENABLED(PCI) && !(gd->flags & GD_FLG_DM_DEAD)) {
                ret = pci_init();
                if (ret)