From c790b04d230363d03939dc008bcc80f3ba4de1ae Mon Sep 17 00:00:00 2001 From: Stefan Roese Date: Mon, 11 May 2009 15:50:12 +0200 Subject: 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 Cc: Wolfgang Denk Cc: Mike Frysinger Cc: Scott McNutt Cc: Shinya Kuribayashi Cc: Nobuhiro Iwamatsu Cc: Daniel Hellstrom Cc: Jean-Christophe PLAGNIOL-VILLARD Cc: John Rigby --- lib_blackfin/board.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib_blackfin') diff --git a/lib_blackfin/board.c b/lib_blackfin/board.c index 49465d2a0..047f16418 100644 --- a/lib_blackfin/board.c +++ b/lib_blackfin/board.c @@ -324,6 +324,10 @@ void board_init_r(gd_t * id, ulong dest_addr) post_reloc(); #endif + /* initialize malloc() area */ + mem_malloc_init(); + malloc_bin_reloc(); + #if !defined(CONFIG_SYS_NO_FLASH) /* Initialize the flash and protect u-boot by default */ extern flash_info_t flash_info[]; @@ -341,9 +345,6 @@ void board_init_r(gd_t * id, ulong dest_addr) bd->bi_flashsize = 0; bd->bi_flashoffset = 0; #endif - /* initialize malloc() area */ - mem_malloc_init(); - malloc_bin_reloc(); #ifdef CONFIG_CMD_NAND puts("NAND: "); -- cgit v1.2.3