105708 Commits

Author SHA1 Message Date
Tom Rini
0a46055d96 Merge patch series "video: bridge: anx6345: Staticize and constify driver ops"
This series from Marek Vasut <marek.vasut+renesas@mailbox.org> adds
"static" and "const" keywords to structs where they are missing and
would be useful to have.

Link: https://lore.kernel.org/r/20260510171723.56866-1-marek.vasut+renesas@mailbox.org
2026-05-30 07:44:08 -06:00
Alexey Charkov
5cf4b14284 video console: add 6x8 console font from linux
Small screens on the order of 256x144 pixels can't fit much text at 8x16,
and 4x6 is virtually illegible, so add an in-between 6x8 font from Linux.

Font data obtained from lib/fonts/font_6x8.c in the Linux kernel at commit
db65872b38dc ("lib/fonts: Remove internal symbols and macros from public
header file")

Link: db65872b38/lib/fonts/font_6x8.c
Signed-off-by: Alexey Charkov <alchark@flipper.net>
2026-05-30 07:44:08 -06:00
Dario Binacchi
5f5b8ae293 video: kconfig: replace tristate with bool for LCD panel drivers
U-Boot does not support loadable modules, therefore using 'tristate'
in Kconfig is incorrect since the 'm' option cannot be selected.

Replace tristate with bool for the affected LCD panel drivers to
reflect the U-Boot build model and avoid misleading configuration
options.

No functional change intended.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Svyatoslav Ryhel <clamor95@gmail.com>
2026-05-30 07:44:08 -06:00
Dario Binacchi
2be4b2269e video: Kconfig: fix indentation of help text
Fix the indentation of the help text for VIDEO_LCD_NOVATEK_NT35510 and
VIDEO_LCD_ORISETECH_OTM8009A to align with the standard Kconfig format.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
2026-05-30 07:44:08 -06:00
Aelin Reidel
258310ab39 video: simplefb: Parse memory region from memory-region property
Linux' simplefb driver allows setting the memory-region property to a
phandle to a node that describes the memory to be used for the
framebuffer. If it is present, it will override the "reg" property.

This adds support for parsing the property and prefers it if present.

Signed-off-by: Aelin Reidel <aelin@mainlining.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-30 07:44:08 -06:00
Luca Weiss
1c8b592611 video: simplefb: Map framebuffer region on probe on ARM64
The framebuffer buffer might not be mapped on some devices.

This is #ifdef'ed for ARM64 since mmu_map_region() is not defined for
any other architecture.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Acked-by: Sumit Garg <sumit.garg@oss.qualcomm.com>
2026-05-30 07:44:08 -06:00
Tom Rini
df08b27590 video: Correct dependencies for VIDEO_TIDSS
The VIDEO_TIDSS functionality can only work with PANEL enabled, so
express this dependency in Kconfig for all phases.

Signed-off-by: Tom Rini <trini@konsulko.com>
2026-05-30 07:44:08 -06:00
Tom Rini
ff3bece92f video: Correct dependencies for VIDEO_LCD_RAYDIUM_RM68200
The VIDEO_LCD_RAYDIUM_RM68200 functionality can only work with BACKLIGHT
enabled, so express this dependency in Kconfig.

Signed-off-by: Tom Rini <trini@konsulko.com>
2026-05-30 07:44:08 -06:00
Tom Rini
6033096d3c video: Correct dependencies of LOGICORE_DP_TX
In order to build LOGICORE_DP_TX we must also have enabled AXI, so add
that as a dependency as well.

Signed-off-by: Tom Rini <trini@konsulko.com>
2026-05-30 07:44:08 -06:00
Anshul Dalal
3c32572a27 common: splash_source: fix cryptic error messages
Some error messages emitted while loading the splash image are too
cryptic and don't provide any insights into the failure being a splash
related issue, such as 'Error (-2): cannot determine file size' etc.

This patch fixes the error codes by adding the function name to the
error print.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
[trini: Add missing ',' and wrap to 80-width]
Signed-off-by: Tom Rini <trini@konsulko.com>
2026-05-30 07:43:41 -06:00
Marek Vasut
674afbcf6e video: tegra: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Acked-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
16185d7ff3 video: tda19988: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
dd2f4d967f video: stm32: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Raphaël Gallais-Pou <rgallaispou@gmail.com>
2026-05-29 17:10:46 -06:00
Marek Vasut
7e7b3106a5 video: imx: ldb: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
b2f7404fd8 video: dw_mipi_dsi: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
8f7717c756 video: console: truetype: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
c6266daa1e video: console: rotate: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
3ddd78074e video: console: normal: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
772ef8b089 video: bridge: ptn3460: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
af65e247e7 video: bridge: ps862x: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Marek Vasut
6da8ecc518 video: bridge: anx6345: Staticize and constify driver ops
Set the ops structure as static const. The structure is not accessible
from outside of this driver and is not going to be modified at runtime.

Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 17:10:46 -06:00
Francois Berder
c39e0e257c boot: cedit: Check ofnode_read_prop return value
In h_read_settings, val variable could be NULL due to
ofnode_read_prop returning an error. This variable
would then be used as the src in strcpy.

Add a NULL check after calling ofnode_read_prop.

Signed-off-by: Francois Berder <fberder@outlook.fr>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-29 14:23:11 -06:00
Tom Rini
9f00cec3d8 Merge patch series "board: phytec: Update rm-cfgs, env and docs"
Wadim Egorov <w.egorov@phytec.de> says:

This is a small updates across all K3 based phytec SoMs.
Update docs, rm-cfg yaml files and drop rauc environment.

Link: https://lore.kernel.org/r/20260513071905.83522-1-w.egorov@phytec.de
2026-05-29 14:23:01 -06:00
Wadim Egorov
6e8d82b9e9 doc: board: phytec: Document DDR size override Kconfigs
The phyCORE-AM62x and phyCORE-AM64x R5 SPL detects the populated DDR
size from the SoM EEPROM and falls back to 2 GB if detection fails. For
boards without a populated EEPROM or if no detection needed, the detection
can be bypassed via CONFIG_PHYCORE_AM6{2,4}X_RAM_SIZE_FIX and one of
the CONFIG_PHYCORE_AM6{2,4}X_RAM_SIZE_<size> choices.

Add a "DDR RAM Size" section to both board docs describing this
behaviour and listing the available size options (1/2/4 GB for AM62x,
1/2 GB for AM64x).

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
14ba26ebdd doc: board: phytec: k3: Document boot flow and watchdog
Add two short sections to the common K3 phyCORE docs.
Describe the default boot flow and its deprecated version.
And write down the use of the watchdog.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
86f4f05ad8 doc: board: phytec: Fix typos and copy-paste errors in K3 docs
A handful of small inaccuracies had crept into the phyCORE-AM6x docs.
Mostly typos and formatting Issues. Fix them. While at it, update the
am62a board to use the correct product link.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
ef5b4a7eae include: env: phytec: Drop legacy RAUC boot logic
RAUC slot selection is now handled by the RAUC bootmeth, which all
phytec K3 boards use. Remove the unused env-based logic.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Reviewed-by: Martin Schwan <m.schwan@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
68532aab6d board: phytec: phycore_am68x: Update rm-cfg
Mirror the j721s2 changes from commit c4fcf9b806 ("board: ti: j7*:
Update rm-cfg and tifs-rm-cfg") to repurpose allocated resources with
version V11.02.07 of k3-resource-partition.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
Acked-by: Dominik Haller <d.haller@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
c2edb9cb2b arm: dts: k3-am625-phycore-som-binman: Enable tifs-rm-cfg
Add rcfg_yaml_tifs node override to use tifs-rm-cfg.yaml instead of
the default rm-cfg.yaml for the phyCORE-AM62x SoM.

This enables binman to include the tifs-rm-cfg.yaml configuration
when building tiboot3 images, bringing the phyCORE-AM62x SoM in line
with other K3 devices that already use tifs-rm-cfg.yaml.

This builds on the tifs-rm-cfg file added earlier in this series.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2026-05-29 14:22:38 -06:00
Wadim Egorov
6edb2e1ce2 board: phytec: phycore_am62x: Add tifs-rm-cfg
Add a separate tifs-rm-cfg.yaml so the TIFS bundle uses the trimmed
TIFS view instead of reusing rm-cfg.yaml, matching the rest of the
AM62 boards.

Mirrors commit 964bda9e80 ("board: ti: am62x: tifs-rm-cfg: Add the
missing tifs-rm-cfg:") for the phyCORE-AM62x SoM.

Signed-off-by: Wadim Egorov <w.egorov@phytec.de>
2026-05-29 14:22:38 -06:00
Tom Rini
b40fee4d6d Merge patch series "board: toradex: k3: Sync rm-cfg with TIFS v12.00.00 firmware"
Ernest Van Hoecke <ernestvanhoecke@gmail.com> says:

This series updates the Resource Management configuration for Toradex
K3-based boards and makes sure the TIFS-specific RM configuration is
used where applicable.

For Verdin AM62P, the tifs-rm-cfg.yaml file is refreshed with
k3-resource-partition V12.00.00 so that it stays in sync with the
existing rm-cfg.yaml update for the v11.02.09 and v12.00.00 TIFS
firmware resource reservation.

For Verdin AM62, the missing tifs-rm-cfg.yaml file is added. The file
matches the TI AM62x configuration, and rm-cfg.yaml was verified to
remain unchanged when regenerated with the same tool version.

For Aquila AM69, both rm-cfg.yaml and tifs-rm-cfg.yaml are updated to
match the resource allocation changes already present in the TI J784S4
configuration files.

Finally, the Verdin AM62 and Verdin AM62P binman descriptions are
updated to use tifs-rm-cfg.yaml for the TIFS RM fragment when building
tiboot3 images, following the same pattern used by the corresponding TI
AM62x/AM62Px platforms.

The generated/updated files were compared against the matching TI board
configuration files where applicable.

Link: https://lore.kernel.org/r/20260508-v1-update-rm-cfg-v1-0-ec9d033f8ec1@toradex.com
2026-05-29 14:22:20 -06:00
Ernest Van Hoecke
927e4880f2 arm: dts: k3: k3-am62*5-verdin-binman: Enable tifs-rm-cfg in binman
Add rcfg_yaml_tifs node overrides to use tifs-rm-cfg.yaml instead of
the default rm-cfg.yaml for Verdin AM62 and Verdin AM62P platforms.

This enables binman to include the tifs-rm-cfg.yaml configuration when
building tiboot3 images in line with other K3 devices that already use
tifs-rm-cfg.yaml.

This follows the changes done by TI to their am62x/am62px platforms. [1]

[1] commit 41814276f0 ("arm: dts: k3: am62x/am62px: Enable tifs-rm-cfg in binman")

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2026-05-29 14:22:00 -06:00
Ernest Van Hoecke
78dff83dd7 board: toradex: aquila-am69: update rm-cfg.yaml and tifs-rm-cfg.yaml
Repurpose the allocated resources with version V12.00.00 of
k3-resource-partition, matching the update made for the TI J784S4
configuration files. [1]

The Aquila AM69 rm-cfg.yaml and tifs-rm-cfg.yaml remain aligned with
board/ti/j784s4/*-rm-cfg.yaml.

[1] commit c4fcf9b806 ("board: ti: j7*: Update rm-cfg and tifs-rm-cfg")

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2026-05-29 14:22:00 -06:00
Ernest Van Hoecke
4fd5302675 board: toradex: verdin-am62: add missing tifs-rm-cfg.yaml
Add the previously missing TIFS RM configuration, generated with
V12.00.00 of k3-resource-partition.

This file is exactly the same as board/ti/am62x/tifs-rm-cfg.yaml.

rm-cfg.yaml and tifs-rm-cfg.yaml need to be in sync, this was already
taken care of by TI. [1]

It was verified that rm-cfg.yaml also remained unchanged with V12.00.00
of the tool.

[1] commit 64ebab10b5 ("toradex: verdin-am62: rm-cfg: Update rm-cfg to reflect new resource reservation")

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2026-05-29 14:22:00 -06:00
Ernest Van Hoecke
7920dc90dd board: toradex: verdin-am62p: update tifs-rm-cfg
TI updated rm-cfg for v11.02.09 of the TIFS firmware. [1]

Refresh the tifs-rm-cfg.yaml as well, with version V12.00.00 of
k3-resource-partition, so that it remains in sync with rm-cfg.yaml.

rm-cfg.yaml was also updated with V12.00.00 of the tool and noted to
have no changes.

[1] commit a66704e9a1 ("board: toradex: verdin-am62p: rm-cfg: Update rm-cfg to reflect new resource reservation")

Signed-off-by: Ernest Van Hoecke <ernest.vanhoecke@toradex.com>
Acked-by: Francesco Dolcini <francesco.dolcini@toradex.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2026-05-29 14:22:00 -06:00
Abhash Kumar Jha
59d52a9975 board: ti: j722s: add processor ACL entry for wkup_r5
On the j722s platform, the DM firmware resets the wkup_r5 core at boot to
enable both of its TCM memories.

This reset sequence involves three steps:
- Acquiring processor ownership of wkup_r5
- Configuring the core and requesting a reset via TIFS
- Releasing ownership.

When the Linux remoteproc driver comes up, it acquires ownership of wkup_r5
to query its state, making A53_2 the new owner.
During system suspend, TIFS saves the processor ACL[1] table to DDR as
part of its context.

On resume, TIFS restores the ACL table, leaving A53_2 as the owner of
wkup_r5. At this point, DM (WKUP_0_R5_0 host[2]) no longer has ownership
and is therefore unable to perform the reset sequence it needs,
causing it to crash.

To fix this, configure the wkup_r5[3] processor with dual ownership:
- WKUP_0_R5_0 (Secure) as primary owner.
- A53_2 (Non-Secure) as secondary owner.

[1] https://software-dl.ti.com/tisci/esd/latest/3_boardcfg/BOARDCFG_SEC.html#pub-boardcfg-proc-acl
[2] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/hosts.html
[3] https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/j722s/processors.html

Signed-off-by: Abhash Kumar Jha <a-kumar2@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
2026-05-29 14:17:14 -06:00
Tom Rini
ddd1f2192d Merge patch series "Update envs to use Kconfig values"
Anshul Dalal <anshuld@ti.com> says:

Some minor fixes to K3's env to avoid using hardcoded addresses but
instead move to Kconfig symbols.

Link: https://lore.kernel.org/r/20260518-env_to_kconfig_migration-v1-0-24c8fba75ad3@ti.com
2026-05-29 14:04:00 -06:00
Anshul Dalal
1ea8b3e8e2 env: ti: k3_dfu: use Kconfig options for addresses
The load addresses for DFU download binaries were hardcoded for K3
devices which required redefinition of such env for boards that deviated
from the expected K3 memory map (such as AM6254atl EMV).

This patch replaces the hardcoded addresses with their corresponding
Kconfig options making the k3_dfu.env more general.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2026-05-29 14:02:18 -06:00
Anshul Dalal
2b6d243be2 env: ti: k3_dfu: load only the next stage binary
In the TI's K3 bootflow of tiboot3.bin -> tispl.bin -> u-boot.img:
                             (R5 SPL)      (A53 SPL)

We currently provide a common dfu_alt_info_ram for both R5 SPL and A53
SPL which is not intuitive in a regular bootflow where each binary
should only request it's immediate next stage.

This patch updates dfu_alt_info_ram such that the R5 SPL would only
request for tispl.bin and A53 SPL would only request u-boot.img.

Signed-off-by: Anshul Dalal <anshuld@ti.com>
2026-05-29 14:02:18 -06:00
Jeremy Kerr
5151c208b5 am33xx: don't assume we have a UCLASS_MISC device present
Boot on am33xx without CONFIG_USB will currently fail, as we error-out
of arch_misc_init() if no UCLASS_MISC device is found. This requirement
was introduced in commit 3aec264869 ("am33xx: board: probe misc
drivers to register musb devices").

Instead, only attempt the UCLASS_MISC init if we would expect the MUSB
TI device to be present. Add a comment to explain why we're doing the
device lookup (which we immediately discard).

Fixes: 3aec264869 ("am33xx: board: probe misc drivers to register musb devices")
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Tom Rini <trini@konsulko.com>
2026-05-27 17:59:19 -06:00
Adam Lackorzynski
8429766a7f common/command.c: Avoid NULL pointer use in cmd_auto_complete
Avoid using ps_prompt having a NULL pointer. For that, use the same
approach as in uboot_cli_readline().

Suggested-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Adam Lackorzynski <adam@l4re.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 17:59:16 -06:00
Heinrich Schuchardt
7af4196d9e fs: fat: fix seconds in timestamp
The FAT time format stores seconds/2 in bits 4:0. The expression
'tm.tm_sec > 1' is a boolean comparison (yields 0 or 1) where a
right-shift 'tm.tm_sec >> 1' was intended.  As a result every
file timestamp written by U-Boot has its seconds field set to
either 0 or 1, depending on whether tm_sec is greater than 1.

Also fix the indentation of the tm_hour line.

Fixes: ba23c378c5 ("fs: fat: fill creation and change date")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 17:59:12 -06:00
Tom Rini
746a986fe2 Merge patch series "fit: dm-verity support"
Daniel Golle <daniel@makrotopia.org> says:

This series adds dm-verity support to U-Boot's FIT image infrastructure.
It is the first logical subset of the larger OpenWrt boot method series
posted as an RFC in February 2026 [1], extracted here for independent
review and merging.

OpenWrt's firmware model embeds a read-only squashfs or erofs root
filesystem directly inside a uImage.FIT container as a FILESYSTEM-type
loadable FIT image. At boot the kernel maps this sub-image directly from
the underlying block device via the fitblk driver (/dev/fit0, /dev/fit1,
...), the goal is that the bootloader never even copies it to RAM.

dm-verity enables the kernel to verify the integrity of those mapped
filesystems at read time, with a Merkle hash tree stored contiguously in
the same sub-image just after the data. Two kernel command-line
parameters are required:

  dm-mod.create=   -- the device-mapper target table for the verity device
  dm-mod.waitfor=  -- a comma-separated list of block devices to wait for
                      before dm-init sets up the targets (needed when fitblk
                      probes late, e.g. because it depends on NVMEM
                      calibration data)

The FIT dm-verity node schema was upstreamed into the flat-image-tree
specification [2], which this implementation tries to follow exactly.

The runtime feature is guarded behind CONFIG_FIT_VERITY. If not
enabled the resulting binary size remains unchanged. If enabled the
binary size increases by about 3kB.

[1] previous submissions:
    RFC: https://www.mail-archive.com/u-boot@lists.denx.de/msg565945.html
    v1:  https://www.mail-archive.com/u-boot@lists.denx.de/msg569472.html
    v2:  https://www.mail-archive.com/u-boot@lists.denx.de/msg570599.html
    v3:  https://www.mail-archive.com/u-boot@lists.denx.de/msg573223.html
    v4:  https://www.mail-archive.com/u-boot@lists.denx.de/msg574000.html

[2] flat-image-tree dm-verity node spec:
    795fd5fd7f

Link: https://lore.kernel.org/r/cover.1778887196.git.daniel@makrotopia.org
2026-05-27 13:44:20 -06:00
Daniel Golle
89d3c1fe1b configs: sandbox: enable CONFIG_FIT_VERITY
Enable FIT_VERITY in the sandbox configs that build a full U-Boot
binary so CI may exercise the new dm-verity unit test
(test/boot/fit_verity.c) and the mkimage pytest
(test/py/tests/test_fit_verity.py) introduced earlier in this series.

The SPL/VPL/noinst variants only load U-Boot proper, never an OS, so
dm-verity is meaningless there and is not enabled.

Suggested-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
e52b2c6e7f test: py: add mkimage dm-verity round-trip test
Add test/py/tests/test_fit_verity.py covering:
 - mkimage writes correct dm-verity properties for matched and
   mismatched block sizes (4096/4096 and 4096/1024);
 - veritysetup verify re-checks the digest against the .itb's
   external data section;
 - mkimage rejects dm-verity images built without -E.

All tests are skipped if veritysetup is not installed on the host.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
e7ee728ace test: boot: add runtime unit test for fit_verity_build_cmdline()
Add test/boot/fit_verity.c with four tests that construct FIT blobs
in memory and exercise fit_verity_build_cmdline().

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
f34597790e doc: fit: add dm-verity boot parameter documentation
Add documentation for CONFIG_FIT_VERITY which allows U-Boot to
construct dm-mod.create= and dm-mod.waitfor= kernel command-line
parameters from dm-verity metadata embedded in FIT filesystem
sub-images.

The new document covers the relationship between FIT loadable indices
and the /dev/fitN block devices that the Linux uImage.FIT block driver
creates, provides a complete .its example with a dm-verity-protected
SquashFS root filesystem, describes all required and optional dm-verity
subnode properties and explains how mkimage generates the verity
metadata automatically.

dm-verity is only supported for external-data FIT images (mkimage -E);
mkimage aborts with an error if the flag is omitted.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
1e48298552 tools: mkimage: add dm-verity Merkle-tree generation
When mkimage encounters a dm-verity subnode inside a component image
node it now automatically invokes veritysetup(8) with --no-superblock
to generate the Merkle hash tree, screen-scrapes the Root hash and Salt
from the tool output, and writes the computed properties back into the
FIT blob.

The user only needs to specify algorithm, data-block-size, and
hash-block-size in the ITS; mkimage fills in digest, salt,
num-data-blocks, and hash-start-block. Because --no-superblock is
used, hash-start-block equals num-data-blocks with no off-by-one.

The image data property is replaced with the expanded content (original
data followed directly by the hash tree) so that subsequent hash and
signature subnodes operate on the complete image.

fit_image_add_verification_data() is restructured into two passes:
dm-verity first (may grow data), then hashes and signatures.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
96e180d354 include: hexdump: make hex2bin() usable from host tools
Make hexdump.h work in host-tool builds by using 'uint8_t' instead
of 'u8', and including either user-space libc <ctype.h> for host-tools
or <linux/ctype.h> when building U-Boot itself.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00
Daniel Golle
cafe3d6e90 boot: fit: support generating DM verity cmdline parameters
Add fit_verity_build_cmdline(): when a FILESYSTEM loadable carries a
dm-verity subnode, construct the dm-mod.create= kernel cmdline parameter
from the verity metadata (block-size, data-blocks, algo, root-hash,
salt) and append it to bootargs.

Also add dm-mod.waitfor=/dev/fit0[,/dev/fitN] for each dm-verity device
so the kernel waits for the underlying FIT block device to appear before
setting up device-mapper targets. This is needed when the block driver
probes late, e.g. because it depends on NVMEM calibration data.

The dm-verity target references /dev/fitN where N is the loadable's
index in the configuration -- matching the order Linux's FIT block
driver assigns block devices.  hash-start-block is read directly from
the FIT dm-verity node; mkimage ensures its value equals num-data-blocks
by invoking veritysetup with --no-superblock.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
2026-05-27 13:41:33 -06:00