All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/24] Introduce Firmware Update Support for Arm PSA
@ 2025-07-25 15:49 abdellatif.elkhlifi
  2025-07-25 15:49 ` [PATCH v4 01/24] arm_ffa: Add FFA_MEM_SHARE support abdellatif.elkhlifi
                   ` (24 more replies)
  0 siblings, 25 replies; 29+ messages in thread
From: abdellatif.elkhlifi @ 2025-07-25 15:49 UTC (permalink / raw)
  To: u-boot
  Cc: Abdellatif El Khlifi, Tom Rini, Simon Glass, Sughosh Ganu,
	Heinrich Schuchardt, Ilias Apalodimas, Jens Wiklander,
	Michal Simek, Marek Vasut, Casey Connolly, Adriano Cordova,
	Mattijs Korpershoek, Davidson kumaresan, Hugues Kamba Mpiana,
	Adam Johnston

From: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>

This patch series adds Firmware Update (FWU) support for Arm PSA
Certified platforms [1], enabling U-Boot to serve as
the FWU Client, with the Secure World acting as the Update Agent that
manages the firmware store and its metadata.

This implementation adheres to the Platform Security Firmware Update
specification [3] for the A-profile Arm Architecture and leverages the
Trusted Services framework [4] to interact with the Secure World update
agent. By delegating update management to the Secure World, U-Boot
handles only the client-side coordination, invoking a well-defined set
of ABIs over the FF-A interface [5] to deliver update capsules.

Key features include:

- Generic, platform-agnostic design.
- FF-A-based ABI: All interactions between U-Boot and the update agent
    occur over the FF-A interface, ensuring compatibility across
    PSA-compliant systems.
- Multi-payload capsules: Support for capsules containing multiple
    payloads, start/end markers, signed firmware images.
- ESRT support: Capsule payloads may be signed for authenticity, and
    U-Boot can populate the EFI System Resource Table (ESRT) for
     OS-level firmware management.
- On-disk and standard capsule handling.

For implementation details, please refer to the documentation [6].
For a real world example, please see the Arm PSA FWU logs [7] when used
for on-disk capsule update in Corstone-1000 [2].

Changes in v4:

- Update the function headers in fwu_arm_psa.c to pass kernel-doc tests

Cheers,
Abdellatif

[1]: PSA: https://www.psacertified.org
[2]: Corstone-1000: https://developer.arm.com/Processors/Corstone-1000
[3]: DEN0118 v1.0 A specification: https://developer.arm.com/documentation/den0118/latest 
[4]: Trusted Services documentation: https://trusted-services.readthedocs.io/en/stable
[5]: FF-A interface: doc/arch/arm64.ffa.rst
[6]: Documentation of the FWU for Arm PSA support: doc/develop/uefi/fwu_arm_psa.rst
[7]: Arm PSA FWU logs when used for on-disk capsule update in Corstone-1000

```
CapsuleApp: capsule block/size              0xDD741040/0x25ACE
Found EFI system partition on Boot0001: OnDiskFWU
FS2:;HD0b:;BLK4: 
Succeed to write edk2-corstone1000-fvp-v6.uefi.capsule
resetting ...
NOTICE:  BL2: v2.11.0(debug):v2.11.0-dirty
...
U-Boot 2025.07-rc5 (Jul 10 2025 - 15:23:22 +0000) corstone1000 aarch64 
...
FWU: System booting in Regular State
FWU: ABI version 1.0 detected
FWU: Updating 1 payload(s)
Applying capsule edk2-corstone1000-fvp-v6.uefi.capsule succeeded.
Reboot after firmware update.
NOTICE:  BL2: v2.11.0(debug):v2.11.0-dirty
...
U-Boot 2025.07-rc5 (Jul 10 2025 - 15:23:22 +0000) corstone1000 aarch64 
...
FWU: System booting in Trial State
...
Poky (Yocto Project Reference Distro) 5.2 corstone1000-fvp /dev/ttyAMA0
...
root@corstone1000-fvp:~# reboot
...
U-Boot 2025.07-rc5 (Jul 10 2025 - 15:23:22 +0000) corstone1000 aarch64 
...
FWU: System booting in Regular State
...
Poky (Yocto Project Reference Distro) 5.2 corstone1000-fvp /dev/ttyAMA0

corstone1000-fvp login:

root@corstone1000-fvp:~# cat /sys/firmware/efi/esrt/entries/entry*/*
0x0
f1d883f9-dfeb-5363-98d8-686ee3b69f4f
0
6
0
6
0
0x0
7fad470e-5ec5-5c03-a2c1-4756b495de61
0
0
0
0
0
0x0
f1933675-5a8c-5b6d-9ef4-846739e89bc8
0
0
0
0
0
0x0
f771aff9-c7e9-5f99-9eda-2369dd694f61
0
0
0
0
0
root@corstone1000-fvp:~# 
```

Cc: Tom Rini <trini@konsulko.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Sughosh Ganu <sughosh.ganu@linaro.org>
Cc: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jens Wiklander <jens.wiklander@linaro.org>
Cc: Michal Simek <michal.simek@amd.com>
Cc: Marek Vasut <marek.vasut+renesas@mailbox.org>
Cc: Casey Connolly <casey.connolly@linaro.org>
Cc: Adriano Cordova <adrianox@gmail.com>
Cc: Mattijs Korpershoek <mkorpershoek@kernel.org>
Cc: Davidson kumaresan <davidson.kumaresan@arm.com>
Cc: Hugues Kamba Mpiana <hugues.kambampiana@arm.com>
Cc: Adam Johnston <Adam.Johnston@arm.com>

Abdellatif El Khlifi (23):
  arm_ffa: Add FFA_MEM_SHARE support
  arm_ffa: Add FFA_MEM_RECLAIM support
  arm_ffa: sandbox: Replace the emulator error log with debug log
  arm_ffa: sandbox: Improve the readability of clearing the X registers
  arm_ffa: sandbox: Add FFA_MEM_SHARE emulation
  arm_ffa: sandbox: Add FFA_MEM_SHARE tests
  arm_ffa: sandbox: Add FFA_MEM_RECLAIM emulation
  arm_ffa: sandbox: Add FFA_MEM_RECLAIM tests
  fwu_arm_psa: Initialize the update agent
  fwu_arm_psa: Read the FWU directory through get_image_info()
  fwu_arm_psa: Add staging ABIs
  efi_loader: fwu_arm_psa: Add set_image and get_image_info support
  efi_loader: fwu_arm_psa: Keep the FMP payload header
  efi_loader: fwu: fwu_arm_psa: Skip accepting the payload after
    set_image()
  efi_loader: fwu: fwu_arm_psa: Disable trial state handling
  fwu_arm_psa: Add FWU acceptance mechanism
  fwu_arm_psa: Add ESRT support
  fwu_arm_psa: Add ExitBootService() notification handler
  fwu_arm_psa: corstone1000: Enable FWU support
  fwu_arm_psa: corstone1000: Perform bank logic when reading boot index
  fwu_arm_psa: corstone1000: Notify SE Proxy SP on ExitBootService()
  fwu_arm_psa: corstone1000: Set Boot0001 for on-disk FWU
  fwu_arm_psa: Document FWU support for Arm PSA

Emekcan Aras (1):
  efi_loader: capsule: Add runtime capsule flags checks

 MAINTAINERS                                   |    8 +
 .../include/asm/sandbox_arm_ffa_priv.h        |   21 +-
 board/armltd/corstone1000/corstone1000.c      |  255 ++-
 board/armltd/corstone1000/corstone1000.env    |    8 +
 configs/corstone1000_defconfig                |   13 +-
 doc/arch/arm64.ffa.rst                        |    4 +
 doc/develop/uefi/fwu_arm_psa.rst              |  154 ++
 doc/develop/uefi/index.rst                    |    1 +
 drivers/firmware/arm-ffa/arm-ffa-uclass.c     |  285 +++-
 drivers/firmware/arm-ffa/arm-ffa.c            |    4 +-
 drivers/firmware/arm-ffa/ffa-emul-uclass.c    |  108 +-
 drivers/firmware/arm-ffa/sandbox_ffa.c        |    4 +-
 include/arm_ffa.h                             |  111 +-
 include/arm_ffa_priv.h                        |  143 +-
 include/efi_api.h                             |    8 +
 include/efi_loader.h                          |    8 +
 include/fwu_arm_psa.h                         |  427 +++++
 lib/efi_loader/efi_capsule.c                  |   64 +-
 lib/efi_loader/efi_firmware.c                 |   42 +-
 lib/fwu_updates/Kconfig                       |   26 +
 lib/fwu_updates/Makefile                      |    2 +
 lib/fwu_updates/fwu.c                         |   29 +-
 lib/fwu_updates/fwu_arm_psa.c                 | 1470 +++++++++++++++++
 test/dm/ffa.c                                 |   73 +-
 24 files changed, 3178 insertions(+), 90 deletions(-)
 create mode 100644 doc/develop/uefi/fwu_arm_psa.rst
 create mode 100644 include/fwu_arm_psa.h
 create mode 100644 lib/fwu_updates/fwu_arm_psa.c


base-commit: 59e6462d7c08eeba744afa0f17846c398b8ef9e1
-- 
2.25.1


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

end of thread, other threads:[~2025-08-20 15:17 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-25 15:49 [PATCH v4 00/24] Introduce Firmware Update Support for Arm PSA abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 01/24] arm_ffa: Add FFA_MEM_SHARE support abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 02/24] arm_ffa: Add FFA_MEM_RECLAIM support abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 03/24] arm_ffa: sandbox: Replace the emulator error log with debug log abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 04/24] arm_ffa: sandbox: Improve the readability of clearing the X registers abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 05/24] arm_ffa: sandbox: Add FFA_MEM_SHARE emulation abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 06/24] arm_ffa: sandbox: Add FFA_MEM_SHARE tests abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 07/24] arm_ffa: sandbox: Add FFA_MEM_RECLAIM emulation abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 08/24] arm_ffa: sandbox: Add FFA_MEM_RECLAIM tests abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 09/24] fwu_arm_psa: Initialize the update agent abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 10/24] fwu_arm_psa: Read the FWU directory through get_image_info() abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 11/24] fwu_arm_psa: Add staging ABIs abdellatif.elkhlifi
2025-07-25 15:49 ` [PATCH v4 12/24] efi_loader: fwu_arm_psa: Add set_image and get_image_info support abdellatif.elkhlifi
2025-08-20 12:28   ` Ilias Apalodimas
2025-08-20 15:16     ` Tom Rini
2025-07-25 15:49 ` [PATCH v4 13/24] efi_loader: fwu_arm_psa: Keep the FMP payload header abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 14/24] efi_loader: fwu: fwu_arm_psa: Skip accepting the payload after set_image() abdellatif.elkhlifi
2025-08-20 12:37   ` Ilias Apalodimas
2025-07-25 15:50 ` [PATCH v4 15/24] efi_loader: fwu: fwu_arm_psa: Disable trial state handling abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 16/24] fwu_arm_psa: Add FWU acceptance mechanism abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 17/24] fwu_arm_psa: Add ESRT support abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 18/24] fwu_arm_psa: Add ExitBootService() notification handler abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 19/24] efi_loader: capsule: Add runtime capsule flags checks abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 20/24] fwu_arm_psa: corstone1000: Enable FWU support abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 21/24] fwu_arm_psa: corstone1000: Perform bank logic when reading boot index abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 22/24] fwu_arm_psa: corstone1000: Notify SE Proxy SP on ExitBootService() abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 23/24] fwu_arm_psa: corstone1000: Set Boot0001 for on-disk FWU abdellatif.elkhlifi
2025-07-25 15:50 ` [PATCH v4 24/24] fwu_arm_psa: Document FWU support for Arm PSA abdellatif.elkhlifi
2025-08-20 12:33 ` [PATCH v4 00/24] Introduce Firmware Update Support " Abdellatif El Khlifi

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.