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>
}
}
+ /* 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 ());
}
#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 */
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[];
bd->bi_flashsize = 0;
bd->bi_flashoffset = 0;
#endif
- /* initialize malloc() area */
- mem_malloc_init();
- malloc_bin_reloc();
#ifdef CONFIG_CMD_NAND
puts("NAND: ");
*/
trap_init (CONFIG_SYS_SDRAM_BASE);
+ /* initialize malloc() area */
+ mem_malloc_init ();
+ malloc_bin_reloc ();
+
#if !defined(CONFIG_SYS_NO_FLASH)
puts ("FLASH: ");
WATCHDOG_RESET ();
- /* initialize malloc() area */
- mem_malloc_init ();
- malloc_bin_reloc ();
-
#ifdef CONFIG_SPI
# if !defined(CONFIG_ENV_IS_IN_EEPROM)
spi_init_f ();
bd = gd->bd;
+ /* initialize malloc() area */
+ mem_malloc_init();
+ malloc_bin_reloc();
+
#ifndef CONFIG_SYS_NO_FLASH
/* configure available FLASH banks */
size = flash_init();
bd->bi_flashoffset = 0;
#endif
- /* initialize malloc() area */
- mem_malloc_init();
- malloc_bin_reloc();
-
#ifdef CONFIG_CMD_NAND
puts ("NAND: ");
nand_init (); /* go init the NAND */
}
}
+ 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");
}
}
+ 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");
asm ("sync ; isync");
+ /* initialize malloc() area */
+ mem_malloc_init ();
+ malloc_bin_reloc ();
+
#if !defined(CONFIG_SYS_NO_FLASH)
puts ("FLASH: ");
WATCHDOG_RESET ();
- /* initialize malloc() area */
- mem_malloc_init ();
- malloc_bin_reloc ();
-
#ifdef CONFIG_SPI
# if !defined(CONFIG_ENV_IS_IN_EEPROM)
spi_init_f ();
checkboard, /* Check support board */
dram_init, /* SDRAM init */
timer_init, /* SuperH Timer (TCNT0 only) init */
- sh_flash_init, /* Flash memory(NOR) init*/
sh_mem_env_init,
+ sh_flash_init, /* Flash memory(NOR) init*/
INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */
INIT_FUNC_PCI_INIT /* PCI init */
devices_init,
*/
interrupt_init();
+ /* initialize malloc() area */
+ mem_malloc_init();
+ malloc_bin_reloc();
+
#if !defined(CONFIG_SYS_NO_FLASH)
puts("FLASH: ");
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();