Tools: Count partition numbers and output config

For implementation runtime model configurations. If there is no
IPC partition, the runtime model can be set as SFN. And the
runtime model is IPC by default.

Generate file 'config_impl.h' to indicate the current runtime
model. This file can be referenced by components like SPM,
partitions and interfaces.

Change-Id: I584ada22446a0da67d15e95d8a64a8700f82c75a
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
diff --git a/interface/include/config_impl.h.template b/interface/include/config_impl.h.template
new file mode 100644
index 0000000..e021242
--- /dev/null
+++ b/interface/include/config_impl.h.template
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+{{utilities.donotedit_warning}}
+
+#ifndef __CONFIG_IMPL_H__
+#define __CONFIG_IMPL_H__
+
+{% if ipc_partition_num > 0 and sfn_partition_num == 0 %}
+#define BACKEND_IPC                 1
+{% elif sfn_partition_num > 0 and ipc_partition_num == 0 %}
+#define BACKEND_SFN                 1
+
+#if TFM_LVL > 1
+#error "High isolation level SFN model is not supported."
+#endif
+
+{% elif sfn_partition_num > 0 and ipc_partition_num > 0 %}
+#error "IPC and SFN co-work not supported yet."
+{% else %}
+#error "Invalid partition number inputted, check configurations."
+{% endif %}
+
+#endif /* __CONFIG_IMPL_H__ */