path: root/Kconfig
diff options
authorSimon Glass <>2015-03-03 08:03:00 -0700
committerTom Rini <>2015-03-04 14:55:04 -0500
commitdb910353a126d84fe8dff7a694ea792f50fcfb6a (patch)
tree0cca558754e992284820fbc240690c13d0a00cb0 /Kconfig
parentbdfb34167f73afc7e04d52499fc14bc1cd33fec0 (diff)
arm: spl: Allow board_init_r() to run with a larger stack
At present SPL uses a single stack, either CONFIG_SPL_STACK or CONFIG_SYS_INIT_SP_ADDR. Since some SPL features (such as MMC and environment) require a lot of stack, some boards set CONFIG_SPL_STACK to point into SDRAM. They then set up SDRAM very early, before board_init_f(), so that the larger stack can be used. This is an abuse of lowlevel_init(). That function should only be used for essential start-up code which cannot be delayed. An example of a valid use is when only part of the SPL code is visible/executable, and the SoC must be set up so that board_init_f() can be reached. It should not be used for SDRAM init, console init, etc. Add a CONFIG_SPL_STACK_R option, which allows the stack to be moved to a new address before board_init_r() is called in SPL. The expected SPL flow (for CONFIG_SPL_FRAMEWORK) is documented in the README. Signed-off-by: Simon Glass <> For version 1: Acked-by: Albert ARIBAUD <> Reviewed-by: Stefan Roese <> Tested-by: Bo Shen <> Acked-by: Bo Shen <> Acked-by: Heiko Schocher <> Tested-by: Heiko Schocher <> Signed-off-by: Tom Rini <>
Diffstat (limited to 'Kconfig')
1 files changed, 18 insertions, 0 deletions
diff --git a/Kconfig b/Kconfig
index 91a0618dbb..b879461b96 100644
--- a/Kconfig
+++ b/Kconfig
@@ -96,6 +96,24 @@ config SPL
If you want to build SPL as well as the normal image, say Y.
+config SPL_STACK_R
+ depends on SPL
+ bool "Enable SDRAM location for SPL stack"
+ help
+ SPL starts off execution in SRAM and thus typically has only a small
+ stack available. Since SPL sets up DRAM while in its board_init_f()
+ function, it is possible for the stack to move there before
+ board_init_r() is reached. This option enables a special SDRAM
+ location for the SPL stack. U-Boot SPL switches to this after
+ board_init_f() completes, and before board_init_r() starts.
+ depends on SPL_STACK_R
+ hex "SDRAM location for SPL stack"
+ help
+ Specify the address in SDRAM for the SPL stack. This will be set up
+ before board_init_r() is called.
config TPL
depends on SPL && SUPPORT_TPL
OpenPOWER on IntegriCloud