[U-Boot] [RFC 02/11] spl: Allow skipping clearing BSS during relocation
Andreas Dannenberg
dannenberg at ti.com
Thu May 16 20:54:45 UTC 2019
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 at ti.com>
Reviewed-by: Tom Rini <trini at konsulko.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 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
--
2.17.1
More information about the U-Boot
mailing list