FIH: Re-enable FIH on AN521

1. Define FIH_RET_TYPE macro to avoid defining a function twice with
   different return types.
2. Rename tfm_fih_implementation to tfm_fih.
3. Change all FIH protected functions into FIH format.
4. Expand stack sizes because SPM needs more stack to call FIH function.
   - S_MSP_STACK_SIZE:           2048 -> 2496
   - TFM_NS_AGENT_TZ_STACK_SIZE: 1024 -> 1256

Signed-off-by: Xinyu Zhang <xinyu.zhang@arm.com>
Change-Id: Ic0136f0232b1e99940fddcbc57e2898516e9d1fc
diff --git a/secure_fw/spm/ffm/interrupt.c b/secure_fw/spm/ffm/interrupt.c
index a873a4f..802657b 100644
--- a/secure_fw/spm/ffm/interrupt.c
+++ b/secure_fw/spm/ffm/interrupt.c
@@ -37,6 +37,7 @@
     struct partition_t *p_curr_sp;
     uintptr_t sp_base, sp_limit, curr_stack, ctx_stack;
     struct context_ctrl_t flih_ctx_ctrl;
+    fih_int fih_rc = FIH_FAILURE;
 
     /* Come too early before runtime setup, should not happen. */
     if (!CURRENT_THREAD) {
@@ -58,8 +59,8 @@
     }
 
     if (p_owner_sp->boundary != p_curr_sp->boundary) {
-        tfm_hal_activate_boundary(p_owner_sp->p_ldinf,
-                                  p_owner_sp->boundary);
+        FIH_CALL(tfm_hal_activate_boundary, fih_rc,
+                 p_owner_sp->p_ldinf, p_owner_sp->boundary);
     }
 
     /*
@@ -85,13 +86,14 @@
                                 struct context_flih_ret_t *p_ctx_flih_ret)
 {
     struct partition_t *p_prev_sp, *p_owner_sp;
+    fih_int fih_rc = FIH_FAILURE;
 
     p_prev_sp = (struct partition_t *)(p_ctx_flih_ret->state_ctx.r2);
     p_owner_sp = GET_CURRENT_COMPONENT();
 
     if (p_owner_sp->boundary != p_prev_sp->boundary) {
-        tfm_hal_activate_boundary(p_prev_sp->p_ldinf,
-                                  p_prev_sp->boundary);
+        FIH_CALL(tfm_hal_activate_boundary, fih_rc,
+                 p_prev_sp->p_ldinf, p_prev_sp->boundary);
     }
 
     /* Restore current component */