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_arm/board.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib_arm') diff --git a/lib_arm/board.c b/lib_arm/board.c index 5d05d9b927..e3040acdc6 100644 --- a/lib_arm/board.c +++ b/lib_arm/board.c @@ -316,6 +316,9 @@ void start_armboot (void) } } + /* armboot_start is defined in the board-specific linker script */ + mem_malloc_init (_armboot_start - CONFIG_SYS_MALLOC_LEN); + #ifndef CONFIG_SYS_NO_FLASH /* configure available FLASH banks */ display_flash_config (flash_init ()); @@ -350,9 +353,6 @@ void start_armboot (void) } #endif /* CONFIG_LCD */ - /* armboot_start is defined in the board-specific linker script */ - mem_malloc_init (_armboot_start - CONFIG_SYS_MALLOC_LEN); - #if defined(CONFIG_CMD_NAND) puts ("NAND: "); nand_init(); /* go init the NAND */ -- cgit v1.2.1