Skip to content

Support metadata-driven A/B boot for STM32MP2#13

Open
passgat wants to merge 3 commits into
STMicroelectronics:v2.10-stm32mpfrom
passgat:fw-update-ab
Open

Support metadata-driven A/B boot for STM32MP2#13
passgat wants to merge 3 commits into
STMicroelectronics:v2.10-stm32mpfrom
passgat:fw-update-ab

Conversation

@passgat

@passgat passgat commented Mar 18, 2026

Copy link
Copy Markdown

This series introduces support for the metadata-driven A/B update flow
in ARM Trusted Firmware, specifically targeting STM32MP2 platforms.
These changes are designed to be backward compatible while providing
the necessary infrastructure for the A/B scheme described in the
meta-st-{openstlinux,stm32mp} PRs [1] and [2].

Please refer to them for the full technical rationale and implementation
details of the fw-update-ab feature.

The specific patch to enable A/B support with multiple FWU images is not
included in this series. Since U-Boot strictly verifies that the number
of images defined in the metadata matches NR_OF_IMAGES_IN_FW_BANK, this
non-backward-compatible change has been moved to the meta-st-stm32mp layer [3].
It will be applied only when the A/B feature is explicitly enabled,
ensuring the system remains functional for standard configurations.

[1] STMicroelectronics/meta-st-openstlinux#16
[2] STMicroelectronics/meta-st-stm32mp#110
[3] 0004-feat-stm32mp2-enable-A-B-redundancy-support.patch

passgat added 3 commits March 15, 2026 13:58
Add GUID definitions for Linux Filesystem Data and XBOOTLDR partitions
to the EFI partition driver.

These definitions are required to identify and filter these partition
types during the boot process, specifically to support FWU multi-bank
A/B update scenarios.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Define IO policies and block specifications for BootFS and RootFS
partitions to support A/B redundancy systems on STM32MP2.

The patch registers FWU_BOOTFS_ID and FWU_ROOTFS_ID, mapping them to
their respective GUIDs (XBOOTLDR and Linux FS). This allows the platform
to correctly identify and access the required partitions for each bank
in A/B boot scenarios.

The MAX_NUMBER_IDS is increased to accommodate these new entries in
the platform storage pool.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
The common I/O policy code (plat/st/common/stm32mp_fconf_io.c) recently
introduced support for BootFS and RootFS partitions to handle A/B
redundancy, originally targeting the stm32mp2 platform.

To leverage this common implementation and enable A/B redundancy on
stm32mp1 platforms, define the corresponding FWU_BOOTFS_ID and
FWU_ROOTFS_ID image IDs.

The MAX_NUMBER_IDS is increased to 29 to accommodate these new entries,
aligning the numbering with the stm32mp2 architecture.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
@passgat

passgat commented May 12, 2026

Copy link
Copy Markdown
Author

I just updated the PR with an additional patch to support metadata-driven A/B boot for STM32MP1 as well.

@Yann-lms

Copy link
Copy Markdown
Collaborator

Hi @passgat,

Sorry, I missed this pull request so far.
I've a few remarks about it.

First, this Github repository is an ST read-only repository where we push our deliveries.
We do not directly accept contributions here.
The usual way for this is to push directly to the official TF-A repository (https://www.trustedfirmware.org/projects/tf-a/), and we have them in our software when we rebase our code for new ST releases.
The official repository uses gerrit, and not github, so the upstream process is a bit different, see https://trustedfirmware-a.readthedocs.io/en/latest/process/contributing.html.

About the patch itself, I really think the added data should be under a dedicated flag.
Especially the changes in plat/st/common/stm32mp_fconf_io.c, plat/st/stm32mp1/include/plat_tbbr_img_def.h and plat/st/stm32mp2/include/plat_tbbr_img_def.h.
This is mainly because increasing MAX_NUMBER_IDS will increase several tables, and that could be an issue for some features where internal SRAM size is already near its limit.
That's why we didn't chose the default IMAGE_ID flags and overwrite some of them to reduce those tables 'size.
And this flag should then not be enabled by default.
Adding this new flag will require changes in the doc (docs/plat/st/stm32mpus.rst), and in makefile (plat/st/common/common.mk).

We are also discussing this internally, as you've seen in other PRs.
We'll keep you posted.

Best regards,
Yann

@passgat

passgat commented May 23, 2026

Copy link
Copy Markdown
Author

Hi @Yann-lms,

Thank you for the detailed feedback.

As soon as possible, I will send the patches to the official TF-A repository.

Thanks and regards,

Dario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants