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_nios/board.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib_nios') diff --git a/lib_nios/board.c b/lib_nios/board.c index 63e79aec2..9d8eea796 100644 --- a/lib_nios/board.c +++ b/lib_nios/board.c @@ -142,12 +142,14 @@ void board_init (void) } } + WATCHDOG_RESET (); + mem_malloc_init(); + malloc_bin_reloc(); + WATCHDOG_RESET (); bd->bi_flashsize = flash_init(); WATCHDOG_RESET (); - mem_malloc_init(); - malloc_bin_reloc(); env_relocate(); bd->bi_ip_addr = getenv_IPaddr ("ipaddr"); -- cgit v1.2.3