summaryrefslogtreecommitdiff
path: root/lib_ppc
diff options
context:
space:
mode:
authorStefan Roese <sr@denx.de>2007-07-08 13:44:27 +0200
committerWolfgang Denk <wd@denx.de>2007-07-11 00:43:32 +0200
commite9514751cfa5cce61ea699fa0d3eb37898a5eeb5 (patch)
tree1925e1132514e07700bcb3eb2e07249b0d9a9c53 /lib_ppc
parentb3aff0cb9ecf236d7e8c93761dd1dadf6837a582 (diff)
downloadu-boot-imx-e9514751cfa5cce61ea699fa0d3eb37898a5eeb5.zip
u-boot-imx-e9514751cfa5cce61ea699fa0d3eb37898a5eeb5.tar.gz
u-boot-imx-e9514751cfa5cce61ea699fa0d3eb37898a5eeb5.tar.bz2
Fix malloc problem introduced with the relocation fixup for the PPC platform
The relocation fixup didn't handle the malloc pointer initialization correctly. This patch fixes this problem. Tested successfully on 4xx. The relocation fixup patches for 4xx will follow soon. Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'lib_ppc')
-rw-r--r--lib_ppc/board.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib_ppc/board.c b/lib_ppc/board.c
index 8651cb3..80baab8 100644
--- a/lib_ppc/board.c
+++ b/lib_ppc/board.c
@@ -139,10 +139,10 @@ static ulong mem_malloc_brk = 0;
*/
static void mem_malloc_init (void)
{
- ulong dest_addr = CFG_MONITOR_BASE + gd->reloc_off;
-
- mem_malloc_end = dest_addr;
- mem_malloc_start = dest_addr - TOTAL_MALLOC_LEN;
+#if !defined(CONFIG_RELOC_FIXUP_WORKS)
+ mem_malloc_end = CFG_MONITOR_BASE + gd->reloc_off;
+#endif
+ mem_malloc_start = mem_malloc_end - TOTAL_MALLOC_LEN;
mem_malloc_brk = mem_malloc_start;
memset ((void *) mem_malloc_start,
@@ -623,6 +623,7 @@ void board_init_r (gd_t *id, ulong dest_addr)
#if defined(CONFIG_RELOC_FIXUP_WORKS)
gd->reloc_off = 0;
+ mem_malloc_end = dest_addr;
#else
gd->reloc_off = dest_addr - CFG_MONITOR_BASE;
#endif