From patchwork Thu May 16 20:54:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dannenberg X-Patchwork-Id: 1100732 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=quarantine dis=none) header.from=ti.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ti.com header.i=@ti.com header.b="hOw3E9Du"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 454kNs6VFJz9s9T for ; Fri, 17 May 2019 07:01:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 8804FC21DED; Thu, 16 May 2019 20:57:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A5B62C21E39; Thu, 16 May 2019 20:55:37 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3C19CC21D8A; Thu, 16 May 2019 20:55:32 +0000 (UTC) Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lists.denx.de (Postfix) with ESMTPS id 0F23BC21C4A for ; Thu, 16 May 2019 20:55:31 +0000 (UTC) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id x4GKtSm0005897; Thu, 16 May 2019 15:55:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1558040128; bh=/tsRDRSDXeNQuVro0u4Ss9B6UePCnWhbdY8p5nI4WLM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=hOw3E9DucucmoemmQmCViB0yd+T5/VBZXNBXhyVuyREbrLNXrL6f/5KpwewQIyRoH RWDcnD72QmDiH57AQIyJnXpQYSkyLcN1NPlvtx660Fr2iqJJwj0vqYpNeK4Z4UfZwu vS2rhwO0f3+oLjWNtXKwxCxcEeTBY+Linkj3rBEM= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x4GKtSba003208 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 16 May 2019 15:55:28 -0500 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Thu, 16 May 2019 15:55:28 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Thu, 16 May 2019 15:55:27 -0500 Received: from jiji.dal.design.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id x4GKtRxD054956; Thu, 16 May 2019 15:55:27 -0500 From: Andreas Dannenberg To: Tom Rini Date: Thu, 16 May 2019 15:54:45 -0500 Message-ID: <20190516205454.22150-3-dannenberg@ti.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190516205454.22150-1-dannenberg@ti.com> References: <20190516205454.22150-1-dannenberg@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Cc: U-Boot Mailing List , Tien Fong Chee Subject: [U-Boot] [RFC 02/11] spl: Allow skipping clearing BSS during relocation X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" On some platform we have sufficient memory available early on to allow setting up and using a basic BSS prior to relocation. In order to be able to preserve data written to BSS during early startup add a Kconfig option allowing to skip the clearing of the BSS section during setting up of the final environment / relocation. Signed-off-by: Andreas Dannenberg Reviewed-by: Tom Rini --- arch/arm/lib/crt0.S | 3 +++ common/spl/Kconfig | 13 +++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm/lib/crt0.S b/arch/arm/lib/crt0.S index 30fba20e1b..e24833a6f8 100644 --- a/arch/arm/lib/crt0.S +++ b/arch/arm/lib/crt0.S @@ -126,6 +126,8 @@ here: movne sp, r0 movne r9, r0 # endif + +#if !CONFIG_IS_ENABLED(SKIP_CLEAR_BSS) ldr r0, =__bss_start /* this is auto-relocated! */ #ifdef CONFIG_USE_ARCH_MEMSET @@ -143,6 +145,7 @@ clbss_l:cmp r0, r1 /* while not at end of BSS */ addlo r0, r0, #4 /* move to next */ blo clbss_l #endif +#endif #if ! defined(CONFIG_SPL_BUILD) bl coloured_LED_init diff --git a/common/spl/Kconfig b/common/spl/Kconfig index c7cd34449a..098cbb2f7f 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -188,6 +188,19 @@ config TPL_BANNER_PRINT info. Disabling this option could be useful to reduce SPL boot time (e.g. approx. 6 ms faster, when output on i.MX6 with 115200 baud). + +config SPL_SKIP_CLEAR_BSS + depends on ARM && !ARM64 + bool "Skips clearing BSS section during environment setup / relocation" + help + On some platform we have sufficient memory available early on to + allow setting up and using a basic BSS prior to relocation. In order + to preserve data written to BSS during early startup use use this + option to skip the clearing of the BSS section. Note that activating + this option implies that you are responsible for clearing the BSS + section yourself, otherwise you will most likely end up with an + invalid post-relocation environment. + config SPL_DISPLAY_PRINT bool "Display a board-specific message in SPL" help