From patchwork Fri Jul 11 04:23:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 368946 X-Patchwork-Delegate: sjg@chromium.org 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 3C23614010B for ; Fri, 11 Jul 2014 14:24:57 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2B2D3A79B1; Fri, 11 Jul 2014 06:24:52 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 eLN81qkTHuSR; Fri, 11 Jul 2014 06:24:51 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E5299B37CF; Fri, 11 Jul 2014 06:24:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DCEAAB37CD for ; Fri, 11 Jul 2014 06:24:08 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de 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 vDClrjPatrFd for ; Fri, 11 Jul 2014 06:24:05 +0200 (CEST) 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-ie0-f201.google.com (mail-ie0-f201.google.com [209.85.223.201]) by theia.denx.de (Postfix) with ESMTPS id E6CEAB37B4 for ; Fri, 11 Jul 2014 06:23:57 +0200 (CEST) Received: by mail-ie0-f201.google.com with SMTP id lx4so122440iec.2 for ; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=6xO1Keef1RZLQRycY1Tu9vGx/669qNxUO1Zetyiz5eo=; b=BRvO2JcIE3OeC4xZgOyFbZpTILPTXiM0RKXDbbYYk6zxePqgi9wM+Oof/t9Pfdo5uA nkL+yxoAp/KijhhGE8pGHlo8A5DIbRq12XpjFYyfloAJv4VkkAW5lYWI+a8ETGW4NXKV HrYEAiEEIorouTAZffGqFrkXakcaZt/8AHe1asp0QMvPJA0Gx5uis4H+Gg1xT3nLI0bh sg4kXHnlbtAuOgYRpuD9XeA1XD0yh1VRuDKGwVs3z5hgPk0LjNVCaYB/pYfA6POXdsps Ug9H3XQER0IJatFSHt9qsuwSc3kIE/VXQWL20+GnNBamTWQHWIrZaA2nW2HUZe0Y4Vmw Fr6w== X-Gm-Message-State: ALoCoQnyKjkL/o4+m1mIVgernCNdO0LAexmXfDQBV6U2Bay65upWgXARlh/ofWnUtjOqzea4u5iK X-Received: by 10.42.151.67 with SMTP id d3mr955157icw.6.1405052636600; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id c50si91211yhl.7.2014.07.10.21.23.56 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: from kaki.bld.corp.google.com (kaki.bld.corp.google.com [172.29.216.32]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 6B3DD31C3F8; Thu, 10 Jul 2014 21:23:56 -0700 (PDT) Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 25175220922; Thu, 10 Jul 2014 22:23:56 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 10 Jul 2014 22:23:29 -0600 Message-Id: <1405052613-20987-6-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 In-Reply-To: <1405052613-20987-1-git-send-email-sjg@chromium.org> References: <1405052613-20987-1-git-send-email-sjg@chromium.org> Cc: Jeroen Hofstee Subject: [U-Boot] [PATCH v3 5/9] arm: Support pre-relocation malloc() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Add support for re-relocation malloc() in arm's start-up code. Signed-off-by: Simon Glass --- Changes in v3: - Rebase on earlier patch Changes in v2: None README | 3 +++ arch/arm/lib/crt0.S | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README b/README index 11e9d31..73abbf0 100644 --- a/README +++ b/README @@ -3749,6 +3749,9 @@ Configuration Settings: The memory will be freed (or in fact just forgotton) when U-Boot relocates itself. + Pre-relocation malloc() is only supported on ARM at present + but is fairly easy to enable for other archs. + - CONFIG_SYS_BOOTM_LEN: Normally compressed uImages are limited to an uncompressed size of 8 MBytes. If this is not enough, diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 43aa212..29cdad0 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -78,7 +78,10 @@ clr_gd: strlo r0, [r1] /* clear 32-bit GD word */ addlo r1, r1, #4 /* move to next */ blo clr_gd - +#if defined(CONFIG_SYS_MALLOC_F_LEN) && !defined(CONFIG_SPL_BUILD) + sub sp, sp, #CONFIG_SYS_MALLOC_F_LEN + str sp, [r9, #GD_MALLOC_BASE] +#endif /* mov r0, #0 not needed due to above code */ bl board_init_f