From patchwork Wed Nov 11 20:41:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 543096 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 37408141301 for ; Thu, 12 Nov 2015 07:41:18 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=VfGGUKok; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA3CE4B716; Wed, 11 Nov 2015 21:41:15 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id zbbNIwZgO_Nr; Wed, 11 Nov 2015 21:41:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C80F74B70A; Wed, 11 Nov 2015 21:41:14 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E32004B70A for ; Wed, 11 Nov 2015 21:41:10 +0100 (CET) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wppoFpyro8jK for ; Wed, 11 Nov 2015 21:41:10 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-io0-f172.google.com (mail-io0-f172.google.com [209.85.223.172]) by theia.denx.de (Postfix) with ESMTPS id 6BCCD4B6EF for ; Wed, 11 Nov 2015 21:41:06 +0100 (CET) Received: by ioc74 with SMTP id 74so45243953ioc.2 for ; Wed, 11 Nov 2015 12:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=GnTSyiLsLdu3qNKuurIePST+RRmqx1PwSY6cyoFZg5Y=; b=VfGGUKokXVG0Riytw35lMomgeIanw5aL2+WYqWnia4nVC4wq9laWP78PWdo/45epGg 8Pvf67S6p13rJ6FkYbJi90CEKCEPA2EdGgPI7aEeBriIaXS3fxf0rWhyopP/ECr3juBh y9b3ciRTyyEQ34Fqy7LwSMyM6+a1TTrb9KFuGn8GkMb+k9CA02s6M+sDRNOzz9KkQsF9 RXRAlTQj2YNlnW9N1vrfTqvyGoxcuMHOqUO5pljm/C9FUZzIAkKIeBGMGzab3tEp7X9Q rn2gO7goZv0BVmru9gmzLMLgdEEaxYio77hJoJ1L1kpBnvBxnrzMKpx8By0q0y6xKYa1 C5Fw== MIME-Version: 1.0 X-Received: by 10.107.130.167 with SMTP id m39mr11592301ioi.18.1447274465128; Wed, 11 Nov 2015 12:41:05 -0800 (PST) Received: by 10.79.1.76 with HTTP; Wed, 11 Nov 2015 12:41:05 -0800 (PST) In-Reply-To: References: <1447273397-22833-1-git-send-email-festevam@gmail.com> Date: Wed, 11 Nov 2015 18:41:05 -0200 Message-ID: From: Fabio Estevam To: Simon Glass Cc: U-Boot Mailing List , Fabio Estevam , Tom Rini Subject: Re: [U-Boot] [PATCH] ARM: crt0: Pass malloc base address X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Hi Simon, On Wed, Nov 11, 2015 at 6:26 PM, Simon Glass wrote: > Thanks for digging into this. But this should be set up in board_init_f_mem(): > > #if defined(CONFIG_SYS_MALLOC_F) && \ > (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START)) > top -= CONFIG_SYS_MALLOC_F_LEN; > gd->malloc_base = top; > #endif > > Is it possible that the #ifdef logic is wrong for your board? Good point. Looks like this is the problem indeed. I have manually removed the #ifdef logic just for testing: ,and then malloc() works fine in SPL. Doing a make mx6sabresd_spl_defconfig I get: CONFIG_SYS_MALLOC_F=y For SPL_BUILD I get in menuconfig: Symbol: SPL_BUILD [=SPL_BUILD] Type : unknown and CONFIG_SYS_SPL_MALLOC_START does not exist. Regards, Fabio Estevam --- a/common/init/board_init.c +++ b/common/init/board_init.c @@ -50,11 +50,8 @@ ulong board_init_f_mem(ulong top) #endif arch_setup_gd(gd_ptr); -#if defined(CONFIG_SYS_MALLOC_F) && \ - (!defined(CONFIG_SPL_BUILD) || !defined(CONFIG_SYS_SPL_MALLOC_START)) top -= CONFIG_SYS_MALLOC_F_LEN; gd->malloc_base = top; -#endif return top; }