summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut+renesas@gmail.com>2021-11-13 20:34:37 +0300
committerTom Rini <trini@konsulko.com>2021-11-19 02:20:19 +0300
commitbd994c007ae232ade284c9c22c9150077961fe19 (patch)
tree9bb9ab73d08ff331e4c2e10c90aa67a63f255a76 /lib
parent47d7d03622ba8b52f87274c7eea917a15e76053b (diff)
downloadu-boot-bd994c007ae232ade284c9c22c9150077961fe19.tar.xz
lmb: Reserve U-Boot separately if relocation is disabled
In case U-Boot starts with GD_FLG_SKIP_RELOC, the U-Boot code is not relocated, however the stack and heap is at the end of DRAM after relocation. Reserve a LMB area for the non-relocated U-Boot code so it won't be overwritten. Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com> Cc: Simon Glass <sjg@chromium.org> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/lmb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/lmb.c b/lib/lmb.c
index 676b3a0bda..f72996a424 100644
--- a/lib/lmb.c
+++ b/lib/lmb.c
@@ -13,6 +13,7 @@
#include <malloc.h>
#include <asm/global_data.h>
+#include <asm/sections.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -144,6 +145,10 @@ void arch_lmb_reserve_generic(struct lmb *lmb, ulong sp, ulong end, ulong align)
bank_end = end - 1;
lmb_reserve(lmb, sp, bank_end - sp + 1);
+
+ if (gd->flags & GD_FLG_SKIP_RELOC)
+ lmb_reserve(lmb, (phys_addr_t)(uintptr_t)_start, gd->mon_len);
+
break;
}
}