U-Boot Archive on 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: Simon Glass <sjg@chromium.org>,
	AKASHI Takahiro <akashi.tkhro@gmail.com>,
	Eddie James <eajames@linux.ibm.com>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Marek Vasut <marex@denx.de>,
	Mattijs Korpershoek <mkorpershoek@baylibre.com>,
	Sean Anderson <seanga2@gmail.com>,
	Sughosh Ganu <sughosh.ganu@linaro.org>,
	Tom Rini <trini@konsulko.com>
Subject: [PATCH 16/19] boot: Allow use of FIT in TPL and VPL
Date: Thu, 29 Aug 2024 08:57:59 -0600	[thread overview]
Message-ID: <20240829145802.1827952-17-sjg@chromium.org> (raw)
In-Reply-To: <20240829145802.1827952-1-sjg@chromium.org>

With VBE we want to use FIT in all phases of the boot. Add Kconfig
options to support this.

Disable the options for sandbox_vpl for now.

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

 boot/Kconfig                  | 69 ++++++++++++++++++++++++++++++++++-
 boot/Makefile                 |  4 +-
 configs/sandbox_vpl_defconfig |  3 +-
 3 files changed, 71 insertions(+), 5 deletions(-)

diff --git a/boot/Kconfig b/boot/Kconfig
index 7ac34574079..afe04c7327a 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -161,6 +161,18 @@ config SPL_FIT
 	select SPL_HASH
 	select SPL_OF_LIBFDT
 
+config VPL_FIT
+	bool "Support Flattened Image Tree within VPL"
+	depends on VPL
+	select VPL_HASH
+	select VPL_OF_LIBFDT
+
+config TPL_FIT
+	bool "Support Flattened Image Tree within TPL"
+	depends on TPL
+	select TPL_HASH
+	select TPL_OF_LIBFDT
+
 config SPL_FIT_PRINT
 	bool "Support FIT printing within SPL"
 	depends on SPL_FIT
@@ -265,6 +277,28 @@ config SPL_LOAD_FIT_FULL
 	  particular it can handle selecting from multiple device tree
 	  and passing the correct one to U-Boot.
 
+config TPL_LOAD_FIT
+	bool "Enable TPL loading U-Boot as a FIT (basic fitImage features)"
+	depends on TPL
+	select TPL_FIT
+	help
+	  Normally with the SPL framework a legacy image is generated as part
+	  of the build. This contains U-Boot along with information as to
+	  where it should be loaded. This option instead enables generation
+	  of a FIT (Flat Image Tree) which provides more flexibility. In
+	  particular it can handle selecting from multiple device tree
+	  and passing the correct one to U-Boot.
+
+	  This path has the following limitations:
+
+	  1. "loadables" images, other than FDTs, which do not have a "load"
+	     property will not be loaded. This limitation also applies to FPGA
+	     images with the correct "compatible" string.
+	  2. For FPGA images, the supported "compatible" list is in the
+	     doc/uImage.FIT/source_file_format.txt.
+	  3. FDTs are only loaded for images with an "os" property of "u-boot".
+	     "linux" images are also supported with Falcon boot mode.
+
 config SPL_FIT_IMAGE_POST_PROCESS
 	bool "Enable post-processing of FIT artifacts after loading by the SPL"
 	depends on SPL_LOAD_FIT
@@ -312,6 +346,22 @@ config VPL_FIT
 	select VPL_HASH
 	select VPL_OF_LIBFDT
 
+config VPL_LOAD_FIT
+	bool "Enable VPL loading U-Boot as a FIT (basic fitImage features)"
+	select VPL_FIT
+	default y
+
+config VPL_LOAD_FIT_FULL
+	bool "Enable SPL loading U-Boot as a FIT (full fitImage features)"
+	select VPL_FIT
+	help
+	  Normally with the SPL framework a legacy image is generated as part
+	  of the build. This contains U-Boot along with information as to
+	  where it should be loaded. This option instead enables generation
+	  of a FIT (Flat Image Tree) which provides more flexibility. In
+	  particular it can handle selecting from multiple device tree
+	  and passing the correct one to U-Boot.
+
 config VPL_FIT_PRINT
 	bool "Support FIT printing within VPL"
 	depends on VPL_FIT
@@ -632,6 +682,15 @@ config VPL_BOOTMETH_VBE
 	  supports selection of various firmware components, selection of an OS to
 	  boot as well as updating these using fwupd.
 
+config TPL_BOOTMETH_VBE
+	bool "Bootdev support for Verified Boot for Embedded (TPL)"
+	depends on TPL
+	default y
+	help
+	  Enables support for VBE boot. This is a standard boot method which
+	  supports selection of various firmware components, seleciton of an OS to
+	  boot as well as updating these using fwupd.
+
 if BOOTMETH_VBE
 
 config BOOTMETH_VBE_REQUEST
@@ -710,7 +769,15 @@ config VPL_BOOTMETH_VBE_SIMPLE_FW
 	  This option enabled for VPL, since it is the phase where the SPL
 	  decision is made.
 
-endif # BOOTMETH_VBE
+config TPL_BOOTMETH_VBE_SIMPLE_FW
+	bool "Bootdev support for VBE 'simple' method firmware phase (TPL)"
+	depends on VPL
+	default y
+	help
+	  Enables support for the firmware parts of VBE 'simple' boot, in TPL.
+	  TPL loads a FIT containing the VPL binary and a suitable devicetree.
+
+endif # BOOTMETH_VBE_SIMPLE
 
 config EXPO
 	bool "Support for expos - groups of scenes displaying a UI"
diff --git a/boot/Makefile b/boot/Makefile
index f4675d6ffd5..40e2337de0f 100644
--- a/boot/Makefile
+++ b/boot/Makefile
@@ -58,9 +58,7 @@ obj-$(CONFIG_$(SPL_TPL_)FIT_CIPHER) += image-cipher.o
 
 obj-$(CONFIG_CMD_ADTIMG) += image-android-dt.o
 
-ifdef CONFIG_SPL_BUILD
-obj-$(CONFIG_SPL_LOAD_FIT) += common_fit.o
-endif
+obj-$(CONFIG_$(SPL_TPL_)LOAD_FIT) += common_fit.o
 
 obj-$(CONFIG_$(SPL_TPL_)EXPO) += expo.o scene.o expo_build.o
 obj-$(CONFIG_$(SPL_TPL_)EXPO) += scene_menu.o scene_textline.o
diff --git a/configs/sandbox_vpl_defconfig b/configs/sandbox_vpl_defconfig
index 96e9211bd19..d18bb7a0353 100644
--- a/configs/sandbox_vpl_defconfig
+++ b/configs/sandbox_vpl_defconfig
@@ -27,9 +27,10 @@ CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_FIT_BEST_MATCH=y
 CONFIG_SPL_LOAD_FIT=y
+# CONFIG_TPL_BOOTMETH_VBE is not set
+# CONFIG_TPL_BOOTMETH_VBE_SIMPLE_FW is not set
 CONFIG_UPL=y
 CONFIG_UPL_IN=y
-CONFIG_SPL_UPL_OUT=y
 CONFIG_BOOTSTAGE=y
 CONFIG_BOOTSTAGE_REPORT=y
 CONFIG_BOOTSTAGE_FDT=y
-- 
2.34.1


  parent reply	other threads:[~2024-08-29 15:01 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 14:57 [PATCH 00/19] vbe: Series part E Simon Glass
2024-08-29 14:57 ` [PATCH 01/19] image: Add a prototype for fit_image_get_phase() Simon Glass
2024-08-29 14:57 ` [PATCH 02/19] serial: ns16550: Allow clocks to be missing Simon Glass
2024-08-29 17:24   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-08-29 14:57 ` [PATCH 03/19] boot: Allow FIT to fall back from best-match option Simon Glass
2024-09-04 22:25   ` Tom Rini
2024-09-20 15:59     ` Simon Glass
2024-09-20 16:34       ` Tom Rini
2024-08-29 14:57 ` [PATCH 04/19] bootstd: Avoid sprintf() in SPL when creating bootdevs Simon Glass
2024-08-29 14:57 ` [PATCH 05/19] boot: Respect the load_op in fit_image_load() Simon Glass
2024-09-04 22:25   ` Tom Rini
2024-08-29 14:57 ` [PATCH 06/19] malloc: Show amount of used space when memory runs out Simon Glass
2024-08-29 17:26   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-09-20 14:59       ` Tom Rini
2024-09-20 16:04         ` Simon Glass
2024-09-20 16:35           ` Tom Rini
2024-09-21 11:37             ` Simon Glass
2024-08-29 14:57 ` [PATCH 07/19] malloc: Provide a simple malloc for VPL Simon Glass
2024-08-29 14:57 ` [PATCH 08/19] Support setting a maximum size for the VPL image Simon Glass
2024-08-29 14:57 ` [PATCH 09/19] spl: Report a loader failure Simon Glass
2024-08-29 14:57 ` [PATCH 10/19] spl: Allow serial to be disabled in any XPL phase Simon Glass
2024-08-29 14:57 ` [PATCH 11/19] spl: Support a relocated stack " Simon Glass
2024-08-29 14:57 ` [PATCH 12/19] spl: Drop use of uintptr_t Simon Glass
2024-08-29 14:57 ` [PATCH 13/19] spl: Drop a duplicate variable in boot_from_devices() Simon Glass
2024-08-29 14:57 ` [PATCH 14/19] spl: Add some more debugging to load_simple_fit() Simon Glass
2024-08-29 14:57 ` [PATCH 15/19] spl: lib: Allow for decompression in any SPL build Simon Glass
2024-08-29 14:57 ` Simon Glass [this message]
2024-08-29 14:58 ` [PATCH 17/19] lib: Allow crc8 in TPL and VPL Simon Glass
2024-08-29 17:30   ` Tom Rini
2024-08-29 14:58 ` [PATCH 18/19] boot: Imply CRC8 with VBE Simon Glass
2024-08-29 17:31   ` Tom Rini
2024-09-20  7:25     ` Simon Glass
2024-08-29 14:58 ` [PATCH 19/19] hash: Plumb crc8 into the hash functions Simon Glass
2024-08-30 12:17   ` Peter Robinson
2024-09-01 20:09     ` Simon Glass
2024-08-29 18:32 ` [PATCH 00/19] vbe: Series part E Tom Rini
2024-08-30  1:06   ` Simon Glass
2024-08-30 12:18 ` Caleb Connolly
2024-09-19 14:11   ` 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=20240829145802.1827952-17-sjg@chromium.org \
    --to=sjg@chromium.org \
    --cc=akashi.tkhro@gmail.com \
    --cc=eajames@linux.ibm.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=marex@denx.de \
    --cc=mkorpershoek@baylibre.com \
    --cc=seanga2@gmail.com \
    --cc=sughosh.ganu@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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