Platform: Update platform partition to SFN
Change-Id: Ia0863dd3514b118f6c95358922bfa70f0f0a6b0c
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/interface/src/tfm_platform_ipc_api.c b/interface/src/tfm_platform_ipc_api.c
index 072e243..d709607 100644
--- a/interface/src/tfm_platform_ipc_api.c
+++ b/interface/src/tfm_platform_ipc_api.c
@@ -12,17 +12,10 @@
enum tfm_platform_err_t tfm_platform_system_reset(void)
{
psa_status_t status = PSA_ERROR_CONNECTION_REFUSED;
- psa_handle_t handle = PSA_NULL_HANDLE;
- handle = psa_connect(TFM_SP_PLATFORM_SYSTEM_RESET_SID,
- TFM_SP_PLATFORM_SYSTEM_RESET_VERSION);
- if (handle <= 0) {
- return TFM_PLATFORM_ERR_SYSTEM_ERROR;
- }
-
- status = psa_call(handle, PSA_IPC_CALL,
+ status = psa_call(TFM_PLATFORM_SERVICE_HANDLE,
+ TFM_PLATFORM_API_ID_SYSTEM_RESET,
NULL, 0, NULL, 0);
- psa_close(handle);
if (status < PSA_SUCCESS) {
return TFM_PLATFORM_ERR_SYSTEM_ERROR;
@@ -40,7 +33,6 @@
struct psa_invec in_vec[2] = { {0} };
size_t inlen, outlen;
psa_status_t status = PSA_ERROR_CONNECTION_REFUSED;
- psa_handle_t handle = PSA_NULL_HANDLE;
in_vec[0].base = &req;
in_vec[0].len = sizeof(req);
@@ -58,16 +50,10 @@
outlen = 0;
}
- handle = psa_connect(TFM_SP_PLATFORM_IOCTL_SID,
- TFM_SP_PLATFORM_IOCTL_VERSION);
- if (handle <= 0) {
- return TFM_PLATFORM_ERR_SYSTEM_ERROR;
- }
-
- status = psa_call(handle, PSA_IPC_CALL,
+ status = psa_call(TFM_PLATFORM_SERVICE_HANDLE,
+ TFM_PLATFORM_API_ID_IOCTL,
in_vec, inlen,
output, outlen);
- psa_close(handle);
if (status < PSA_SUCCESS) {
return TFM_PLATFORM_ERR_SYSTEM_ERROR;
@@ -80,23 +66,15 @@
tfm_platform_nv_counter_increment(uint32_t counter_id)
{
psa_status_t status = PSA_ERROR_CONNECTION_REFUSED;
- psa_handle_t handle = PSA_NULL_HANDLE;
struct psa_invec in_vec[1];
in_vec[0].base = &counter_id;
in_vec[0].len = sizeof(counter_id);
- handle = psa_connect(TFM_SP_PLATFORM_NV_COUNTER_SID,
- TFM_SP_PLATFORM_NV_COUNTER_VERSION);
- if (handle <= 0) {
- return TFM_PLATFORM_ERR_SYSTEM_ERROR;
- }
-
- status = psa_call(handle, TFM_PLATFORM_API_ID_NV_INCREMENT,
+ status = psa_call(TFM_PLATFORM_SERVICE_HANDLE,
+ TFM_PLATFORM_API_ID_NV_INCREMENT,
in_vec, 1, (psa_outvec *)NULL, 0);
- psa_close(handle);
-
if (status < PSA_SUCCESS) {
return TFM_PLATFORM_ERR_SYSTEM_ERROR;
} else {
@@ -109,7 +87,6 @@
uint32_t size, uint8_t *val)
{
psa_status_t status = PSA_ERROR_CONNECTION_REFUSED;
- psa_handle_t handle = PSA_NULL_HANDLE;
struct psa_invec in_vec[1];
struct psa_outvec out_vec[1];
@@ -119,17 +96,10 @@
out_vec[0].base = val;
out_vec[0].len = size;
- handle = psa_connect(TFM_SP_PLATFORM_NV_COUNTER_SID,
- TFM_SP_PLATFORM_NV_COUNTER_VERSION);
- if (handle <= 0) {
- return TFM_PLATFORM_ERR_SYSTEM_ERROR;
- }
-
- status = psa_call(handle, TFM_PLATFORM_API_ID_NV_READ,
+ status = psa_call(TFM_PLATFORM_SERVICE_HANDLE,
+ TFM_PLATFORM_API_ID_NV_READ,
in_vec, 1, out_vec, 1);
- psa_close(handle);
-
if (status < PSA_SUCCESS) {
return TFM_PLATFORM_ERR_SYSTEM_ERROR;
} else {