From: Tom Rini Date: Wed, 18 Nov 2015 17:35:14 -0500 Subject: [U-Boot] [U-Boot, v3] board_init: Change the logic to setup malloc_base In-Reply-To: <1447338619-32329-1-git-send-email-fabio.estevam@freescale.com> References: <1447338619-32329-1-git-send-email-fabio.estevam@freescale.com> Message-ID: <20151118223514.GY8060@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Thu, Nov 12, 2015 at 12:30:19PM -0200, Fabio Estevam wrote: > 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 > Reviewed-by: Simon Glass Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: