mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-29 17:55:48 +00:00
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>
This commit is contained in:
parent
47d7d03622
commit
bd994c007a
1 changed files with 5 additions and 0 deletions
|
@ -13,6 +13,7 @@
|
||||||
#include <malloc.h>
|
#include <malloc.h>
|
||||||
|
|
||||||
#include <asm/global_data.h>
|
#include <asm/global_data.h>
|
||||||
|
#include <asm/sections.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
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;
|
bank_end = end - 1;
|
||||||
|
|
||||||
lmb_reserve(lmb, sp, bank_end - sp + 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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue