Core: use secure partition context for its init

- set appropriate stack pointer for partition init
- move target-independent init code to TF-M core
- set unprivileged execution for init functions if
  privilege handling is enabled
- fix naming convention bug related to spm_api.h
- fix header reference for partition ids

Change-Id: I56fe20a247ecde20047658d3227ae95257c95e0f
Signed-off-by: Miklos Balint <miklos.balint@arm.com>
diff --git a/secure_fw/spm/spm_api.h b/secure_fw/spm/spm_api.h
index c36288f..5e15044 100644
--- a/secure_fw/spm/spm_api.h
+++ b/secure_fw/spm/spm_api.h
@@ -170,15 +170,15 @@
 void tfm_spm_partition_set_state(uint32_t partition_idx, uint32_t state);
 
 /**
- * \brief Set the caller partition Id for a given partition
+ * \brief Set the caller partition index for a given partition
  *
  * \param[in] partition_idx        Partition index
- * \param[in] caller_partition_id  The Id of the caller partition
+ * \param[in] caller_partition_idx The index of the caller partition
  *
- * \note This function doesn't check if any of the partition_ids is valid.
+ * \note This function doesn't check if any of the partition_idxs are valid.
  */
-void tfm_spm_partition_set_caller_partition_id(uint32_t partition_idx,
-                                           uint32_t caller_partition_id);
+void tfm_spm_partition_set_caller_partition_idx(uint32_t partition_idx,
+                                                uint32_t caller_partition_idx);
 
 /**
  * \brief Set the original PSP value of a partition