@@ -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
@@ -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