]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
spl: Use CONFIG_VAL() to obtain the SPL stack
authorSimon Glass <sjg@chromium.org>
Fri, 28 Feb 2025 12:20:25 +0000 (05:20 -0700)
committerTom Rini <trini@konsulko.com>
Thu, 13 Mar 2025 16:36:10 +0000 (10:36 -0600)
Now that we have the same option for SPL and TPL, simplify the logic for
determining the initial stack.

Note that this changes behaviour as current SPL_STACK is a fallback for
TPL. However, that was likely unintended and can be handled with Kconfig
defaults if needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
Suggested-by: Tom Rini <trini@konsulko.com>
arch/arm/cpu/armv7/lowlevel_init.S
arch/arm/cpu/armv7/start.S
arch/arm/lib/crt0.S
arch/arm/lib/crt0_64.S
arch/riscv/cpu/start.S
common/spl/Kconfig.tpl

index c2a0fe061a33c6f037ac14d4df8b222ec1ae6241..72b7b7d082cacce533f2f8732f70c38bc402a900 100644 (file)
@@ -26,8 +26,8 @@ WEAK(lowlevel_init)
        /*
         * Setup a temporary stack. Global data is not available yet.
         */
-#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_HAVE_INIT_STACK)
-       ldr     sp, =CONFIG_SPL_STACK
+#if CONFIG_IS_ENABLED(HAVE_INIT_STACK)
+       ldr     sp, =CONFIG_VAL(STACK)
 #else
        ldr     sp, =SYS_INIT_SP_ADDR
 #endif
index 3394db46953daa679b386cc66f4a52efb1e8fe74..959251957de466cc2410578a07269b6bf7bdb40a 100644 (file)
@@ -279,8 +279,8 @@ ENTRY(cpu_init_cp15)
        orr     r2, r4, r2              @ r2 has combined CPU variant + revision
 
 /* Early stack for ERRATA that needs into call C code */
-#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_HAVE_INIT_STACK)
-       ldr     r0, =(CONFIG_SPL_STACK)
+#if CONFIG_IS_ENABLED(HAVE_INIT_STACK)
+       ldr     r0, =CONFIG_VAL(STACK)
 #else
        ldr     r0, =(SYS_INIT_SP_ADDR)
 #endif
index 0248606906a537c14b2f64238e5080d91e268c1f..a50dde60e8be35500e0a6511d013b2153ab3eb41 100644 (file)
@@ -100,10 +100,8 @@ ENTRY(_main)
  * Set up initial C runtime environment and call board_init_f(0).
  */
 
-#if defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_HAVE_INIT_STACK)
-       ldr     r0, =(CONFIG_TPL_STACK)
-#elif defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_HAVE_INIT_STACK)
-       ldr     r0, =(CONFIG_SPL_STACK)
+#if CONFIG_IS_ENABLED(HAVE_INIT_STACK)
+       ldr     r0, =CONFIG_VAL(STACK)
 #else
        ldr     r0, =(SYS_INIT_SP_ADDR)
 #endif
index 1b6782b06ed63f2188ebef406570f7bd81b45535..30950ddaf9b8e9e518985b7700d38ba1c99c6ddd 100644 (file)
@@ -69,10 +69,8 @@ ENTRY(_main)
 /*
  * Set up initial C runtime environment and call board_init_f(0).
  */
-#if defined(CONFIG_TPL_BUILD) && defined(CONFIG_TPL_HAVE_INIT_STACK)
-       ldr     x0, =(CONFIG_TPL_STACK)
-#elif defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_HAVE_INIT_STACK)
-       ldr     x0, =(CONFIG_SPL_STACK)
+#if CONFIG_IS_ENABLED(HAVE_INIT_STACK)
+       ldr     x0, =CONFIG_VAL(STACK)
 #elif defined(CONFIG_INIT_SP_RELATIVE)
 #if CONFIG_POSITION_INDEPENDENT
        adrp    x0, __bss_start     /* x0 <- Runtime &__bss_start */
index c8526dd82fd9966d793817dffbd3b36e3985f103..7bafdfd390a43eae3313b9dc0b0e7e2c2b1b7b01 100644 (file)
@@ -90,8 +90,8 @@ _start:
  * Set stackpointer in internal/ex RAM to call board_init_f
  */
 call_board_init_f:
-#if defined(CONFIG_XPL_BUILD) && defined(CONFIG_SPL_HAVE_INIT_STACK)
-       li      t0, CONFIG_SPL_STACK
+#if CONFIG_IS_ENABLED(HAVE_INIT_STACK)
+       li      t0, CONFIG_VAL(STACK)
 #else
        li      t0, SYS_INIT_SP_ADDR
 #endif
index 421352f9396b70a97c5f95648c46029def3c1628..a535b61ecd3589f32607581794cb2b658b327285 100644 (file)
@@ -138,8 +138,8 @@ config TPL_HAVE_INIT_STACK
        bool "TPL requires a initial, fixed, stack-pointer location"
        help
          Enable if the TPL phase should not inherit its initial
-         stack-pointer from the settings for U-Boot proper (or SPL if
-         SPL_STACK is defined), but should set its own value.
+         stack-pointer from the settings for U-Boot proper, but should set its
+         own value.
 
 config TPL_STACK
        hex "Address of the initial stack-pointer for the TPL phase"