lib_arch/board.c: Move malloc initialization before flash_init()

This patch moves the malloc initialization before calling flash_init().
Upcoming changes to the NOR FLASH common CFI driver with optional
MTD infrastructure and MTD concatenation support will call malloc().
And nothing really speaks against enabling malloc just a little earlier
in the boot stage. Some architectures already enable malloc before
calling flash_init() so they don't need any changes here.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Scott McNutt <smcnutt@psyent.com>
Cc: Shinya Kuribayashi <shinya.kuribayashi@necel.com>
Cc: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Cc: John Rigby <jcrigby@gmail.com>
This commit is contained in:
Stefan Roese
2009-05-11 15:50:12 +02:00
committed by Wolfgang Denk
parent d873133f2b
commit c790b04d23
9 changed files with 32 additions and 28 deletions

View File

@@ -331,6 +331,10 @@ void board_init_f(ulong bootflag)
*/
interrupt_init();
/* initialize malloc() area */
mem_malloc_init();
malloc_bin_reloc();
#if !defined(CONFIG_SYS_NO_FLASH)
puts("FLASH: ");
@@ -371,11 +375,6 @@ void board_init_f(ulong bootflag)
bd->bi_flashoffset = 0;
#endif /* !CONFIG_SYS_NO_FLASH */
/* initialize malloc() area */
mem_malloc_init();
malloc_bin_reloc();
#ifdef CONFIG_SPI
# if !defined(CONFIG_ENV_IS_IN_EEPROM)
spi_init_f();