]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
zynqmp: Run board_get_usable_ram_top() only on main U-Boot
authorAshok Reddy Soma <ashok.reddy.soma@xilinx.com>
Tue, 14 Dec 2021 12:19:13 +0000 (05:19 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Tue, 14 Dec 2021 13:02:38 +0000 (14:02 +0100)
With commit ce39ee28ec31 ("zynqmp: Do not place u-boot to reserved memory
location"), the function board_get_usable_ram_top() is allocating
MMU_SECTION_SIZE of about 2MB using lmb_alloc(). But we dont have this
much memory in case of mini U-Boot.

Keep these functions which use lmb under CONFIG_LMB so that they are
compiled and used only when LMB is enabled.

Signed-off-by: Ashok Reddy Soma <ashok.reddy.soma@xilinx.com>
board/xilinx/zynqmp/zynqmp.c
boot/image-board.c

index 2b5239ccb4752dbbe1af490d8c139d8652f41438..c69fb939a83ebdff30bdd70d1c7cf87dba0fcb26 100644 (file)
@@ -483,6 +483,7 @@ int dram_init(void)
        return 0;
 }
 
+#if defined(CONFIG_LMB)
 ulong board_get_usable_ram_top(ulong total_size)
 {
        phys_size_t size;
@@ -504,6 +505,8 @@ ulong board_get_usable_ram_top(ulong total_size)
 
        return reg + size;
 }
+#endif
+
 #else
 int dram_init_banksize(void)
 {
index bf8817165cab2651f49f8bacf8de84201e7b4d20..9cdfbc44154cbe68e617499bc135dd16ee5805ff 100644 (file)
@@ -546,6 +546,7 @@ int boot_get_ramdisk(int argc, char *const argv[], bootm_headers_t *images,
        return 0;
 }
 
+#if defined(CONFIG_LMB)
 /**
  * boot_ramdisk_high - relocate init ramdisk
  * @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -639,6 +640,7 @@ int boot_ramdisk_high(struct lmb *lmb, ulong rd_data, ulong rd_len,
 error:
        return -1;
 }
+#endif
 
 int boot_get_setup(bootm_headers_t *images, u8 arch,
                   ulong *setup_start, ulong *setup_len)
@@ -832,6 +834,7 @@ int boot_get_loadable(int argc, char *const argv[], bootm_headers_t *images,
        return 0;
 }
 
+#if defined(CONFIG_LMB)
 /**
  * boot_get_cmdline - allocate and initialize kernel cmdline
  * @lmb: pointer to lmb handle, will be used for memory mgmt
@@ -939,6 +942,7 @@ int image_setup_linux(bootm_headers_t *images)
 
        return 0;
 }
+#endif
 
 void genimg_print_size(uint32_t size)
 {