FWU: Add checking the state of the running image
The Firmware Update partition reads the image_ok flag to check
whether the running image has been confirmed. The running image
state is set according to this flag in psa_fwu_query().
Change-Id: I9cf58b7d6f3b87a50e0ac6f926e30170bb01b8f1
Signed-off-by: Sherry Zhang <sherry.zhang2@arm.com>
diff --git a/interface/src/tfm_firmware_update_ipc_api.c b/interface/src/tfm_firmware_update_ipc_api.c
index a21a333..60d4b2e 100644
--- a/interface/src/tfm_firmware_update_ipc_api.c
+++ b/interface/src/tfm_firmware_update_ipc_api.c
@@ -155,10 +155,13 @@
return status;
}
-psa_status_t psa_fwu_accept(void)
+psa_status_t psa_fwu_accept(psa_image_id_t image_id)
{
psa_handle_t handle;
psa_status_t status;
+ psa_invec in_vec[] = {
+ { .base = &image_id, .len = sizeof(image_id) }
+ };
handle = psa_connect(TFM_FWU_ACCEPT_SID,
TFM_FWU_ACCEPT_VERSION);
@@ -166,7 +169,7 @@
return PSA_ERROR_GENERIC_ERROR;
}
- status = psa_call(handle, PSA_IPC_CALL, NULL, 0, NULL, 0);
+ status = psa_call(handle, PSA_IPC_CALL, in_vec, IOVEC_LEN(in_vec), NULL, 0);
psa_close(handle);