u-boot.lists.denx.de archive mirror
 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 v6 02/11] doc: Expand SPL docs to explain the phase and config
Date: Sun, 19 Sep 2021 17:48:11 -0600	[thread overview]
Message-ID: <20210919174815.v6.2.I0d67c4ce0fa42058bebd7a5f533f4aabbafda71b@changeid> (raw)
In-Reply-To: <20210919234820.3840570-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.33.0.464.g1972c5931b-goog


  parent reply	other threads:[~2021-09-19 23:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-19 23:48 [PATCH v6 00/11] vpl: Introduce a verifying program loader Simon Glass
2021-09-19 23:48 ` [PATCH v6 01/11] doc: Convert SPL documentation to ReST Simon Glass
2021-09-19 23:48 ` Simon Glass [this message]
2021-09-19 23:48 ` [PATCH v6 03/11] test: Tidy up test building with SPL Simon Glass
2021-09-19 23:48 ` [PATCH v6 04/11] bloblist: Correct Kconfig dependencies Simon Glass
2021-09-19 23:48 ` [PATCH v6 05/11] avb: Don't build in SPL Simon Glass
2021-09-19 23:48 ` [PATCH v6 06/11] Makefile: Simplify devicetree rules for SPL/TPL Simon Glass
2021-09-19 23:48 ` [PATCH v6 07/11] Makefile: Tidy up the TPL build rules Simon Glass
2021-09-19 23:48 ` [PATCH v6 08/11] binman: Add VPL support Simon Glass
2021-09-19 23:48 ` [PATCH v6 09/11] Introduce Verifying Program Loader (VPL) Simon Glass
2021-09-19 23:48 ` [PATCH v6 10/11] vpl: Add Kconfig options for VPL Simon Glass
2021-09-19 23:48 ` [PATCH v6 11/11] 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=20210919174815.v6.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).