zynqmp: Run board_get_usable_ram_top() only on main U-Boot
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>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/75e52def75f573e554a6b177a78504c128cb0c4a.1657183534.git.michal.simek@amd.com
diff --git a/arch/arc/lib/bootm.c b/arch/arc/lib/bootm.c
index ed6c5df..628addd 100644
--- a/arch/arc/lib/bootm.c
+++ b/arch/arc/lib/bootm.c
@@ -29,9 +29,11 @@
{
int ret;
- ret = image_setup_linux(images);
- if (ret)
- return ret;
+ if (CONFIG_IS_ENABLED(LMB)) {
+ ret = image_setup_linux(images);
+ if (ret)
+ return ret;
+ }
return board_prep_linux(images);
}
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index fc22bef..9f086f3 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -199,7 +199,7 @@
{
char *commandline = env_get("bootargs");
- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
debug("using: FDT\n");
if (image_setup_linux(images)) {
panic("FDT creation failed!");
diff --git a/arch/m68k/lib/bootm.c b/arch/m68k/lib/bootm.c
index 27729db..9cade92 100644
--- a/arch/m68k/lib/bootm.c
+++ b/arch/m68k/lib/bootm.c
@@ -60,9 +60,11 @@
}
set_clocks_in_mhz(kbd);
- ret = image_setup_linux(images);
- if (ret)
- goto error;
+ if (CONFIG_IS_ENABLED(LMB)) {
+ ret = image_setup_linux(images);
+ if (ret)
+ goto error;
+ }
kernel = (void (*)(struct bd_info *, ulong, ulong, ulong, ulong))images->ep;
diff --git a/arch/microblaze/lib/bootm.c b/arch/microblaze/lib/bootm.c
index af946b8..31b6659 100644
--- a/arch/microblaze/lib/bootm.c
+++ b/arch/microblaze/lib/bootm.c
@@ -73,7 +73,7 @@
static void boot_prep_linux(bootm_headers_t *images)
{
- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
debug("using: FDT\n");
if (image_setup_linux(images)) {
printf("FDT creation failed! hanging...");
diff --git a/arch/powerpc/lib/bootm.c b/arch/powerpc/lib/bootm.c
index d365705..e52aa75 100644
--- a/arch/powerpc/lib/bootm.c
+++ b/arch/powerpc/lib/bootm.c
@@ -214,9 +214,11 @@
if (ret)
return ret;
- ret = image_setup_linux(images);
- if (ret)
- return ret;
+ if (CONFIG_IS_ENABLED(LMB)) {
+ ret = image_setup_linux(images);
+ if (ret)
+ return ret;
+ }
return 0;
}
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index c1ac339..670d9c9 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -64,7 +64,7 @@
static void boot_prep_linux(bootm_headers_t *images)
{
- if (CONFIG_IS_ENABLED(OF_LIBFDT) && images->ft_len) {
+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
debug("using: FDT\n");
if (image_setup_linux(images)) {
printf("FDT creation failed! hanging...");
diff --git a/arch/x86/lib/bootm.c b/arch/x86/lib/bootm.c
index 57cba5c..1bcdb3e 100644
--- a/arch/x86/lib/bootm.c
+++ b/arch/x86/lib/bootm.c
@@ -78,15 +78,14 @@
size_t len;
int ret;
-#ifdef CONFIG_OF_LIBFDT
- if (images->ft_len) {
+ if (CONFIG_IS_ENABLED(OF_LIBFDT) && CONFIG_IS_ENABLED(LMB) && images->ft_len) {
debug("using: FDT\n");
if (image_setup_linux(images)) {
puts("FDT creation failed! hanging...");
hang();
}
}
-#endif
+
if (images->legacy_hdr_valid) {
hdr = images->legacy_hdr_os;
if (image_check_type(hdr, IH_TYPE_MULTI)) {