summaryrefslogtreecommitdiff
path: root/common/init
Commit message (Collapse)AuthorAgeLines
* board_init: Change the logic to setup malloc_baseFabio Estevam2015-11-12-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 5ba534d247d418 ("arm: Switch 32-bit ARM to using generic global_data setup") we used to have assembly code that configured the malloc_base address. Since this commit we use the board_init_f_mem() function in C to setup malloc_base address. In board_init_f_mem() there was a deliberate choice to support only early malloc() or full malloc() in SPL, but not both. Adapt this logic to allow both to be used, one after the other, in SPL. This issue has been observed in a Congatec board, where we need to retrieve the manufacturing information from the SPI NOR (the SPI API calls malloc) prior to configuring the DRAM. In this case as malloc_base was not configured we always see malloc to fail. With this change we are able to use malloc in SPL prior to DRAM gets initialized. Also update the CONFIG_SYS_SPL_MALLOC_START entry in the README file. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* board_init_f_mem(): Don't create an unused early malloc() areaSimon Glass2015-10-24-1/+2
| | | | | | | | | Change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Masahiro Yamada <yamada.masahiro@socionext.com>
* board_init_f_mem(): Don't require memset()Simon Glass2015-10-24-0/+18
| | | | | | | Unfortunately memset() is not always available, so provide a substitute when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* Move board_init_f_mem() into a common locationSimon Glass2015-10-24-0/+48
This function will be used by both SPL and U-Boot proper. So move it into a common place. Also change the #ifdef so that the early malloc() area is not set up in SPL if CONFIG_SYS_SPL_MALLOC_START is defined. In that case it would never actually be used, and just chews up stack space. Signed-off-by: Simon Glass <sjg@chromium.org>