All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: U-Boot Mailing List <u-boot@lists.denx.de>
Cc: Tom Rini <trini@konsulko.com>, Simon Glass <sjg@chromium.org>
Subject: [PATCH v4 02/12] doc: Expand SPL docs to explain the phase and config
Date: Sun,  1 Aug 2021 13:21:05 -0600	[thread overview]
Message-ID: <20210801132108.v4.2.I0d67c4ce0fa42058bebd7a5f533f4aabbafda71b@changeid> (raw)
In-Reply-To: <20210801192115.2183311-1-sjg@chromium.org>

Add a bit more information about how to use SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

(no changes since v1)

 doc/develop/spl.rst | 34 ++++++++++++++++++++++++++++++++++
 1 file changed, 34 insertions(+)

diff --git a/doc/develop/spl.rst b/doc/develop/spl.rst
index c7d08d22bf2..0fb1e1d9784 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
-- 
2.32.0.554.ge1b32706d8-goog


  parent reply	other threads:[~2021-08-01 19:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-01 19:21 [PATCH v4 00/12] vpl: Introduce a verifying program loader Simon Glass
2021-08-01 19:21 ` [PATCH v4 01/12] doc: Convert SPL documentation to ReST Simon Glass
2021-08-01 19:21 ` Simon Glass [this message]
2021-08-01 19:21 ` [PATCH v4 03/12] test: Tidy up test building with SPL Simon Glass
2021-08-01 19:21 ` [PATCH v4 04/12] spl: Move TPL_HASH_SUPPORT down next to other TPL options Simon Glass
2021-08-01 19:21 ` [PATCH v4 05/12] bloblist: Correct Kconfig dependencies Simon Glass
2021-08-01 19:21 ` [PATCH v4 06/12] avb: Don't build in SPL Simon Glass
2021-08-01 19:21 ` [PATCH v4 07/12] Makefile: Simplify devicetree rules for SPL/TPL Simon Glass
2021-08-01 19:21 ` [PATCH v4 08/12] Makefile: Tidy up the TPL build rules Simon Glass
2021-08-01 19:21 ` [PATCH v4 09/12] binman: Add VPL support Simon Glass
2021-08-01 19:21 ` [PATCH v4 10/12] Introduce Verifying Program Loader (VPL) Simon Glass
2021-08-01 19:21 ` [PATCH v4 11/12] vpl: Add Kconfig options for VPL Simon Glass
2021-08-01 19:21 ` [PATCH v4 12/12] sandbox: Add a build " Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210801132108.v4.2.I0d67c4ce0fa42058bebd7a5f533f4aabbafda71b@changeid \
    --to=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.