Core: Enhance manifest to align with PSA

Below enhancements need to be applied to follow PSA:
- IPC related parameters added in manifest file (such as signal, sid,
  minor_version and minor_policy).
- IPC service partition manifest file added to generate secure partion
  source.
- Remove "tfm_partition_name" from manifest file and use "name"
  directly.
- Remove IPC unused template: tfm_sfid_list.inc.template
Note:
- Signal header also need to be added manually by hardcode for tool
  cannot support it now.

Change-Id: I47c2c4058e99a0b278c7b05b1e8d80058bc185a1
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
index 157f051..8621318 100644
--- a/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
+++ b/test/suites/ipc/non_secure/ipc_ns_interface_testsuite.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018, Arm Limited. All rights reserved.
+ * Copyright (c) 2018-2019, Arm Limited. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  *
@@ -10,7 +10,7 @@
 #include "psa_client.h"
 #include "test/framework/test_framework_helpers.h"
 
-#define IPC_TEST_SERVICE1_SID        (01)
+#define IPC_TEST_SERVICE1_SID        (0x1000)
 #define IPC_TEST_SERVICE1_MIN_VER    (0x0001)
 
 /* List of tests */
diff --git a/test/test_services/CMakeLists.inc b/test/test_services/CMakeLists.inc
index 5ac6602..6376e69 100644
--- a/test/test_services/CMakeLists.inc
+++ b/test/test_services/CMakeLists.inc
@@ -65,8 +65,8 @@
 if (NOT DEFINED CORE_TEST_IPC)
 	message(FATAL_ERROR "Incomplete build configuration: CORE_TEST_IPC is undefined. ")
 elseif (CORE_TEST_IPC)
-	list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_ipc_service/ipc_service_test.c"
-		"${CORE_TEST_DIR}/tfm_ipc_client/ipc_client_test.c"
+	list(APPEND ALL_SRC_C_S "${CORE_TEST_DIR}/tfm_ipc_service/tfm_ipc_service_test.c"
+		"${CORE_TEST_DIR}/tfm_ipc_client/tfm_ipc_client_test.c"
 		)
 endif()
 
diff --git a/test/test_services/tfm_core_test/manifest.yaml b/test/test_services/tfm_core_test/manifest.yaml
index 076b650..58abfe1 100644
--- a/test/test_services/tfm_core_test/manifest.yaml
+++ b/test/test_services/tfm_core_test/manifest.yaml
@@ -1,17 +1,16 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
 
 {
-  "name": "TFM_CORE_TEST",
-  "tfm_partition_name": "TFM_SP_CORE_TEST",
-  "type": "SECURE",
+  "name": "TFM_SP_CORE_TEST",
+  "type": "APPLICATION-ROT",
   "priority": "NORMAL",
   "id": "0x00000002",
-  "entry_point": "main",
+  "entry_point": "core_test_init",
   "stack_size": "0x0400",
   "heap_size": "0x0400",
   "mmio_regions": [
@@ -20,7 +19,6 @@
       "permission": "READ-WRITE"
     }
   ],
-  "tfm_init_symbol": "core_test_init",
   "secure_functions": [
     {
       "sfid": "TFM_CORE_TEST_SFN_SFID",
diff --git a/test/test_services/tfm_core_test_2/manifest.yaml b/test/test_services/tfm_core_test_2/manifest.yaml
index 77cc5db..4d2b963 100644
--- a/test/test_services/tfm_core_test_2/manifest.yaml
+++ b/test/test_services/tfm_core_test_2/manifest.yaml
@@ -1,20 +1,18 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
 
 {
-  "name": "TFM_CORE_TEST_2",
-  "tfm_partition_name": "TFM_SP_CORE_TEST_2",
-  "type": "SECURE",
+  "name": "TFM_SP_CORE_TEST_2",
+  "type": "APPLICATION-ROT",
   "priority": "NORMAL",
   "id": "0x00000003",
-  "entry_point": "main",
+  "entry_point": "core_test_2_init",
   "stack_size": "0x0400",
   "heap_size": "0x0400",
-  "tfm_init_symbol": "core_test_2_init",
   "secure_functions": [
     {
       "sfid": "TFM_CORE_TEST_2_SFN_SLAVE_SERVICE_SFID",
diff --git a/test/test_services/tfm_ipc_client/manifest.yaml b/test/test_services/tfm_ipc_client/tfm_ipc_client_partition.yaml
similarity index 72%
rename from test/test_services/tfm_ipc_client/manifest.yaml
rename to test/test_services/tfm_ipc_client/tfm_ipc_client_partition.yaml
index 8c8ccdb..75546b3 100644
--- a/test/test_services/tfm_ipc_client/manifest.yaml
+++ b/test/test_services/tfm_ipc_client/tfm_ipc_client_partition.yaml
@@ -6,15 +6,14 @@
 #-------------------------------------------------------------------------------
 
 {
-  "name": "IPC_CLIENT",
-  "type": "SECURE",
-  "tfm_partition_name": "TFM_SP_IPC_CLIENT_TEST",
+  "name": "TFM_SP_IPC_CLIENT_TEST",
+  "type": "APPLICATION-ROT",
   "priority": "NORMAL",
   "id": "0x00000006",
-  "entry_point": "main",
+  "entry_point": "ipc_client_init",
   "stack_size": "0x1000",
-  "heap_size": "0x0400",
-  "tfm_init_symbol": "ipc_client_init",
+  "heap_size": "0",
+  "tfm_partition_ipc": true,
   "source_files": [
     "ipc_client_test.c",
   ],
diff --git a/test/test_services/tfm_ipc_client/ipc_client_test.c b/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
similarity index 89%
rename from test/test_services/tfm_ipc_client/ipc_client_test.c
rename to test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
index 6c449eb..f343a04 100644
--- a/test/test_services/tfm_ipc_client/ipc_client_test.c
+++ b/test/test_services/tfm_ipc_client/tfm_ipc_client_test.c
@@ -9,11 +9,8 @@
 #include "psa_client.h"
 #include "secure_utilities.h"
 
-/*
- * FixMe: These SID should come from manifest.
- * Temporarily adds them here for test.
- */
-#define IPC_TEST_SERVICE1_SID        (01)
+/* These SID should be same with service manifest.*/
+#define IPC_TEST_SERVICE1_SID        (0x1000)
 #define IPC_TEST_SERVICE1_MIN_VER    (0x0001)
 
 int ipc_client_init(void)
diff --git a/test/test_services/tfm_ipc_service/manifest.yaml b/test/test_services/tfm_ipc_service/manifest.yaml
deleted file mode 100644
index 8594f04..0000000
--- a/test/test_services/tfm_ipc_service/manifest.yaml
+++ /dev/null
@@ -1,36 +0,0 @@
-#-------------------------------------------------------------------------------
-# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
-#
-# SPDX-License-Identifier: BSD-3-Clause
-#
-#-------------------------------------------------------------------------------
-
-{
-  "name": "IPC_SERVICE_TEST",
-  "tfm_partition_name": "TFM_SP_IPC_SERVICE_TEST",
-  "type": "SECURE", "IPC",
-  "priority": "NORMAL",
-  "id": "0x00000007",
-  "entry_point": "main",
-  "stack_size": "0x1000",
-  "heap_size": "0x0400",
-  "tfm_init_symbol": "ipc_service_test_main",
-  "secure_functions": [
-    {
-      "sfid": "IPC_SERVICE_CALL_SFID",
-      "signal": "IPC_SERVICE_CALL",
-      "tfm_symbol": "ipc_service_call",
-      "non_secure_clients": true,
-      "minor_version": 1,
-      "minor_policy": "strict"
-    }
-  ],
-  "source_files": [
-    "./ipc_service_test.c",
-  ],
-  "tfm_linker_pattern": {
-    "library_list": [
-      "*ipc_service_test*"
-    ]
-  }
-}
diff --git a/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h b/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h
new file mode 100644
index 0000000..759ccfa
--- /dev/null
+++ b/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.h
@@ -0,0 +1,16 @@
+/*
+ * Copyright (c) 2018, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __TFM_IPC_SERVICE_PARTITION_H__
+#define __TFM_IPC_SERVICE_PARTITION_H__
+
+/* FixMe: hardcode it for the tool cannot support now */
+#ifdef TFM_PSA_API
+#define IPC_BASIC_SIGNAL (1 << (0 + 4))
+#endif /* TFM_PSA_API */
+
+#endif /* __TFM_IPC_SERVICE_PARTITION_H__ */
diff --git a/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.yaml b/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.yaml
new file mode 100644
index 0000000..7d17589
--- /dev/null
+++ b/test/test_services/tfm_ipc_service/tfm_ipc_service_partition.yaml
@@ -0,0 +1,34 @@
+#-------------------------------------------------------------------------------
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-3-Clause
+#
+#-------------------------------------------------------------------------------
+
+{
+  "name": "TFM_SP_IPC_SERVICE_TEST",
+  "type": "APPLICATION-ROT",
+  "priority": "HIGH",
+  "id": "0x00000007",
+  "entry_point": "ipc_service_test_main",
+  "stack_size": "0x1000",
+  "heap_size": "0",
+  "tfm_partition_ipc": true,
+  "services" : [{
+    "name": "IPC_SID_BASIC",
+    "sid": "0x00001000",
+    "signal": "IPC_BASIC_SIGNAL",
+    "non_secure_clients": "true",
+    "minor_version": 1,
+    "minor_policy": "STRICT"
+   }
+  ],
+  "source_files": [
+    "./ipc_service_test.c",
+  ],
+  "tfm_linker_pattern": {
+    "library_list": [
+      "*ipc_service_test*"
+    ]
+  }
+}
diff --git a/test/test_services/tfm_ipc_service/ipc_service_test.c b/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
similarity index 97%
rename from test/test_services/tfm_ipc_service/ipc_service_test.c
rename to test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
index 279d1b1..e8f25a8 100644
--- a/test/test_services/tfm_ipc_service/ipc_service_test.c
+++ b/test/test_services/tfm_ipc_service/tfm_ipc_service_test.c
@@ -12,9 +12,9 @@
 #include "secure_fw/core/secure_utilities.h"
 #include "secure_fw/core/tfm_secure_api.h"
 #include "tfm_api.h"
+#include "tfm_ipc_service_partition.h"
 
 #define IPC_SERVICE_BUFFER_LEN 64
-#define IPC_BASIC_SIGNAL 1
 
 static int inuse = 0;
 
diff --git a/test/test_services/tfm_secure_client_service/manifest.yaml b/test/test_services/tfm_secure_client_service/manifest.yaml
index 9ab5b62..79728ee 100644
--- a/test/test_services/tfm_secure_client_service/manifest.yaml
+++ b/test/test_services/tfm_secure_client_service/manifest.yaml
@@ -1,18 +1,16 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
 
 {
-  "name": "TFM_SECURE_CLIENT",
-  "tfm_partition_name": "TFM_SP_SECURE_TEST_PARTITION",
-  "type": "TRUSTED",
-  "tfm_trusted": true,
+  "name": "TFM_SP_SECURE_TEST_PARTITION",
+  "type": "PSA-ROT",
   "priority": "NORMAL",
   "id": "0x00000005",
-  "entry_point": "main",
+  "entry_point": "tfm_secure_client_service_init",
   "stack_size": "0x1000",
   "heap_size": "0x0400",
   "mmio_regions": [
@@ -21,7 +19,6 @@
       "permission": "READ-WRITE"
     }
   ],
-  "tfm_init_symbol": "tfm_secure_client_service_init",
   "secure_functions": [
     {
       "sfid": "TFM_SECURE_CLIENT_SFN_RUN_TESTS_SFID",
diff --git a/test/test_services/tfm_sst_test_service/manifest.yaml b/test/test_services/tfm_sst_test_service/manifest.yaml
index e6b26b0..ce83dad 100644
--- a/test/test_services/tfm_sst_test_service/manifest.yaml
+++ b/test/test_services/tfm_sst_test_service/manifest.yaml
@@ -1,21 +1,18 @@
 #-------------------------------------------------------------------------------
-# Copyright (c) 2018, Arm Limited. All rights reserved.
+# Copyright (c) 2018-2019, Arm Limited. All rights reserved.
 #
 # SPDX-License-Identifier: BSD-3-Clause
 #
 #-------------------------------------------------------------------------------
 
 {
-  "name": "TFM_SST_TEST",
-  "tfm_partition_name": "TFM_SP_SST_TEST_PARTITION",
-  "type": "TRUSTED",
-  "tfm_trusted": true,
+  "name": "TFM_SP_SST_TEST_PARTITION",
+  "type": "PSA-ROT",
   "priority": "NORMAL",
   "id": "0x00000004",
-  "entry_point": "main",
+  "entry_point": "sst_test_service_init",
   "stack_size": "0x0400",
   "heap_size": "0x0400",
-  "tfm_init_symbol": "sst_test_service_init",
   "secure_functions": [
     {
       "sfid": "TFM_SST_TEST_SFN_SETUP_SFID",