SPRTL: remove rt_main

rt_main is an unnecessary layer that can be removed. Instead partition
entry point function can be called directly.
This simplifies the code and enables passing a parameter to the thread
using register r0. Previously passing parameter using r0 was impossible
because rt_main used r0.

Change-Id: I5e0d5278867d26bc79b39a8594c3d6ef0eb1e56d
Signed-off-by: Bohdan Hunko <Bohdan.Hunko@infineon.com>
Signed-off-by: Chris Brand <chris.brand@cypress.com>
diff --git a/secure_fw/spm/ffm/backend_ipc.c b/secure_fw/spm/ffm/backend_ipc.c
index 8950e54..94e1bf5 100644
--- a/secure_fw/spm/ffm/backend_ipc.c
+++ b/secure_fw/spm/ffm/backend_ipc.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2021-2023, Arm Limited. All rights reserved.
- * Copyright (c) 2021-2022 Cypress Semiconductor Corporation (an Infineon
+ * Copyright (c) 2021-2023 Cypress Semiconductor Corporation (an Infineon
  * company) or an affiliate of Cypress Semiconductor Corporation. All rights
  * reserved.
  *
@@ -208,13 +208,14 @@
     return PSA_SUCCESS;
 }
 
-extern void sprt_main(void);
+extern void common_sfn_thread(void);
 
 /* Parameters are treated as assuredly */
 void backend_init_comp_assuredly(struct partition_t *p_pt,
                                  uint32_t service_setting)
 {
     const struct partition_load_info_t *p_pldi = p_pt->p_ldinf;
+    thrd_fn_t thrd_entry;
 
 #if CONFIG_TFM_DOORBELL_API == 1
     p_pt->signals_allowed |= PSA_DOORBELL;
@@ -244,8 +245,16 @@
     }
 #endif
 
+    if (IS_PARTITION_IPC_MODEL(p_pldi)) {
+        /* IPC Partition */
+        thrd_entry = POSITION_TO_ENTRY(p_pldi->entry, thrd_fn_t);
+    } else {
+        /* SFN Partition */
+        thrd_entry = POSITION_TO_ENTRY(common_sfn_thread, thrd_fn_t);
+    }
+
     thrd_start(&p_pt->thrd,
-               POSITION_TO_ENTRY(sprt_main, thrd_fn_t),
+               thrd_entry,
                THRD_GENERAL_EXIT);
 }