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/interface/include/config_impl.h.template b/interface/include/config_impl.h.template
index 2a220ab..0696b91 100644
--- a/interface/include/config_impl.h.template
+++ b/interface/include/config_impl.h.template
@@ -59,4 +59,9 @@
 #error "FP is not supported for SFN model."
 #endif
 
+{% if partition_statistics['connection_based_srv_num'] > 0 %}
+/* Connection-based services exist, include the connection-specific API set. */
+#define {{"%-56s"|format("CONFIG_TFM_CONNECTION_BASED_SERVICE_API")}} 1
+{% endif %}
+
 #endif /* __CONFIG_IMPL_H__ */