[PATCH v5 14/24] efi_loader: fwu: fwu_arm_psa: Skip accepting the payload after set_image()
abdellatif.elkhlifi at arm.com
abdellatif.elkhlifi at arm.com
Fri Sep 26 16:13:41 CEST 2025
From: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
Do not update the acceptance metadata bit after updating an image
The update agent (secure world) is responsible of setting the acceptance
bit in the metadata.
Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi at arm.com>
Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
Cc: Sughosh Ganu <sughosh.ganu at linaro.org>
Cc: Tom Rini <trini at konsulko.com>
Cc: Ilias Apalodimas <ilias.apalodimas at linaro.org>
Cc: Simon Glass <sjg at chromium.org>
Cc: Michal Simek <michal.simek at amd.com>
Cc: Marek Vasut <marek.vasut+renesas at mailbox.org>
Cc: Casey Connolly <casey.connolly at linaro.org>
Cc: Adriano Cordova <adrianox at gmail.com>
---
Changelog of changes:
===========================
v5:
* As suggested by Ilias: Make PSA handling simpler for the acceptance logic
(less ifs)
lib/efi_loader/efi_capsule.c | 5 +++--
lib/fwu_updates/fwu.c | 16 ++++++++++++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 234e3c1b3c0..06b502e2c25 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -704,8 +704,9 @@ static efi_status_t efi_capsule_update_firmware(
goto out;
}
- log_debug("%s the accepted bit for Image %pUs\n",
- fw_accept_os ? "Cleared" : "Set",
+ log_debug("%s %s the accepted bit for Image %pUs\n",
+ IS_ENABLED(CONFIG_FWU_ARM_PSA) ? "PSA will" : "",
+ fw_accept_os ? "clear" : "set",
image_type_id);
}
diff --git a/lib/fwu_updates/fwu.c b/lib/fwu_updates/fwu.c
index 7f085a0211f..bfbb98c16d7 100644
--- a/lib/fwu_updates/fwu.c
+++ b/lib/fwu_updates/fwu.c
@@ -586,6 +586,14 @@ out:
*/
int fwu_accept_image(efi_guid_t *img_type_id, u32 bank)
{
+ /*
+ * In case of Arm PSA accepting images is either
+ * at ExitBootServices() or in the OS. So, let's skip setting the
+ * acceptance bit (not used in Arm PSA)
+ */
+ if (IS_ENABLED(CONFIG_FWU_ARM_PSA))
+ return EFI_SUCCESS;
+
return fwu_clrset_image_accept(img_type_id, bank,
IMAGE_ACCEPT_SET);
}
@@ -606,6 +614,14 @@ int fwu_accept_image(efi_guid_t *img_type_id, u32 bank)
*/
int fwu_clear_accept_image(efi_guid_t *img_type_id, u32 bank)
{
+ /*
+ * In case of Arm PSA accepting images is either
+ * at ExitBootServices() or in the OS. So, let's skip clearing the
+ * acceptance bit (not used in Arm PSA)
+ */
+ if (IS_ENABLED(CONFIG_FWU_ARM_PSA))
+ return EFI_SUCCESS;
+
return fwu_clrset_image_accept(img_type_id, bank,
IMAGE_ACCEPT_CLEAR);
}
--
2.43.0
More information about the U-Boot
mailing list