IPC: Tests addition and updates for PSA FF 1.0

- Tests addition and updates for PSA FF 1.0
- Remove unused platform files
- Update READMEs for security implication note
- Minor bug fixes
diff --git a/api-tests/val/common/val.h b/api-tests/val/common/val.h
index 243c584..c9bcc33 100644
--- a/api-tests/val/common/val.h
+++ b/api-tests/val/common/val.h
@@ -178,6 +178,12 @@
 } test_isolation_level_t;
 
 typedef enum {
+    LEVEL1 = 0x1,
+    LEVEL2,
+    LEVEL3,
+} isolation_level_t;
+
+typedef enum {
     /* VAL uses this boot flag to mark first time boot of the system  */
     BOOT_UNKNOWN                       = 0x1,
     /* VAL/Test uses this boot flag to catch any unwanted system reboot - SIM ERROR Cases*/
diff --git a/api-tests/val/common/val_target.h b/api-tests/val/common/val_target.h
index 415c8f6..b450a33 100644
--- a/api-tests/val/common/val_target.h
+++ b/api-tests/val/common/val_target.h
@@ -103,12 +103,6 @@
 }target_cfg_hdr_t;
 
 typedef enum {
-    LEVEL1 = 0x1,
-    LEVEL2,
-    LEVEL3,
-} firmware_level_t;
-
-typedef enum {
     NOT_AVAILABLE   = 0x0,
     AVAILABLE       = 0x1,
 } is_available_t;
@@ -191,11 +185,9 @@
 
 typedef struct _MISCELLANEOUS_INFO_DESC_ {
     cfg_type_t              cfg_type;
-    firmware_level_t        implemented_psa_firmware_isolation_level;
     addr_t                  ns_start_addr_of_combine_test_binary;
     is_available_t          combine_test_binary_in_ram;
     addr_t                  ns_test_addr;
-    is_available_t          sp_heap_mem_supp;
 } miscellaneous_desc_t;
 
 /*val target config read apis */
diff --git a/api-tests/val/nspe/pal_interfaces_ns.h b/api-tests/val/nspe/pal_interfaces_ns.h
index 0b50612..e017d19 100644
--- a/api-tests/val/nspe/pal_interfaces_ns.h
+++ b/api-tests/val/nspe/pal_interfaces_ns.h
@@ -40,10 +40,10 @@
 uint32_t pal_ipc_framework_version(void);
 
 /**
- * @brief    - Retrieve the minor version of a Root of Trust Service by its SID.
+ * @brief    - Retrieve the version of a Root of Trust Service by its SID.
  *             This is a wrapper API for the psa_version API.
  * @param    - sid The Root of Trust Service ID
- * @return   - Minor version of Root of Trust Service or PSA_VERSION_NONE if Root of Trust Service
+ * @return   - Version of Root of Trust Service or PSA_VERSION_NONE if Root of Trust Service
  *             not present on the system.
  *             Note - Return PAL_STATUS_ERROR if PSA IPC is not implemented.
  */
@@ -53,17 +53,18 @@
  * @brief   - Connect to given sid.
  *            This is a wrapper API for the psa_connect API.
  * @param   - sid : RoT service id
- *          - minor_version : minor_version of RoT service
+ *          - version : version of RoT service
  * @return  - psa_handle_t : return connection handle
  *            Note - Return PSA_NULL_HANDLE if PSA IPC is not implemented.
  */
-psa_handle_t pal_ipc_connect(uint32_t sid, uint32_t minor_version);
+psa_handle_t pal_ipc_connect(uint32_t sid, uint32_t version);
 
 /**
  * @brief  - Call a connected Root of Trust Service.
  *          This is a wrapper API for the psa_call API. The caller must provide an array of
  *          psa_invec_t structures as the input payload.
  * @param  - handle:   Handle for the connection.
+ *         - type:     Request type
  *         - in_vec:   Array of psa_invec structures.
  *         - in_len:   Number of psa_invec structures in in_vec.
  *         - out_vec:  Array of psa_outvec structures for optional Root of Trust Service response.
@@ -72,10 +73,11 @@
  */
 
 psa_status_t pal_ipc_call(psa_handle_t handle,
-                         const psa_invec *in_vec,
-                         size_t in_len,
-                         psa_outvec *out_vec,
-                         size_t out_len);
+                          int32_t type,
+                          const psa_invec *in_vec,
+                          size_t in_len,
+                          psa_outvec *out_vec,
+                          size_t out_len);
 
 /**
  * @brief - Close a connection to a Root of Trust Service.
diff --git a/api-tests/val/nspe/val_dispatcher.c b/api-tests/val/nspe/val_dispatcher.c
index 5d6da4e..d6a2f1a 100644
--- a/api-tests/val/nspe/val_dispatcher.c
+++ b/api-tests/val/nspe/val_dispatcher.c
@@ -484,7 +484,7 @@
    val_print(PRINT_ALWAYS, "TOTAL SKIPPED   : %d\n", test_count.skip_cnt);
    val_print(PRINT_ALWAYS, "******************************************\n", 0);
 
-   return (test_count.fail_cnt > 0) ? VAL_STATUS_TEST_FAILED : VAL_STATUS_SUCCESS ;
+   return (test_count.fail_cnt > 0) ? VAL_STATUS_TEST_FAILED : VAL_STATUS_SUCCESS;
 }
 
 
diff --git a/api-tests/val/nspe/val_dispatcher.h b/api-tests/val/nspe/val_dispatcher.h
index 173e8c6..9763dd9 100644
--- a/api-tests/val/nspe/val_dispatcher.h
+++ b/api-tests/val/nspe/val_dispatcher.h
@@ -1,5 +1,5 @@
 /** @file
- * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited or its affiliates. All rights reserved.
  * SPDX-License-Identifier : Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -66,5 +66,5 @@
     uint32_t  elf_size;
 } test_header_t;
 
-int32_t val_dispatcher(test_id_t);
+int32_t val_dispatcher(test_id_t test_id_prev);
 #endif
diff --git a/api-tests/val/nspe/val_entry.c b/api-tests/val/nspe/val_entry.c
index f0a44dd..15aefb9 100644
--- a/api-tests/val/nspe/val_entry.c
+++ b/api-tests/val/nspe/val_entry.c
@@ -23,7 +23,7 @@
 /**
     @brief    - PSA C main function, does VAL init and calls test dispatcher
     @param    - None
-    @return   - status - error code 
+    @return   - status - error code
 **/
 int32_t val_entry(void)
 {
diff --git a/api-tests/val/nspe/val_framework.c b/api-tests/val/nspe/val_framework.c
index 57cb0b6..322f166 100644
--- a/api-tests/val/nspe/val_framework.c
+++ b/api-tests/val/nspe/val_framework.c
@@ -31,20 +31,18 @@
 /**
  * @brief Connect to given sid
    @param  -sid : RoT service id
-   @param  -minor_version : minor_version of RoT service
+   @param  -version : version of RoT service
    @param  -handle - return connection handle
  * @return val_status_t
  */
-val_status_t val_ipc_connect(uint32_t sid, uint32_t minor_version, psa_handle_t *handle )
+val_status_t val_ipc_connect(uint32_t sid, uint32_t version, psa_handle_t *handle )
 {
-    *handle = pal_ipc_connect(sid, minor_version);
+    *handle = pal_ipc_connect(sid, version);
 
-    if (*handle < 0)
-    {
-        return VAL_STATUS_CONNECTION_FAILED;
-    }
+    if (*handle > 0)
+        return VAL_STATUS_SUCCESS;
 
-    return VAL_STATUS_SUCCESS;
+    return VAL_STATUS_CONNECTION_FAILED;
 }
 
 /**
@@ -52,18 +50,23 @@
  * The caller must provide an array of ::psa_invec_t structures as the input payload.
  *
  * @param  handle   Handle for the connection.
+ * @param  type     Request type
  * @param  in_vec   Array of psa_invec structures.
  * @param  in_len   Number of psa_invec structures in in_vec.
  * @param out_vec  Array of psa_outvec structures for optional Root of Trust Service response.
  * @param  out_len  Number of psa_outvec structures in out_vec.
  * @return val_status_t
  */
-val_status_t val_ipc_call(psa_handle_t handle, psa_invec *in_vec, size_t in_len,
-                          psa_outvec *out_vec, size_t out_len)
+val_status_t val_ipc_call(psa_handle_t handle,
+                          int32_t type,
+                          const psa_invec *in_vec,
+                          size_t in_len,
+                          psa_outvec *out_vec,
+                          size_t out_len)
 {
     psa_status_t call_status = PSA_SUCCESS;
 
-    call_status = pal_ipc_call(handle, in_vec, in_len, out_vec, out_len);
+    call_status = pal_ipc_call(handle, type, in_vec, in_len, out_vec, out_len);
 
     if (call_status != PSA_SUCCESS)
     {
@@ -123,7 +126,7 @@
              */
             if ((boot.state ==  BOOT_EXPECTED_REENTER_TEST) && (i == 1))
             {
-                val_print(PRINT_DEBUG, "[Check1] PASSED\n", 0);
+                val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
                 i++;
                 continue;
             }
@@ -149,12 +152,12 @@
                 if (VAL_ERROR(status))
                 {
                     val_set_status(RESULT_FAIL(status));
-                    val_print(PRINT_DEBUG,"[Check%d] START\n", i);
+                    val_print(PRINT_DEBUG, "[Check %d] START\n", i);
                     return status;
                 }
                 else
                 {
-                    val_print(PRINT_DEBUG,"[Check%d] START\n", i);
+                    val_print(PRINT_DEBUG, "[Check %d] START\n", i);
                 }
             }
 
@@ -172,21 +175,21 @@
             {
                 val_set_status(status);
                 if (server_hs == TRUE)
-                    val_print(PRINT_DEBUG, "[Check%d] SKIPPED\n", i);
+                    val_print(PRINT_DEBUG, "[Check %d] SKIPPED\n", i);
                 return status;
             }
             else if (VAL_ERROR(status))
             {
                 val_set_status(RESULT_FAIL(status));
                 if (server_hs == TRUE)
-                    val_print(PRINT_DEBUG, "[Check%d] FAILED\n", i);
+                    val_print(PRINT_DEBUG, "[Check %d] FAILED\n", i);
 
                 return status;
             }
             else
             {
                 if (server_hs == TRUE)
-                    val_print(PRINT_DEBUG, "[Check%d] PASSED\n", i);
+                    val_print(PRINT_DEBUG, "[Check %d] PASSED\n", i);
             }
 
             i++;
@@ -198,7 +201,7 @@
        status = VAL_STATUS_SUCCESS;
        if (boot.state != BOOT_EXPECTED_S)
        {
-            val_print(PRINT_DEBUG, "[Check1] PASSED\n", 0);
+            val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
        }
    }
    return status;
@@ -236,7 +239,7 @@
        if (boot.state ==  BOOT_EXPECTED_REENTER_TEST)
        {
             test_info.block_num++;
-            val_print(PRINT_DEBUG, "[Check1] PASSED\n", 0);
+            val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
        }
 
        status = val_set_boot_flag(BOOT_NOT_EXPECTED);
@@ -268,7 +271,7 @@
    else
    {
        /* If we are here means, we are in third run of this test */
-       val_print(PRINT_DEBUG, "[Check1] PASSED\n", 0);
+       val_print(PRINT_DEBUG, "[Check 1] PASSED\n", 0);
        return VAL_STATUS_SUCCESS;
    }
 
@@ -293,23 +296,25 @@
     val_status_t    status = VAL_STATUS_SUCCESS;
     psa_status_t    status_of_call = PSA_SUCCESS;
 
-    *handle = pal_ipc_connect(sid, 0);
-    if (*handle < 0)
+    *handle = pal_ipc_connect(sid, 1);
+    if (*handle > 0)
+    {
+        test_data = ((uint32_t)(test_info.test_num) |((uint32_t)(test_info.block_num) << BLOCK_NUM_POS)
+                    | ((uint32_t)(TEST_EXECUTE_FUNC) << ACTION_POS));
+        psa_invec data[1] = {{&test_data, sizeof(test_data)}};
+
+        status_of_call = pal_ipc_call(*handle, 0, data, 1, NULL, 0);
+        if (status_of_call != PSA_SUCCESS)
+        {
+            status = VAL_STATUS_CALL_FAILED;
+            val_print(PRINT_ERROR, "Call to dispatch SF failed. Status=%x\n", status_of_call);
+            pal_ipc_close(*handle);
+        }
+    }
+    else
     {
         val_print(PRINT_ERROR, "Could not connect SID. Handle=%x\n", *handle);
-        return VAL_STATUS_CONNECTION_FAILED;
-    }
-
-    test_data = ((uint32_t)(test_info.test_num) |((uint32_t)(test_info.block_num) << BLOCK_NUM_POS)
-                | ((uint32_t)(TEST_EXECUTE_FUNC) << ACTION_POS));
-    psa_invec data[1] = {{&test_data, sizeof(test_data)}};
-
-    status_of_call = pal_ipc_call(*handle, data, 1, NULL, 0);
-    if (status_of_call != PSA_SUCCESS)
-    {
-        status = VAL_STATUS_CALL_FAILED;
-        val_print(PRINT_ERROR, "Call to dispatch SF failed. Status=%x\n", status_of_call);
-        pal_ipc_close(*handle);
+        status = VAL_STATUS_CONNECTION_FAILED;
     }
 
     return status;
@@ -332,7 +337,7 @@
     psa_outvec resp = {&status, sizeof(status)};
     psa_invec data[1] = {{&test_data, sizeof(test_data)}};
 
-    status_of_call = pal_ipc_call(*handle, data, 1, &resp, 1);
+    status_of_call = pal_ipc_call(*handle, 0, data, 1, &resp, 1);
     if (status_of_call != PSA_SUCCESS)
     {
         status = VAL_STATUS_CALL_FAILED;
@@ -462,7 +467,6 @@
 void val_test_init(uint32_t test_num, char8_t *desc, uint32_t test_bitfield)
 {
    val_status_t         status = VAL_STATUS_SUCCESS;
-   miscellaneous_desc_t *misc_desc;
 
    /*global init*/
    g_status_buffer.state   = TEST_FAIL;
@@ -472,18 +476,7 @@
    val_print(PRINT_ALWAYS, desc, 0);
 
    /* common skip logic */
-   status = val_target_get_config(TARGET_CONFIG_CREATE_ID(GROUP_MISCELLANEOUS,
-                                   MISCELLANEOUS_DUT, 0),
-                                  (uint8_t **)&misc_desc,
-                                  (uint32_t *)sizeof(miscellaneous_desc_t));
-   if (VAL_ERROR(status))
-   {
-       val_print(PRINT_ERROR, "val_target_get_config failed Error=0x%x\n", status);
-       return;
-   }
-
-   if (misc_desc->implemented_psa_firmware_isolation_level <
-       GET_TEST_ISOLATION_LEVEL(test_bitfield))
+   if (PLATFORM_PSA_ISOLATION_LEVEL < GET_TEST_ISOLATION_LEVEL(test_bitfield))
    {
        val_set_status(RESULT_SKIP(VAL_STATUS_ISOLATION_LEVEL_NOT_SUPP));
        val_print(PRINT_ALWAYS, "\tSkipping test. Required isolation level is not supported\n", 0);
@@ -508,7 +501,7 @@
    }
 #endif
 
-   val_set_status(RESULT_START(VAL_STATUS_SUCCESS));
+   val_set_status(RESULT_START(status));
    return;
 }
 
diff --git a/api-tests/val/nspe/val_framework.h b/api-tests/val/nspe/val_framework.h
index 84e2bd0..7e13fb6 100644
--- a/api-tests/val/nspe/val_framework.h
+++ b/api-tests/val/nspe/val_framework.h
@@ -1,5 +1,5 @@
 /** @file
- * Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited or its affiliates. All rights reserved.
  * SPDX-License-Identifier : Apache-2.0
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
@@ -31,15 +31,21 @@
 void         val_test_init(uint32_t test_num, char8_t *desc, uint32_t test_bitfield);
 void         val_test_exit(void);
 val_status_t val_get_last_run_test_id(test_id_t *test_id);
-val_status_t val_execute_non_secure_tests(uint32_t test_num, client_test_t *tests_list,
-                                                                         bool_t server_hs);
+val_status_t val_execute_non_secure_tests(uint32_t test_num,
+                                          client_test_t *tests_list,
+                                          bool_t server_hs);
 val_status_t val_switch_to_secure_client(uint32_t test_num);
-val_status_t val_execute_secure_test_func(psa_handle_t *handle, test_info_t test_info,
+val_status_t val_execute_secure_test_func(psa_handle_t *handle,
+                                          test_info_t test_info,
                                           uint32_t sid);
 val_status_t val_get_secure_test_result(psa_handle_t *handle);
-val_status_t val_ipc_connect(uint32_t sid, uint32_t minor_version, psa_handle_t *handle);
-val_status_t val_ipc_call(psa_handle_t handle, psa_invec *in_vec, size_t in_len,
-                          psa_outvec *out_vec, size_t out_len);
+val_status_t val_ipc_connect(uint32_t sid, uint32_t version, psa_handle_t *handle);
+val_status_t val_ipc_call(psa_handle_t handle,
+                          int32_t type,
+                          const psa_invec *in_vec,
+                          size_t in_len,
+                          psa_outvec *out_vec,
+                          size_t out_len);
 void         val_ipc_close(psa_handle_t handle);
 val_status_t val_set_boot_flag(boot_state_t state);
 val_status_t val_get_boot_flag(boot_state_t *state);
diff --git a/api-tests/val/nspe/val_interfaces.h b/api-tests/val/nspe/val_interfaces.h
index 8e9c56b..944d4b1 100644
--- a/api-tests/val/nspe/val_interfaces.h
+++ b/api-tests/val/nspe/val_interfaces.h
@@ -38,10 +38,13 @@
     val_status_t     (*switch_to_secure_client)   (uint32_t test_num);
     val_status_t     (*execute_secure_test_func)  (psa_handle_t *handle, test_info_t test_info,
                                                    uint32_t sid);
-    val_status_t     (*ipc_connect)               (uint32_t sid, uint32_t minor_version,
+    val_status_t     (*ipc_connect)               (uint32_t sid, uint32_t version,
                                                    psa_handle_t *handle );
-    val_status_t     (*ipc_call)                  (psa_handle_t handle, psa_invec *in_vec,
-                                                   size_t in_len,  psa_outvec *out_vec,
+    val_status_t     (*ipc_call)                  (psa_handle_t handle,
+                                                   int32_t type,
+                                                   const psa_invec *in_vec,
+                                                   size_t in_len,
+                                                   psa_outvec *out_vec,
                                                    size_t out_len);
     void             (*ipc_close)                 (psa_handle_t handle);
     val_status_t     (*get_secure_test_result)    (psa_handle_t *handle);
@@ -62,13 +65,13 @@
 typedef struct {
     uint32_t         (*framework_version)     (void);
     uint32_t         (*version)               (uint32_t sid);
-    psa_handle_t     (*connect)               (uint32_t sid, uint32_t minor_version);
+    psa_handle_t     (*connect)               (uint32_t sid, uint32_t version);
     psa_status_t     (*call)                  (psa_handle_t handle,
-                                              const psa_invec *in_vec,
-                                              size_t in_len,
-                                              psa_outvec *out_vec,
-                                              size_t out_len
-                                              );
+                                               int32_t type,
+                                               const psa_invec *in_vec,
+                                               size_t in_len,
+                                               psa_outvec *out_vec,
+                                               size_t out_len);
     void             (*close)                 (psa_handle_t handle);
 } psa_api_t;
 
diff --git a/api-tests/val/spe/val_partition_common.h b/api-tests/val/spe/val_partition_common.h
index fe32baa..0b1d6be 100644
--- a/api-tests/val/spe/val_partition_common.h
+++ b/api-tests/val/spe/val_partition_common.h
@@ -33,10 +33,13 @@
 __UNUSED STATIC_DECLARE val_status_t val_print
                         (print_verbosity_t verbosity, char *string, int32_t data);
 __UNUSED STATIC_DECLARE val_status_t val_ipc_connect
-                        (uint32_t sid, uint32_t minor_version, psa_handle_t *handle );
-__UNUSED STATIC_DECLARE val_status_t val_ipc_call
-                        (psa_handle_t handle, psa_invec *in_vec, size_t in_len,
-                         psa_outvec *out_vec, size_t out_len);
+                        (uint32_t sid, uint32_t version, psa_handle_t *handle );
+__UNUSED STATIC_DECLARE val_status_t val_ipc_call(psa_handle_t handle,
+                                                  int32_t type,
+                                                  const psa_invec *in_vec,
+                                                  size_t in_len,
+                                                  psa_outvec *out_vec,
+                                                  size_t out_len);
 __UNUSED STATIC_DECLARE void val_ipc_close
                         (psa_handle_t handle);
 __UNUSED STATIC_DECLARE val_status_t val_process_connect_request(psa_signal_t sig, psa_msg_t *msg);
@@ -84,6 +87,7 @@
     .clear                 = psa_clear,
     .eoi                   = psa_eoi,
     .rot_lifecycle_state   = psa_rot_lifecycle_state,
+    .panic                 = psa_panic,
 };
 
 /**
@@ -115,20 +119,20 @@
     }
 
     psa_invec data1[3] = {{&uart_fn, sizeof(uart_fn)}, {string, string_len+1}, {&data, sizeof(data)}};
-    print_handle = psa_connect(DRIVER_UART_SID, 0);
+    print_handle = psa_connect(DRIVER_UART_SID, DRIVER_UART_VERSION);
 
-    if (print_handle < 0)
+    if (PSA_HANDLE_IS_VALID(print_handle))
     {
-        return VAL_STATUS_CONNECTION_FAILED;
-    }
-    else
-    {
-        status_of_call = psa_call(print_handle, data1, 3, NULL, 0);
+        status_of_call = psa_call(print_handle, 0, data1, 3, NULL, 0);
         if (status_of_call != PSA_SUCCESS)
         {
             status = VAL_STATUS_CALL_FAILED;
         }
     }
+    else
+    {
+        return VAL_STATUS_CONNECTION_FAILED;
+    }
     psa_close(print_handle);
     return status;
 }
@@ -136,39 +140,42 @@
 /**
  * @brief Connect to given sid
    @param  -sid : RoT service id
-   @param  -minor_version : minor_version of RoT service
+   @param  -version : version of RoT service
    @param  -handle - return connection handle
  * @return val_status_t
  */
-STATIC_DECLARE val_status_t val_ipc_connect(uint32_t sid, uint32_t minor_version,
+STATIC_DECLARE val_status_t val_ipc_connect(uint32_t sid, uint32_t version,
                                             psa_handle_t *handle )
 {
-    *handle = psa_connect(sid, minor_version);
+    *handle = psa_connect(sid, version);
 
-    if (*handle < 0)
-    {
-        return(VAL_STATUS_CONNECTION_FAILED);
-    }
+    if (PSA_HANDLE_IS_VALID(*handle))
+        return VAL_STATUS_SUCCESS;
 
-    return VAL_STATUS_SUCCESS;
+    return VAL_STATUS_CONNECTION_FAILED;
 }
 
 /**
  * @brief Call a connected Root of Trust Service.@n
  *        The caller must provide an array of ::psa_invec_t structures as the input payload.
  * @param  handle:   Handle for the connection.
+ * @param  type:     Request type.
  * @param  in_vec:   Array of psa_invec structures.
  * @param  in_len:   Number of psa_invec structures in in_vec.
  * @param  out_vec:  Array of psa_outvec structures for optional Root of Trust Service response.
  * @param  out_len:  Number of psa_outvec structures in out_vec.
  * @return val_status_t
  */
-STATIC_DECLARE val_status_t val_ipc_call(psa_handle_t handle, psa_invec *in_vec, size_t in_len,
-                                         psa_outvec *out_vec, size_t out_len)
+STATIC_DECLARE val_status_t val_ipc_call(psa_handle_t handle,
+                                         int32_t type,
+                                         const psa_invec *in_vec,
+                                         size_t in_len,
+                                         psa_outvec *out_vec,
+                                         size_t out_len)
 {
     psa_status_t call_status = PSA_SUCCESS;
 
-    call_status = psa_call(handle, in_vec, in_len, out_vec, out_len);
+    call_status = psa_call(handle, type, in_vec, in_len, out_vec, out_len);
 
     if (call_status != PSA_SUCCESS)
     {
@@ -212,7 +219,7 @@
 
         if ((msg->type != PSA_IPC_CONNECT) || (msg->handle <= 0))
         {
-            val_print(PRINT_ERROR, "\tpsa_get failed for PSA_IPC_CONNECT\n", 0);
+            val_print(PRINT_ERROR, "\tpsa_get failed for connect message\n", 0);
             res = VAL_STATUS_ERROR;
         }
         else
@@ -248,9 +255,9 @@
             goto wait2;
         }
 
-        if ((msg->type != PSA_IPC_CALL) || (msg->handle <= 0))
+        if ((msg->type < PSA_IPC_CALL) || (msg->handle <= 0))
         {
-            val_print(PRINT_ERROR, "\tpsa_get failed for PSA_IPC_CALL\n", 0);
+            val_print(PRINT_ERROR, "\tpsa_get failed for request message\n", 0);
             res = VAL_STATUS_ERROR;
         }
         else
@@ -288,7 +295,7 @@
 
         if ((msg->type != PSA_IPC_DISCONNECT) || (msg->handle <= 0))
         {
-            val_print(PRINT_ERROR, "\tpsa_get failed for PSA_IPC_DISCONNECT\n", 0);
+            val_print(PRINT_ERROR, "\tpsa_get failed for disconnect massage\n", 0);
             res = VAL_STATUS_ERROR;
         }
         else
@@ -328,12 +335,12 @@
         status = val_execute_secure_test_func(&handle, test_info, SERVER_TEST_DISPATCHER_SID);
         if (VAL_ERROR(status))
         {
-            val_print(PRINT_ERROR,"[Check%d] START\n", i);
+            val_print(PRINT_ERROR, "[Check %d] START\n", i);
             return status;
         }
         else
         {
-            val_print(PRINT_DEBUG,"[Check%d] START\n", i);
+            val_print(PRINT_DEBUG, "[Check %d] START\n", i);
         }
 
         /* Execute client tests */
@@ -345,17 +352,17 @@
         status = test_status ? test_status:status;
         if (IS_TEST_SKIP(status))
         {
-            val_print(PRINT_DEBUG, "[Check%d] SKIPPED\n", i);
+            val_print(PRINT_DEBUG, "[Check %d] SKIPPED\n", i);
             return status;
         }
         if (VAL_ERROR(status))
         {
-            val_print(PRINT_DEBUG,"[Check%d] FAILED\n", i);
+            val_print(PRINT_DEBUG, "[Check %d] FAILED\n", i);
             return status;
         }
         else
         {
-            val_print(PRINT_DEBUG,"[Check%d] PASSED\n", i);
+            val_print(PRINT_DEBUG, "[Check %d] PASSED\n", i);
         }
         i++;
     }
@@ -380,7 +387,7 @@
     val_status_t    status = VAL_STATUS_SUCCESS;
     psa_status_t    status_of_call = PSA_SUCCESS;
 
-    *handle = psa_connect(sid, 0);
+    *handle = psa_connect(sid, 1);
 
     if (*handle < 0)
     {
@@ -392,7 +399,7 @@
                 | ((uint32_t)(TEST_EXECUTE_FUNC) << ACTION_POS));
     psa_invec data[1] = {{&test_data, sizeof(test_data)}};
 
-    status_of_call = psa_call(*handle, data, 1, NULL, 0);
+    status_of_call = psa_call(*handle, 0, data, 1, NULL, 0);
 
     if (status_of_call != PSA_SUCCESS)
     {
@@ -420,7 +427,7 @@
     psa_outvec resp = {&status, sizeof(status)};
     psa_invec data[1] = {{&test_data, sizeof(test_data)}};
 
-    status_of_call = psa_call(*handle, data, 1, &resp, 1);
+    status_of_call = psa_call(*handle, 0, data, 1, &resp, 1);
     if (status_of_call != PSA_SUCCESS)
     {
         status = VAL_STATUS_CALL_FAILED;
@@ -484,20 +491,20 @@
    nvmem_param.size = size;
    psa_invec invec[2] = {{&nvmem_param, sizeof(nvmem_param)}, {buffer, size}};
 
-   handle = psa_connect(DRIVER_NVMEM_SID, 0);
-   if (handle < 0)
+   handle = psa_connect(DRIVER_NVMEM_SID, DRIVER_NVMEM_VERSION);
+   if (PSA_HANDLE_IS_VALID(handle))
    {
-       return VAL_STATUS_CONNECTION_FAILED;
-   }
-   else
-   {
-       status_of_call = psa_call(handle, invec, 2, NULL, 0);
+       status_of_call = psa_call(handle, 0, invec, 2, NULL, 0);
        if (status_of_call != PSA_SUCCESS)
        {
            psa_close(handle);
            return VAL_STATUS_CALL_FAILED;
        }
    }
+   else
+   {
+       return VAL_STATUS_CONNECTION_FAILED;
+   }
    psa_close(handle);
    return VAL_STATUS_SUCCESS;
 }
diff --git a/api-tests/val/spe/val_service_defs.h b/api-tests/val/spe/val_service_defs.h
index b499b5d..4b10804 100644
--- a/api-tests/val/spe/val_service_defs.h
+++ b/api-tests/val/spe/val_service_defs.h
@@ -43,13 +43,13 @@
 typedef struct {
     uint32_t         (*framework_version)     (void);
     uint32_t         (*version)               (uint32_t sid);
-    psa_handle_t     (*connect)               (uint32_t sid, uint32_t minor_version);
+    psa_handle_t     (*connect)               (uint32_t sid, uint32_t version);
     psa_status_t     (*call)                  (psa_handle_t handle,
-                                              const psa_invec *in_vec,
-                                              size_t in_len,
-                                              psa_outvec *out_vec,
-                                              size_t out_len
-                                              );
+                                               int32_t type,
+                                               const psa_invec *in_vec,
+                                               size_t in_len,
+                                               psa_outvec *out_vec,
+                                               size_t out_len);
     void             (*close)                 (psa_handle_t handle);
     psa_signal_t     (*wait)                  (psa_signal_t signal_mask, uint32_t timeout);
     void             (*set_rhandle)           (psa_handle_t msg_handle, void *rhandle);
@@ -65,6 +65,7 @@
     void             (*clear)                 (void);
     void             (*eoi)                   (psa_signal_t irq_signal);
     uint32_t         (*rot_lifecycle_state)   (void);
+    void             (*panic)                 (void);
 } psa_api_t;
 
 typedef struct {
@@ -74,10 +75,14 @@
   val_status_t (*execute_secure_test_func)   (psa_handle_t *handle, test_info_t test_info,
                                               uint32_t sid);
   val_status_t (*get_secure_test_result)     (psa_handle_t *handle);
-  val_status_t (*ipc_connect)                (uint32_t sid, uint32_t minor_version,
+  val_status_t (*ipc_connect)                (uint32_t sid, uint32_t version,
                                               psa_handle_t *handle );
-  val_status_t (*ipc_call)                   (psa_handle_t handle, psa_invec *in_vec,
-                                              size_t in_len,  psa_outvec *out_vec, size_t out_len);
+  val_status_t (*ipc_call)                   (psa_handle_t handle,
+                                              int32_t type,
+                                              const psa_invec *in_vec,
+                                              size_t in_len,
+                                              psa_outvec *out_vec,
+                                              size_t out_len);
   void         (*ipc_close)                  (psa_handle_t handle);
   val_status_t (*set_boot_flag)              (boot_state_t state);
   val_status_t (*target_get_config)          (cfg_id_t cfg_id, uint8_t **data, uint32_t *size);