************************************************************************
*/
-/*
- * The Malloc area is immediately below the monitor copy in DRAM
- */
-static void mem_malloc_init (void)
-{
-#if !defined(CONFIG_RELOC_FIXUP_WORKS)
- mem_malloc_end = CONFIG_SYS_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,
- 0,
- mem_malloc_end - mem_malloc_start);
-}
-
/*
* All attempts to come up with a "common" initialization sequence
* that works for all boards and architectures failed: some of the
#ifndef CONFIG_ENV_IS_NOWHERE
extern char * env_name_spec;
#endif
+ ulong malloc_start;
#ifndef CONFIG_SYS_NO_FLASH
ulong flash_size;
gd->flags |= GD_FLG_RELOC; /* tell others: relocation done */
+ /* The Malloc area is immediately below the monitor copy in DRAM */
#if defined(CONFIG_RELOC_FIXUP_WORKS)
gd->reloc_off = 0;
- mem_malloc_end = dest_addr;
+ malloc_start = dest_addr - TOTAL_MALLOC_LEN;
#else
gd->reloc_off = dest_addr - CONFIG_SYS_MONITOR_BASE;
+ malloc_start = CONFIG_SYS_MONITOR_BASE + gd->reloc_off -
+ TOTAL_MALLOC_LEN;
+#endif
+
+#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
+ gd->cpu += gd->reloc_off;
#endif
#ifdef CONFIG_SERIAL_MULTI
asm ("sync ; isync");
- /* initialize malloc() area */
- mem_malloc_init ();
+ mem_malloc_init (malloc_start, TOTAL_MALLOC_LEN);
malloc_bin_reloc ();
#if !defined(CONFIG_SYS_NO_FLASH)