Add support for fwumdata
cover Add support for fwumdata
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Made a few change to mkfwumdata tool along the way.
---
Kory Maincent (6):
tools: gitignore: Add mkfwumdata to the git ignore file
tools: Reorganize mkfwumdata tool into fwumdata_src directory
tools: mkfwumdata: Improve error message specificity
tools: mkfwumdata: Add bank count validation for FWU metadata v2
tools: Add support for fwumdata tool
tools: mkfwumdata: Remove dependency on fwu_mdata.h header
MAINTAINERS | 7 +-
doc/develop/uefi/fwu_updates.rst | 4 +-
doc/fwumdata.1 | 222 +++++++++
tools/.gitignore | 2 +
tools/Kconfig | 9 +-
tools/Makefile | 4 +-
tools/fwumdata_src/Kconfig | 19 +
tools/fwumdata_src/fwumdata.c | 854 ++++++++++++++++++++++++++++++++++
tools/fwumdata_src/fwumdata.config | 33 ++
tools/fwumdata_src/fwumdata.h | 138 ++++++
tools/fwumdata_src/fwumdata.mk | 10 +
tools/{ => fwumdata_src}/mkfwumdata.c | 105 +----
12 files changed, 1314 insertions(+), 93 deletions(-)---
base-commit: 31bf4a1c308773895a8e7ea047b3cea037e4c922
change-id: 20251107-feature_fwumdata-58508d61e1d3
Best regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
PATCH 1/6 tools: gitignore: Add mkfwumdata to the git ignore file
mkfwumdata is a built image. Add it to .gitignore.
--- tools/.gitignore | 1 + 1 file changed, 1 insertion(+)
tools/.gitignore +1 -0
@@ -24,6 +24,7 @@ /mkeficapsule /mkenvimage /mkexynosspl +/mkfwumdata /mkimage /mksunxiboot /mxsboot
Signature · 1 line
2.43.0
PATCH 2/6 tools: Reorganize mkfwumdata tool into fwumdata_src directory
In reply to Kory MaincentUpdate FWU metadata-related tools by moving mkfwumdata.c into a new tools/fwumdata_src/ directory structure. This refactoring prepares for the addition of the fwumdata runtime tool, which will allow editing FWU metadata directly from the target.
The Kconfig and Makefile entries are also moved into separate files within the new directory (Kconfig and fwumdata.mk respectively) to keep all FWU metadata tool configurations together and improve maintainability.
---
MAINTAINERS | 3 ++-
tools/Kconfig | 9 +--------
tools/Makefile | 4 +---
tools/fwumdata_src/Kconfig | 8 ++++++++
tools/fwumdata_src/fwumdata.mk | 7 +++++++
tools/{ => fwumdata_src}/mkfwumdata.c | 0
6 files changed, 19 insertions(+), 12 deletions(-)MAINTAINERS +2 -1
@@ -1250,9 +1250,10 @@ FWU Multi Bank Update M: Sughosh Ganu <[email protected]> S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-efi.git +F: doc/mkfwumdata.1 F: lib/fwu_updates/* F: drivers/fwu-mdata/* -F: tools/mkfwumdata.c +F: tools/fwumdata_src/mkfwumdata.c GATEWORKS_SC M: Tim Harvey <[email protected]>
tools/Kconfig +1 -8
@@ -194,13 +194,6 @@ config LUT_SEQUENCE help Look Up Table Sequence -config TOOLS_MKFWUMDATA - bool "Build mkfwumdata command" - default y if FWU_MULTI_BANK_UPDATE - help - This command allows users to create a raw image of the FWU - metadata for initial installation of the FWU multi bank - update on the board. The installation method depends on - the platform. +source tools/fwumdata_src/Kconfig endmenu
tools/Makefile +1 -3
@@ -271,9 +271,7 @@ mkeficapsule-objs := generated/lib/uuid.o \ mkeficapsule.o hostprogs-$(CONFIG_TOOLS_MKEFICAPSULE) += mkeficapsule -mkfwumdata-objs := mkfwumdata.o generated/lib/crc32.o -HOSTLDLIBS_mkfwumdata += -luuid -hostprogs-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata +include tools/fwumdata_src/fwumdata.mk # We build some files with extra pedantic flags to try to minimize things # that won't build on some weird host compiler -- though there are lots of
tools/fwumdata_src/Kconfig new file +8 -0
@@ -0,0 +1,8 @@ +config TOOLS_MKFWUMDATA + bool "Build mkfwumdata command" + default y if FWU_MULTI_BANK_UPDATE + help + This command allows users to create a raw image of the FWU + metadata for initial installation of the FWU multi bank + update on the board. The installation method depends on + the platform.
tools/fwumdata_src/fwumdata.mk new file +7 -0
@@ -0,0 +1,7 @@ +# SPDX-License-Identifier: GPL-2.0+ +# +# (C) Copyright 2025, Kory Maincent <[email protected]> + +mkfwumdata-objs := fwumdata_src/mkfwumdata.o generated/lib/crc32.o +HOSTLDLIBS_mkfwumdata += -luuid +hostprogs-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata
tools/fwumdata_src/mkfwumdata.c renamed from tools/mkfwumdata.c +0 -0
Signature · 1 line
2.43.0
PATCH 3/6 tools: mkfwumdata: Improve error message specificity
In reply to Kory MaincentReplace the generic error message with a more informative one. This helps users quickly understand the correct command-line argument format when the tool reports an error.
--- tools/fwumdata_src/mkfwumdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tools/fwumdata_src/mkfwumdata.c +3 -1
@@ -473,7 +473,9 @@ int main(int argc, char *argv[])/* This command takes UUIDs * images and output file. */ if (optind + images +1 != argc) { -fprintf (stderr,"Error: UUID list or output file is not specified or too much.\n" ); +fprintf (stderr, +"Error: Expected %ld UUID string(s) and 1 output file, got %d argument(s).\n" , + images, argc - optind);print_usage ();return -ERANGE ; }
Signature · 1 line
2.43.0
PATCH 4/6 tools: mkfwumdata: Add bank count validation for FWU metadata v2
In reply to Kory MaincentThe FWU metadata specification version 2 supports a maximum of 4 banks. Add validation to enforce this limit and prevent creation of non-compliant metadata structures when using version 2.
Without this check, users could inadvertently create invalid metadata by specifying more than 4 banks, leading to potential compatibility issues with FWU-compliant firmware update implementations.
--- tools/fwumdata_src/mkfwumdata.c | 6 ++++++ 1 file changed, 6 insertions(+)
tools/fwumdata_src/mkfwumdata.c +6 -0
@@ -471,6 +471,12 @@ int main(int argc, char *argv[])return -EINVAL ; } +if (version ==2 && banks >MAX_BANKS_V2 ) { +fprintf (stderr,"Error: Version 2 supports maximum %d banks, %ld requested.\n" , +MAX_BANKS_V2 , banks); +return -EINVAL ; + } +/* This command takes UUIDs * images and output file. */ if (optind + images +1 != argc) { fprintf(stderr,
Signature · 1 line
2.43.0
PATCH 5/6 tools: Add support for fwumdata tool
In reply to Kory MaincentAdd a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
--- MAINTAINERS | 4 + doc/develop/uefi/fwu_updates.rst | 4 +- doc/fwumdata.1 | 222 ++++++++++ tools/.gitignore | 1 + tools/fwumdata_src/Kconfig | 11 + tools/fwumdata_src/fwumdata.c | 854 +++++++++++++++++++++++++++++++++++++ tools/fwumdata_src/fwumdata.config | 33 ++ tools/fwumdata_src/fwumdata.h | 138 ++++++ tools/fwumdata_src/fwumdata.mk | 3 + 9 files changed, 1269 insertions(+), 1 deletion(-)
MAINTAINERS +4 -0
@@ -1248,11 +1248,15 @@ F: drivers/watchdog/sbsa_gwdt.c FWU Multi Bank Update M: Sughosh Ganu <[email protected]> +M: Kory Maincent <[email protected]> S: Maintained T: git https://source.denx.de/u-boot/custodians/u-boot-efi.git +F: doc/fwumdata.1 F: doc/mkfwumdata.1 F: lib/fwu_updates/* F: drivers/fwu-mdata/* +F: tools/fwumdata_src/fwumdata.c +F: tools/fwumdata_src/fwumdata.h F: tools/fwumdata_src/mkfwumdata.c GATEWORKS_SC
doc/develop/uefi/fwu_updates.rst +3 -1
@@ -66,7 +66,9 @@ FWU Metadata U-Boot supports both versions(1 and 2) of the FWU metadata defined in the two revisions of the specification. Support can be enabled for either of the two versions through a config flag. The mkfwumdata tool -can generate metadata for both the supported versions. +can generate metadata for both the supported versions. On the target side, +the fwumdata tool can read and update FWU metadata located in memory, +similarly to how fw_printenv/fw_setenv works. Setting up the device for GPT partitioned storage -------------------------------------------------
doc/fwumdata.1 new file +222 -0
222 lines not on this page · raw message
tools/.gitignore +1 -0
@@ -11,6 +11,7 @@ /file2include /fit_check_sign /fit_info +/fwumdata /gdb/gdbcont /gdb/gdbsend /gen_eth_addr
tools/fwumdata_src/Kconfig +11 -0
@@ -6,3 +6,14 @@ config TOOLS_MKFWUMDATA metadata for initial installation of the FWU multi bank update on the board. The installation method depends on the platform. + +config TOOLS_FWUMDATA + bool "Build fwumdata command" + default y if FWU_MULTI_BANK_UPDATE + help + This command allows users to read, display, and modify FWU + (Firmware Update) metadata from Linux userspace. It provides + functionality similar to fw_printenv/fw_setenv but for FWU + metadata. Users can view metadata, change active/previous + bank indices, modify bank states, and set image acceptance + flags. Configuration is done via fwumdata.config file.
tools/fwumdata_src/fwumdata.c new file +854 -0
854 lines not on this page · raw message
tools/fwumdata_src/fwumdata.config new file +33 -0
@@ -0,0 +1,33 @@ +# FWU Metadata Configuration File +# +# Format: <device> <offset> <metadata_size> <erase_size> +# +# This file describes where the FWU metadata is stored. You can specify +# up to two entries for redundant metadata copies. +# +# Device: MTD device (/dev/mtdX), block device (/dev/mmcblkX), or file path +# Offset: Byte offset from start of device (hex with 0x prefix) +# Metadata Size: Size of metadata structure in bytes (hex with 0x prefix) +# Erase Size: Sector/erase block size (hex with 0x prefix, defaults to +# metadata_size, required only for MTD device) +# +# Examples: +# +# MTD devices (NOR/NAND flash): +# /dev/mtd0 0x0 0x1000 0x1000 +# /dev/mtd1 0x0 0x1000 0x1000 +# +# Block device (eMMC/SD): +# /dev/mmcblk0 0x100000 0x78 +# /dev/mmcblk0 0x101000 0x78 +# +# or: +# /dev/disk/by-partlabel/metadata1 0 0x78 +# /dev/disk/by-partlabel/metadata2 0 0x78 +# +# Regular file: +# /boot/fwu-mdata.bin 0x0 0x78 +# +# Default configuration (update for your platform): +/dev/mtd0 0x0 0x78 0x1000 +/dev/mtd1 0x0 0x78 0x1000
tools/fwumdata_src/fwumdata.h new file +138 -0
138 lines not on this page · raw message
tools/fwumdata_src/fwumdata.mk +3 -0
@@ -5,3 +5,6 @@ mkfwumdata-objs := fwumdata_src/mkfwumdata.o generated/lib/crc32.o HOSTLDLIBS_mkfwumdata += -luuid hostprogs-$(CONFIG_TOOLS_MKFWUMDATA) += mkfwumdata + +fwumdata-objs := fwumdata_src/fwumdata.o generated/lib/crc32.o +hostprogs-$(CONFIG_TOOLS_FWUMDATA) += fwumdata
Signature · 1 line
2.43.0
PATCH 6/6 tools: mkfwumdata: Remove dependency on fwu_mdata.h header
In reply to Kory MaincentThe dependency on fwu_mdata.h creates unnecessary configuration requirements. To generate metadata V1, CONFIG_FWU_MDATA_V1 must be enabled, which in turn requires enabling FWU_MULTI_BANK_UPDATE, EFI_CAPSULE_ON_DISK, PARTITION_TYPE_GUID, and other unrelated configs. This is not suitable for a simple standalone tool.
Additionally, even with the "-v 1" option to generate V1 metadata, the tool will still include the firmware store description if CONFIG_FWU_MDATA_V1 is not enabled. This structure should only be present in metadata V2.
Replace the fwu_mdata.h dependency with the new fwumdata header to make the tool compatible with both V1 and V2 without requiring any defconfig changes. This also uses the access helper functions from the header to eliminate code duplication.
--- tools/fwumdata_src/mkfwumdata.c | 95 +++++++---------------------------------- 1 file changed, 16 insertions(+), 79 deletions(-)
tools/fwumdata_src/mkfwumdata.c +16 -79
@@ -17,26 +17,7 @@#include <u-boot/crc.h> #include <uuid/uuid.h> -typedef uint8_t u8 ; -typedef int16_t s16 ; -typedef uint16_t u16 ; -typedef uint32_t u32 ; -typedef uint64_t u64 ; - -#undef CONFIG_FWU_NUM_BANKS -#undef CONFIG_FWU_NUM_IMAGES_PER_BANK - -/* This will dynamically allocate the fwu_mdata */ -#define CONFIG_FWU_NUM_BANKS 0 -#define CONFIG_FWU_NUM_IMAGES_PER_BANK 0 - -/* version 2 supports maximum of 4 banks */ -#define MAX_BANKS_V2 4 - -#define BANK_INVALID (u8)0xFF -#define BANK_ACCEPTED (u8)0xFC - -#include <fwu_mdata.h> +#include "fwumdata.h" static const char *opts_short ="b:i:a:p:v:V:gh" ;
@@ -116,6 +97,7 @@ static struct fwu_mdata_object *fwu_alloc_mdata(size_t images, size_t banks, sizeof(struct fwu_image_bank_info) * banks) * images; }else { mobj->size =sizeof (struct fwu_mdata ) + +sizeof (struct fwu_mdata_ext ) +sizeof (struct fwu_fw_store_desc ) + (sizeof (struct fwu_image_entry ) +sizeof (struct fwu_image_bank_info ) * banks) * images;
@@ -146,50 +128,6 @@ alloc_err:return NULL ; } -static struct fwu_image_entry * -fwu_get_image (struct fwu_mdata_object *mobj,size_t idx) -{ -size_t offset; - -if (mobj->version ==1 ) { - offset =sizeof (struct fwu_mdata ) + - (sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * mobj->banks) * - idx; - }else { - offset =sizeof (struct fwu_mdata ) + -sizeof (struct fwu_fw_store_desc ) + - (sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * mobj->banks) * - idx; - } - -return (struct fwu_image_entry *)((char *)mobj->mdata + offset); -} - -static struct fwu_image_bank_info * -fwu_get_bank (struct fwu_mdata_object *mobj,size_t img_idx,size_t bnk_idx) -{ -size_t offset; - -if (mobj->version ==1 ) { - offset =sizeof (struct fwu_mdata ) + - (sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * mobj->banks) * - img_idx +sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * bnk_idx; - }else { - offset =sizeof (struct fwu_mdata ) + -sizeof (struct fwu_fw_store_desc ) + - (sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * mobj->banks) * - img_idx +sizeof (struct fwu_image_entry ) + -sizeof (struct fwu_image_bank_info ) * bnk_idx; - } - -return (struct fwu_image_bank_info *)((char *)mobj->mdata + offset); -} -/** * convert_uuid_to_guid() - convert UUID to GUID * @buf: UUID binary
@@ -239,11 +177,13 @@ static int fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj, size_t idx, char *uuids) { - struct fwu_image_entry *image = fwu_get_image(mobj, idx); struct fwu_image_bank_info *bank; +struct fwu_image_entry *image;char *p = uuids, *uuid;int i; + image =fwu_get_image_entry (mobj->mdata, mobj->version, + mobj->banks, idx);if (!image)return -ENOENT ;
@@ -266,7 +206,8 @@ fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj,/* Fill bank image-UUID */ for (i =0 ; i < mobj->banks; i++) { - bank =fwu_get_bank (mobj, idx, i); + bank =fwu_get_bank_info (mobj->mdata, mobj->version, + mobj->banks, idx, i);if (!bank)return -ENOENT ; bank->accepted =1 ;
@@ -281,25 +222,21 @@ fwu_parse_fill_image_uuid(struct fwu_mdata_object *mobj,return 0 ; } -#if defined(CONFIG_FWU_MDATA_V1 ) -static void fwu_fill_version_specific_mdata (struct fwu_mdata_object *mobj) -{ -} -#else static void fwu_fill_version_specific_mdata (struct fwu_mdata_object *mobj) {int i;struct fwu_fw_store_desc *fw_desc; -struct fwu_mdata *mdata = mobj->mdata; +struct fwu_mdata_ext *mdata_ext; - mdata->metadata_size = mobj->size; - mdata->desc_offset =sizeof (struct fwu_mdata ); + mdata_ext =fwu_get_fw_mdata_ext (mobj->mdata); + mdata_ext->metadata_size = mobj->size; + mdata_ext->desc_offset =sizeof (struct fwu_mdata );for (i =0 ; i <MAX_BANKS_V2 ; i++) - mdata->bank_state[i] = i < mobj->banks ? -BANK_ACCEPTED :BANK_INVALID ; + mdata_ext->bank_state[i] = i < mobj->banks ? +FWU_BANK_ACCEPTED :FWU_BANK_INVALID ; - fw_desc = (struct fwu_fw_store_desc *)((u8 *)mdata +sizeof (*mdata)); + fw_desc =fwu_get_fw_desc (mobj->mdata); fw_desc->num_banks = mobj->banks; fw_desc->num_images = mobj->images; fw_desc->img_entry_size = sizeof(struct fwu_image_entry) +
@@ -307,7 +244,6 @@ static void fwu_fill_version_specific_mdata(struct fwu_mdata_object *mobj) fw_desc->bank_info_entry_size =sizeof (struct fwu_image_bank_info ); } -#endif /* CONFIG_FWU_MDATA_V1 */ /* Caller must ensure that @uuids[] has @mobj->images entries. */ static int fwu_parse_fill_uuids (struct fwu_mdata_object *mobj,char *uuids[])
@@ -320,7 +256,8 @@ static int fwu_parse_fill_uuids(struct fwu_mdata_object *mobj, char *uuids[]) mdata->active_index = active_bank; mdata->previous_active_index = previous_bank; -fwu_fill_version_specific_mdata (mobj); +if (mdata->version ==2 ) +fwu_fill_version_specific_mdata (mobj);for (i =0 ; i < mobj->images; i++) { ret =fwu_parse_fill_image_uuid (mobj, i, uuids[i]);
Signature · 1 line
2.43.0
Quoted 7 lines · On Tue, 02 Dec 2025 18:28:25 +0100 Kory Maincent <[email protected]>…
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Made a few change to mkfwumdata tool along the way.
I just noticed that I should have added an output example:
$ ./fwumdata -l FWU Metadata: Version: 2 Active Index: 0 Previous Index: 1 CRC32: 0x1f21ff7b Metadata Size: 120 bytes Descriptor Offset: 16 Bank States: Bank 0: accepted (0xfc) Bank 1: accepted (0xfc)
Firmware Store Descriptor:
Number of Banks: 2
Number of Images: 1
Image Entry Size: 80
Bank Info Entry Size: 24
Images:
Image 0:
Image Type GUID: 65ae85ad-1fb3-0b46-8c5d-285543aa6eab
Location GUID: 51513491-da07-2a4f-9bea-375ea53b1b5c
Banks:
Bank 0:
Image GUID: cb2df442-f929-6a44-a374-672d92eb2aa7
Accepted: yes (1)
Bank 1:
Image GUID: a839a18f-395c-484f-83b8-0354077c8f9f
Accepted: yes (1)
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 7 lines · On Tue, 02 Dec 2025 18:28:25 +0100 Kory Maincent <[email protected]>…
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata, therefore, this is where it should belong. Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Hi Kory,
I'll try looking the patches in more detail tomorrow
Quoted 10 lines · Kory Maincent
Quoted 6 lines · On Tue, 02 Dec 2025 18:28:25 +0100 Kory Maincent <[email protected]>…
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 7 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that file
Regards
/Ilias
Quoted 6 lines
Regards,
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Hi Ilias,
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 7 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?
Quoted 5 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that file
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
Best regards
Patryk
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that file
Quoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 43 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Quoted 4 lines
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
Signature · 1 line
Tom
Quoted 50 lines · On Wed, 3 Dec 2025 09:10:48 -0600 Tom Rini <[email protected]> wrote:
Quoted 44 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Quoted 4 lines
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Quoted 4 lines
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
This isn't clear to me.
Are you saying that we should plan in removing mkfwumdata in the medium term? And in the short time, sending the two tools to TF-A to get them accepted.
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 53 lines · Kory Maincent
Quoted 50 lines · On Wed, 3 Dec 2025 09:10:48 -0600 Tom Rini <[email protected]> wrote:
Quoted 48 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Quoted 8 lines
Quoted 4 lines
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
This isn't clear to me.
Are you saying that we should plan in removing mkfwumdata in the medium term? And in the short time, sending the two tools to TF-A to get them accepted.
I mean in general, there are a lot of things in the u-boot source tree that may or may not really make sense to have, in tree. We also can't, right now, easily support or handle having multiple distinct projects under the u-boot umbrella. I'm wondering if we should figure out how to support a few source repositories under our umbrella, in a way that would make life easier for other projects too.
Signature · 1 line
Tom
Quoted 65 lines · On Wed, 3 Dec 2025 11:26:59 -0600 Tom Rini <[email protected]> wrote:
Quoted 59 lines · Kory Maincent
Quoted 51 lines · On Wed, 3 Dec 2025 09:10:48 -0600 Tom Rini <[email protected]> wrote:
Quoted 44 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata, therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Quoted 5 lines
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Quoted 4 lines
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
Quoted 4 lines
This isn't clear to me.
Are you saying that we should plan in removing mkfwumdata in the medium term? And in the short time, sending the two tools to TF-A to get them accepted.
Quoted 6 lines
I mean in general, there are a lot of things in the u-boot source tree that may or may not really make sense to have, in tree. We also can't, right now, easily support or handle having multiple distinct projects under the u-boot umbrella. I'm wondering if we should figure out how to support a few source repositories under our umbrella, in a way that would make life easier for other projects too.
That seems indeed a good idea to have a sub repo for the tools but, for the short term, where should I put my fwumdata tool TF-A or U-boot?
Regards,
Signature · 3 lines
Köry Maincent, Bootlin Embedded Linux and kernel engineering https://bootlin.com
Quoted 50 lines · Tom Rini
Quoted 43 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Quoted 4 lines
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Quoted 4 lines
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
Indeed. However U-Boot was the first project to adopt and implement that spec. So the tool was naturally added here
Cheers
/Ilias
Quoted 3 lines
--
Tom
Quoted 51 lines · Ilias Apalodimas
Quoted 50 lines · Tom Rini
Quoted 47 lines · Kory Maincent
Quoted 25 lines · On Wed, 3 Dec 2025 15:04:10 +0100 Patryk <[email protected]> wrote:
Hi Ilias,
Quoted 16 lines
Quoted 7 lines
Quoted 7 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 8 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 6 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that fileQuoted 6 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same. I'm also not sure why it would be the bad idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
I agreed with Patryk. U-boot is only an update agent (as explained by the standard) of FWU metadata as Barebox or Linux could be. FWU metadata is an ARM standard which is related to the update of the images that boot after the ARM firmware. It is not related to any project. As TF-A is the mainstream project for ARM firmware having mkfwumdata and fwumdata in it seems more suitable. I am not familiar with these EFI capsule update, does it not rely on TF-A to select the boot image according to the FWU metadata state?
Anyway, now it is too late and mkfwumdata has already landed in U-boot for 2 years. Not sure what we should do here. Put all in U-boot and let the other projects (barebox) copy the code if they need it? Or move all to TF-A while keeping a deprecated copy of mkfwumdata in U-boot to not break things?
Quoted 7 lines
Quoted 4 lines
Perhaps in the medium term we can split that tooling out from the main project source tree itself, to make it easier for OSes to use this tool (and other tools we have). There's nothing U-Boot specific about this, if I'm following the thread right.
Indeed. However U-Boot was the first project to adopt and implement that spec. So the tool was naturally added here
Lets start by adding it here then, thanks.
Signature · 1 line
Tom
Hi Patryk,
Quoted 23 lines · Patryk
Hi Ilias,
Quoted 14 lines
Quoted 6 lines
Quoted 6 lines
Add a new fwumdata tool to allows users to read, display, and modify FWU (Firmware Update) metadata from Linux userspace. It provides functionality similar to fw_printenv/fw_setenv but for FWU metadata. Users can view metadata, change active/previous bank indices, modify bank states, and set image acceptance flags. Configuration is done via fwumdata.config file.
Quoted 7 lines
Quoted 1 line
Made a few change to mkfwumdata tool along the way.
Still wondering about the choice of putting this fwumdata tool in U-Boot instead of TF-A. TF-A is the boot part that manages the update process and rollback through the FWU metadata,
therefore, this is where it should belong.
Why, in the first place, mkfwumdata was accepted into U-boot instead of TF-A?Quoted 5 lines
The actual update happens via capsule updates only, which runs in BL33. TF-A needs to be aware in case it's involved in the boot process and fails to boot. In that case BL2 is responsible for booting via the other bank.
But generally speaking it's U-Boot that processes and usually updates that file
Quoted 8 lines
If I may add something - actually for me this is not that obvious, e.g. on our platform we update the metadata directly from Linux, not from the u-boot capsule. As far as I'm aware, the ST, in their OpenstLinux does the same.
I'm also not sure why it would be the bad
idea to do this from Linux. Ofc the BL2 handles bank selection as well as rollback in case of boot failure on a newly selected bank.
The whole point of the spec, is to be able to have A/B support via EFI interfaces. There's also an indication in the ESRT table, that an update is pending for approval.
But if the data lives in a file in the non-secure world you can technically update it from linux.
Thanks
/Ilias
Quoted 2 lines
Best regards
Patryk