summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2022-04-30 09:56:46 +0300
committerTom Rini <trini@konsulko.com>2022-05-02 16:58:13 +0300
commita36d251b509d9ed64ec0fc0f0dafc5dc0748e734 (patch)
tree223f6e49bd55e0aa88d2ca62773c15fbe680d226 /doc
parentd411359d919a7efae5e9379b83986c553bc57b34 (diff)
downloadu-boot-a36d251b509d9ed64ec0fc0f0dafc5dc0748e734.tar.xz
doc: Expand SPL docs to explain the phase and config
Add a bit more information about how to use SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'doc')
-rw-r--r--doc/develop/spl.rst34
1 files changed, 34 insertions, 0 deletions
diff --git a/doc/develop/spl.rst b/doc/develop/spl.rst
index 4d6f394bed..1059b2fb9c 100644
--- a/doc/develop/spl.rst
+++ b/doc/develop/spl.rst
@@ -66,6 +66,40 @@ CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
CONFIG_SPL_RAM_DEVICE (common/spl/spl.c)
CONFIG_SPL_WATCHDOG (drivers/watchdog/libwatchdog.o)
+Adding SPL-specific code
+------------------------
+
+To check whether a feature is enabled, use CONFIG_IS_ENABLED()::
+
+ if (CONFIG_IS_ENABLED(CLK))
+ ...
+
+This checks CONFIG_CLK for the main build, CONFIG_SPL_CLK for the SPL build,
+CONFIG_TPL_CLK for the TPL build, etc.
+
+U-Boot Phases
+-------------
+
+U-Boot boots through the following phases:
+
+TPL
+ Very early init, as tiny as possible. This loads SPL.
+
+SPL
+ Secondary program loader. Sets up SDRAM and loads U-Boot proper. It may also
+ load other firmware components.
+
+U-Boot
+ U-Boot proper, containing the command line and boot logic.
+
+
+Checking the boot phase
+-----------------------
+
+Use `spl_phase()` to find the current U-Boot phase, e.g. `PHASE_SPL`. You can
+also find the previous and next phase and get the phase name.
+
+
Device tree
-----------
The U-Boot device tree is filtered by the fdtgrep tools during the build