summaryrefslogtreecommitdiff
path: root/common/board_f.c
diff options
context:
space:
mode:
authorAlexey Brodkin <Alexey.Brodkin@synopsys.com>2018-05-25 16:08:14 +0300
committerTom Rini <trini@konsulko.com>2018-06-05 20:19:08 -0400
commitff2b2ba845ee682b5eafe4abbb9adbf48730af4b (patch)
treefdb50ed162a72442b24487bb75e4031e90894849 /common/board_f.c
parent0899bd269e8ca0a0c7e6afe9287366bc067c141c (diff)
board_f: Only reserve memory for U-Boot if we're going to relocate
In case of no relocation we'll just waste some space at the very end of usable memory area. If target device has very limited amount of memory (for example 256 kB) this loss will be pretty inconvenient. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Reviewed-by: Simon Glass <sjg@chromium.org> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Heiko Schocher <hs@denx.de> Cc: York Sun <york.sun@nxp.com> Cc: Stefan Roese <sr@denx.de>
Diffstat (limited to 'common/board_f.c')
-rw-r--r--common/board_f.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/common/board_f.c b/common/board_f.c
index fa667c764b..e943347ce3 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -394,19 +394,21 @@ static int reserve_trace(void)
static int reserve_uboot(void)
{
- /*
- * reserve memory for U-Boot code, data & bss
- * round down to next 4 kB limit
- */
- gd->relocaddr -= gd->mon_len;
- gd->relocaddr &= ~(4096 - 1);
-#if defined(CONFIG_E500) || defined(CONFIG_MIPS)
- /* round down to next 64 kB limit so that IVPR stays aligned */
- gd->relocaddr &= ~(65536 - 1);
-#endif
-
- debug("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10,
- gd->relocaddr);
+ if (!(gd->flags & GD_FLG_SKIP_RELOC)) {
+ /*
+ * reserve memory for U-Boot code, data & bss
+ * round down to next 4 kB limit
+ */
+ gd->relocaddr -= gd->mon_len;
+ gd->relocaddr &= ~(4096 - 1);
+ #if defined(CONFIG_E500) || defined(CONFIG_MIPS)
+ /* round down to next 64 kB limit so that IVPR stays aligned */
+ gd->relocaddr &= ~(65536 - 1);
+ #endif
+
+ debug("Reserving %ldk for U-Boot at: %08lx\n",
+ gd->mon_len >> 10, gd->relocaddr);
+ }
gd->start_addr_sp = gd->relocaddr;