All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Prepare devicetrees from FIT configurations with fdt fit
@ 2026-10-26 12:18 Carlo Caione
  2026-10-26 12:18 ` [PATCH v3 1/5] boot: fit: tell callers when a devicetree buffer must be freed Carlo Caione
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Carlo Caione @ 2026-10-26 12:18 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Simon Glass, Tom Rini,
	E Shattow, David Lechner, Ahmad Fatoum, Julien Masson,
	Vitor Sato Eschholz, Randolph Sapp, Anton Ivanov, Daniel Golle,
	Aristo Chen, Jonas Karlman, Jerome Forissier, Johan Jonker,
	James Hilliard, Alexey Charkov, Vincent Jardin, Peter Robinson,
	Carlo Caione

Some boards keep a base devicetree and its overlays in a FIT, while the
kernel or EFI application comes from another source. Boot scripts need
a way to verify and assemble that tree without booting an OS from the FIT.

This series adds:

    fdt fit <addr>[#<conf>] <dest> [<len>]

The script loads the FIT into memory with an existing command. fdt fit
then prepares the devicetree described by one configuration, verifies it,
applies its overlays and copies the completed result to the chosen
destination. The script can pass that address to bootefi, booti or
another boot command, and must stop the boot if preparation fails.

The command reuses the FIT loader, always checks image hashes and
enforces any required configuration signatures, even with verify=no.
It rejects chained configurations: signing each configuration separately
does not authenticate their combination. FIT image load addresses are
ignored, so preparation does not write to them before checks complete.

The first three patches provide the loader support, including rejecting
missing or invalid overlays. The last two add the command, documentation
and sandbox tests.

Patch 2 also changes bootm, even when fdt fit is disabled. If a listed
overlay cannot be loaded or verified, bootm now aborts instead of booting
without it. Boards which previously relied on a broken overlay being
skipped must fix their FIT configuration or overlay. The new bootm tests
cover successful preparation and rejection of bad or missing overlays.

This is a new, simpler approach to the firmware-owned devicetree work
previously submitted in the EBBR series [1]. Storage, configuration
selection and boot policy stay in the script. There is no new DT binding,
storage driver or automatic hook into the EFI boot paths.

[1] https://lore.kernel.org/all/20260903-ccaione-upstream-ebbr-v3-0-016658d0b6ba@baylibre.com/

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
Changes in v3:
- Make patch 2's bootm behaviour change explicit in its commit message
  and the cover letter.
- Add direct bootm tests for valid, corrupted-hash and missing overlays,
  independent of CMD_FDT_FIT.
- Collect Simon Glass's remaining Reviewed-by tags for patch 3 and the cover.
- Link to v2: https://patch.msgid.link/20261022-ccaione-upstream-fdt-fit-v2-0-4140e0c4d5a9@baylibre.com

Changes in v2:
- Clarify that load_op controls only the base devicetree and document the
  overlay policy and enum values.
- Collect Simon Glass's Reviewed-by tags for patches 1, 2, 4 and 5.
- Link to v1: https://patch.msgid.link/20261016-ccaione-upstream-fdt-fit-v1-0-f6286ef82364@baylibre.com

---
Carlo Caione (5):
      boot: fit: tell callers when a devicetree buffer must be freed
      boot: fit: reject configurations with missing or invalid overlays
      boot: fit: let callers choose where to place the devicetree
      cmd: fdt: add 'fdt fit' to prepare a devicetree for other boot commands
      test: py: cover fdt fit preparation and failure handling

 boot/image-fdt.c              |   4 +-
 boot/image-fit.c              |  84 +++++++---
 cmd/Kconfig                   |   9 +
 cmd/fdt.c                     |  83 ++++++++++
 configs/sandbox_defconfig     |   1 +
 doc/usage/cmd/fdt.rst         |  75 +++++++++
 include/image.h               |  11 +-
 test/py/tests/test_fdt_fit.py | 371 ++++++++++++++++++++++++++++++++++++++++++
 test/py/tests/test_fit.py     |  60 +++++++
 9 files changed, 676 insertions(+), 22 deletions(-)
---
base-commit: ed869863c7e2aca50d57a05d843830dd843138c4
change-id: 20261016-ccaione-upstream-fdt-fit-29f83d0fa6ac

Best regards,
--  
Carlo Caione <ccaione@baylibre.com>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-11-09 17:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-26 12:18 [PATCH v3 0/5] Prepare devicetrees from FIT configurations with fdt fit Carlo Caione
2026-10-26 12:18 ` [PATCH v3 1/5] boot: fit: tell callers when a devicetree buffer must be freed Carlo Caione
2026-11-09 17:27   ` David Lechner
2026-10-26 12:18 ` [PATCH v3 2/5] boot: fit: reject configurations with missing or invalid overlays Carlo Caione
2026-10-26 12:18 ` [PATCH v3 3/5] boot: fit: let callers choose where to place the devicetree Carlo Caione
2026-10-26 12:18 ` [PATCH v3 4/5] cmd: fdt: add 'fdt fit' to prepare a devicetree for other boot commands Carlo Caione
2026-11-09 17:27   ` David Lechner
2026-10-26 12:18 ` [PATCH v3 5/5] test: py: cover fdt fit preparation and failure handling Carlo Caione
2026-11-09 17:28   ` David Lechner

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.