[PATCH] spl: spl_legacy: Fix spl_end address

Fabio Estevam festevam at gmail.com
Fri Jun 30 21:08:42 CEST 2023


On Fri, Jun 30, 2023 at 3:36 PM Fabio Estevam <festevam at gmail.com> wrote:

> I tested this with CONFIG_SPL_SEPARATE_BSS=n and it failed.

Tested this one with CONFIG_SPL_SEPARATE_BSS enabled and disabled:

--- a/common/spl/spl_legacy.c
+++ b/common/spl/spl_legacy.c
@@ -18,9 +18,17 @@

 static void spl_parse_legacy_validate(uintptr_t start, uintptr_t size)
 {
-       uintptr_t spl_start = (uintptr_t)_start;
-       uintptr_t spl_end = (uintptr_t)__bss_end;
        uintptr_t end = start + size;
+       uintptr_t spl_start;
+       uintptr_t spl_end;
+
+       if (IS_ENABLED(CONFIG_SPL_SEPARATE_BSS)) {
+               spl_start = (uintptr_t)_start;
+               spl_end = (uintptr_t)_image_binary_end;
+       } else {
+               spl_start = (uintptr_t)__bss_start;
+               spl_end = (uintptr_t)__bss_end;
+       }

Does it look okay?


More information about the U-Boot mailing list