SPM: Add build-time config for optional PSA APIs

When there is no connection-based service,
the following PSA APIs are optional:
    - psa_connect
    - psa_close
    - psa_set_rhandle
Currently, they are always built, linked and not removed
because the SVC handler references them.
This patch adds a config CONFIG_TFM_CONNECTION_BASED_SERVICE_API
so that they can be excluded and save memory footprints.

Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: I0205ca6a569d375fb1879ab673470a4b2a7a7c01
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index 3a6bd71..b359f15 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -142,6 +142,7 @@
     pid_list = []
     no_pid_manifest_idx = []
     partition_statistics = {
+        'connection_based_srv_num': 0,
         'ipc_partition_num': 0,
         'sfn_partition_num': 0
     }
@@ -218,6 +219,12 @@
             else:
                 partition_statistics['ipc_partition_num'] += 1
 
+        for service in manifest.get('services', []):
+            if 'connection_based' not in service.keys():
+                partition_statistics['connection_based_srv_num'] += 1
+            elif service['connection_based']:
+                partition_statistics['connection_based_srv_num'] += 1
+
         manifest_out_basename = os.path.splitext(os.path.basename(manifest_path))[0]
 
         if 'output_path' in manifest_item:
@@ -250,7 +257,6 @@
 
     context['partitions'] = partition_list
     context['partition_statistics'] = partition_statistics
-
     context['stateless_services'] = process_stateless_services(partition_list)
 
     return context