summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-10-12 21:34:37 -0700
committerGabe Black (Do Not Use) <gabeblack@google.com>2011-10-13 17:16:28 -0700
commit6ca1533a09844c26ddaac717612bafe8f27e4c3b (patch)
tree74d0ac462b3c599b2cb0b398d1d26d230158cdf5 /arch
parentcebc230eb84d9ecc579f82259584b3ce92018e2a (diff)
Reorder x86's post relocation memory layout
This changes the layout in decreasing addresses from: 1. Stack 2. Sections in the image 3. Heap to 1. Sections in the image 2. Heap 3. Stack This allows the stack to grow significantly more since it isn't constrained by the other u-boot areas. More importantly, the generic memory wipe code assumes that the stack is the lowest addressed area used by the main part of u-boot. In the original layout, that means that u-boot tramples all over itself. In the new layout, it works. BUG=chrome-os-partner:6194 BUG=chrome-os-partner:6195 TEST=Booted on Stumpy. Change-Id: I0484ad37ba15f63cb0fb289118cad360817ad11f Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/10006 Reviewed-by: Stefan Reinauer <reinauer@google.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/lib/board.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index dfb8abf466..fece567e31 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -197,11 +197,10 @@ static int calculate_relocation_address(void)
/* Calculate destination RAM Address and relocation offset */
dest_addr = (void *)gd->ram_size;
- dest_addr -= CONFIG_SYS_STACK_SIZE;
dest_addr -= (bss_end - text_start);
rel_offset = dest_addr - text_start;
- gd->start_addr_sp = gd->ram_size;
+ gd->start_addr_sp = (uintptr_t)dest_addr - CONFIG_SYS_MALLOC_LEN;
gd->relocaddr = (ulong)dest_addr;
gd->reloc_off = rel_offset;