From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Thu, 16 Aug 2012 07:40:28 -0700 Subject: [U-Boot] [PATCH 09/17] ARM: SPL: Only call mem_malloc_init if configured In-Reply-To: <502CA8F1.9030607@denx.de> References: <1345066254-6911-1-git-send-email-trini@ti.com> <1345066254-6911-10-git-send-email-trini@ti.com> <502CA8F1.9030607@denx.de> Message-ID: <502D065C.6050209@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 08/16/2012 01:01 AM, Stefano Babic wrote: > On 15/08/2012 23:30, Tom Rini wrote: >> We can only attempt to setup a malloc pool if >> CONFIG_SYS_SPL_MALLOC_START is defined, and not all boards require it. >> Make the call depend on the define. >> >> Signed-off-by: Tom Rini >> --- >> arch/arm/lib/spl.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/arm/lib/spl.c b/arch/arm/lib/spl.c >> index 4d33f99..71a467e 100644 >> --- a/arch/arm/lib/spl.c >> +++ b/arch/arm/lib/spl.c >> @@ -149,8 +149,10 @@ void board_init_r(gd_t *id, ulong dummy) >> u32 boot_device; >> debug(">>spl:board_init_r()\n"); >> >> +#ifdef CONFIG_SYS_SPL_MALLOC_START >> mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START, >> CONFIG_SYS_SPL_MALLOC_SIZE); >> +#endif >> >> #ifdef CONFIG_SPL_BOARD_INIT >> spl_board_init(); >> > > Agree, mem_malloc_init should be not always called. However, how are the > dependencies with other SPL configuration ? I think (but I can be wrong) > that we need it if CONFIG_SPL_LIBDISK_SUPPORT or CONFIG_SPL_FAT_SUPPORT > are set. Should we add them to your #ifdef case ? I think until we have Kconfig-style dependencies available, there's going to be a certain amount of pain here. We should probably add to docs/README.SPL that SPL_FAT_SUPPORT depends on the malloc pool and the defines that calls for (since there's a few of them not referenced right were we call mem_malloc_init). -- Tom