public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Andreas Dannenberg <dannenberg@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 02/13] spl: Allow skipping clearing BSS during relocation
Date: Tue, 7 May 2019 12:25:31 -0500	[thread overview]
Message-ID: <20190507172542.31359-3-dannenberg@ti.com> (raw)
In-Reply-To: <20190507172542.31359-1-dannenberg@ti.com>

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 <dannenberg@ti.com>
---
 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 fe312db690..17645469fc 100644
--- a/arch/arm/lib/crt0.S
+++ b/arch/arm/lib/crt0.S
@@ -124,6 +124,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
@@ -141,6 +143,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 dd078fe79d..f9eb1a0e31 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
-- 
2.17.1

  parent reply	other threads:[~2019-05-07 17:25 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-07 17:25 [U-Boot] [PATCH 00/13] System Firmware Loader for TI K3 family SoCs Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 01/13] mmc: k3_arasan: Allow driver to probe without PDs specified Andreas Dannenberg
2019-05-15 15:17   ` Tom Rini
2019-05-07 17:25 ` Andreas Dannenberg [this message]
2019-05-15 15:17   ` [U-Boot] [PATCH 02/13] spl: Allow skipping clearing BSS during relocation Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 03/13] spl: Make image loader infrastructure more universal Andreas Dannenberg
2019-05-15 15:17   ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 04/13] arm: K3: Introduce System Firmware loader framework Andreas Dannenberg
2019-05-07 18:16   ` Simon Goldschmidt
2019-05-07 19:17     ` Andreas Dannenberg
2019-05-07 19:21       ` Simon Goldschmidt
2019-05-15 15:17   ` Tom Rini
2019-05-15 21:39     ` Andreas Dannenberg
2019-05-15 21:50       ` Tom Rini
2019-05-16 15:47         ` Andreas Dannenberg
2019-05-16 19:14           ` Andreas Dannenberg
2019-05-17 11:20             ` Tom Rini
2019-05-07 17:25 ` [U-Boot] [PATCH 05/13] armV7R: K3: am654: Allow using SPL BSS pre-relocation Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 06/13] armv7R: K3: am654: Use full malloc implementation in SPL Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 07/13] armV7R: K3: am654: Load SYSFW binary and config from boot media Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 08/13] armv7R: dts: k3: am654: Update mmc nodes for loading sysfw Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 09/13] configs: am65x_evm_r5: All sysfw to be loaded via MMC Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 10/13] configs: am65x_hs_evm_r5: " Andreas Dannenberg
2019-05-18 16:08   ` Simon Glass
2019-05-07 17:25 ` [U-Boot] [PATCH 11/13] configs: am65x_evm: Add Support for eMMC boot Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 12/13] configs: am65x_hs_evm: " Andreas Dannenberg
2019-05-07 17:25 ` [U-Boot] [PATCH 13/13] am65x: README: Add eMMC layout and flash instructions Andreas Dannenberg
2019-05-07 20:00 ` [U-Boot] [PATCH 00/13] System Firmware Loader for TI K3 family SoCs Simon Goldschmidt
2019-05-08  4:31   ` Chee, Tien Fong
2019-05-08 18:43     ` dannenberg at ti.com
2019-05-13 13:37       ` Chee, Tien Fong
2019-05-15 21:24         ` dannenberg at ti.com
2019-05-08 18:04   ` Andreas Dannenberg
2019-05-08 18:57     ` Simon Goldschmidt
2019-05-15 15:16 ` Tom Rini
2019-05-15 20:31   ` Andreas Dannenberg
2019-05-16 20:32   ` Andreas Dannenberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190507172542.31359-3-dannenberg@ti.com \
    --to=dannenberg@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox