From: Abdellatif El Khlifi <[email protected]>

Allow sending the payload with its FMP header

The Secure world needs the data provided by the payload
FMP header. So, let's keep it in case of FWU_ARM_PSA.

Signed-off-by: Abdellatif El Khlifi <[email protected]>
Cc: Heinrich Schuchardt <[email protected]>
Cc: Sughosh Ganu <[email protected]>
Cc: Tom Rini <[email protected]>
Cc: Ilias Apalodimas <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Michal Simek <[email protected]>
Cc: Marek Vasut <[email protected]>
Cc: Casey Connolly <[email protected]>
Cc: Adriano Cordova <[email protected]>
---
 lib/efi_loader/efi_firmware.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
index 38945b34e7b..e1fc3f577d4 100644
--- a/lib/efi_loader/efi_firmware.c
+++ b/lib/efi_loader/efi_firmware.c
@@ -517,8 +517,11 @@ static void efi_firmware_get_fw_version(const void 
**p_image,
                /* FMP header is inserted above the capsule payload */
                state->fw_version = header->fw_version;
 
-               *p_image += header->header_size;
-               *p_image_size -= header->header_size;
+               if (!IS_ENABLED(CONFIG_FWU_ARM_PSA)) {
+                       *p_image += header->header_size;
+                       *p_image_size -= header->header_size;
+               }
+
        }
 }
 
-- 
2.25.1

Reply via email to