SPM: Add build config for FF-M interrupt APIs

Add configs of optionally building FF-M interrupt APIs. Build:
- psa_irq_enable() and psa_irq_disable() for either FLIH or
  SLIH enabled.
- psa_reset_signal() for FLIH enabled.
- psa_eoi() for SLIH enabled.

Signed-off-by: Mingyang Sun <mingyang.sun@arm.com>
Change-Id: I0822f96c1e827181edf34a409b357b7e81485dc4
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index 32b06dd..63cda08 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -145,7 +145,9 @@
     partition_statistics = {
         'connection_based_srv_num': 0,
         'ipc_partition_num': 0,
-        'sfn_partition_num': 0
+        'sfn_partition_num': 0,
+        'flih_num': 0,
+        'slih_num': 0
     }
     config_impl = {
         'CONFIG_TFM_SPM_BACKEND_SFN'              : '0',
@@ -153,7 +155,9 @@
         'CONFIG_TFM_PSA_API_SFN_CALL'             : '0',
         'CONFIG_TFM_PSA_API_CROSS_CALL'           : '0',
         'CONFIG_TFM_PSA_API_SUPERVISOR_CALL'      : '0',
-        'CONFIG_TFM_CONNECTION_BASED_SERVICE_API' : '0'
+        'CONFIG_TFM_CONNECTION_BASED_SERVICE_API' : '0',
+        'CONFIG_TFM_FLIH_API'                     : '0',
+        'CONFIG_TFM_SLIH_API'                     : '0'
     }
 
     # Get all the manifests information as a dictionary
@@ -234,6 +238,12 @@
             elif service['connection_based']:
                 partition_statistics['connection_based_srv_num'] += 1
 
+        for irq in manifest.get('irqs', []):
+            if irq.get('handling', None) == 'FLIH':
+                partition_statistics['flih_num'] += 1
+            else:
+                partition_statistics['slih_num'] += 1
+
         manifest_out_basename = os.path.splitext(os.path.basename(manifest_path))[0]
 
         if 'output_path' in manifest_item:
@@ -290,6 +300,11 @@
     if partition_statistics['connection_based_srv_num'] > 0:
         config_impl['CONFIG_TFM_CONNECTION_BASED_SERVICE_API'] = 1
 
+    if partition_statistics['flih_num'] > 0:
+        config_impl['CONFIG_TFM_FLIH_API'] = 1
+    elif partition_statistics['slih_num'] > 0:
+        config_impl['CONFIG_TFM_SLIH_API'] = 1
+
     context['partitions'] = partition_list
     context['config_impl'] = config_impl
     context['stateless_services'] = process_stateless_services(partition_list)