SPM: Add runtime SFN backend

A backend for implementing 'SFN'. This runtime backend is selected
if:
- All partitions included in the current build are 'SFN' partitions.
- Isolation level 1.

The configuration is generated by tooling, and output to the
generated file 'config_impl.h'.

Change-Id: I819c78c7a912f86174d102d389a2714ae17e5062
Signed-off-by: Ken Liu <Ken.Liu@arm.com>
Co-authored-by: Mingyang Sun <mingyang.sun@arm.com>
diff --git a/interface/include/config_impl.h.template b/interface/include/config_impl.h.template
index 5af682a..7557d57 100644
--- a/interface/include/config_impl.h.template
+++ b/interface/include/config_impl.h.template
@@ -51,9 +51,14 @@
  * CONFIG_TFM_NS_AGENT_TZ_STK_SIZE_SHIFT_FACTOR for reference, and allow
  * modification of the factor based on application situation. The stack size
  * value is aligned to 8 bytes.
+ * The minimum value is 0x400 to satisfy the SPM functional requirement.
+ * Manifest tool will assure this.
  */
+    {% if total_stk.size|int < 2048 %}
+        {% set total_stk.size = 2048 %}
+    {% endif %}
 #define CONFIG_TFM_NS_AGENT_TZ_STK_SIZE_SHIFT_FACTOR             1
-#define {{"%-56s"|format("CONFIG_TFM_NS_AGENT_TZ_STACK_SIZE")}} \
+#define {{"%-56s"|format("CONFIG_TFM_NS_AGENT_TZ_STACK_SIZE")}}  \
     ((({{"0x%x"|format(total_stk.size)}} >> CONFIG_TFM_NS_AGENT_TZ_STK_SIZE_SHIFT_FACTOR) + 0x7) & (~0x7))
 
 {% elif sfn_partition_num > 0 and ipc_partition_num > 0 %}