SPM: Depreciate vague header 'tfm_internal.h'

The name of this file is vague. Depreciate it by:
 - Remove tfm_internal.h
 - Move function model architecture code into a new create arch.h
 - Create tfm_boot_data.h and put boot related function declaration
   in it

Change-Id: Ia2ad1b0f95c1137624f99a4e81807bedf9086857
Signed-off-by: Summer Qin <summer.qin@arm.com>
diff --git a/secure_fw/spm/cmsis_func/CMakeLists.inc b/secure_fw/spm/cmsis_func/CMakeLists.inc
index 2a43547..5555d61 100644
--- a/secure_fw/spm/cmsis_func/CMakeLists.inc
+++ b/secure_fw/spm/cmsis_func/CMakeLists.inc
@@ -52,6 +52,7 @@
 unset(SFW_FUNC_SPM_SRC)
 
 #Setting include directories
+embedded_include_directories(PATH ${SFW_SPM_DIR} ABSOLUTE)
 embedded_include_directories(PATH ${SFW_FUNC_SPM_DIR} ABSOLUTE)
 embedded_include_directories(PATH ${SFW_FUNC_SPM_DIR}/include ABSOLUTE)
 embedded_include_directories(PATH ${TFM_ROOT_DIR}/interface/include ABSOLUTE)
diff --git a/secure_fw/spm/cmsis_func/arch.c b/secure_fw/spm/cmsis_func/arch.c
index d142e84..d5d0310 100644
--- a/secure_fw/spm/cmsis_func/arch.c
+++ b/secure_fw/spm/cmsis_func/arch.c
@@ -5,8 +5,8 @@
  *
  */
 
+#include "arch.h"
 #include "tfm_secure_api.h"
-#include "tfm_internal.h"
 #include "tfm/tfm_spm_services.h"
 
 nsfptr_t ns_entry;
diff --git a/secure_fw/spm/cmsis_func/arch.h b/secure_fw/spm/cmsis_func/arch.h
new file mode 100644
index 0000000..964ddf7
--- /dev/null
+++ b/secure_fw/spm/cmsis_func/arch.h
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2020, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+#ifndef __ARCH_H__
+#define __ARCH_H__
+
+/*
+ * This function pointer is meant to only hold non secure function pointers.
+ * It will be turned into a non-secure one (LSB cleared) before being called
+ * whatever happens anyway (unless cast to another function pointer type).
+ * Registers will be cleared before branching so that no information leaks
+ * from secure to non-secure world.
+ */
+typedef void (*nsfptr_t) (void) __attribute__((cmse_nonsecure_call));
+
+extern nsfptr_t ns_entry;
+
+/**
+ * \brief  Jump to non-secure code.
+ */
+void jump_to_ns_code(void);
+
+#endif /* __ARCH_H__ */
diff --git a/secure_fw/spm/cmsis_func/main.c b/secure_fw/spm/cmsis_func/main.c
index e070515..e785587 100644
--- a/secure_fw/spm/cmsis_func/main.c
+++ b/secure_fw/spm/cmsis_func/main.c
@@ -5,11 +5,12 @@
  *
  */
 
+#include "arch.h"
+#include "common/tfm_boot_data.h"
 #include "log/tfm_log.h"
 #include "region.h"
 #include "spm_func.h"
 #include "tfm_hal_platform.h"
-#include "tfm_internal.h"
 #include "tfm_irq_list.h"
 #include "tfm_nspm.h"
 #include "tfm_spm_hal.h"
diff --git a/secure_fw/spm/cmsis_func/tfm_core_svcalls_func.c b/secure_fw/spm/cmsis_func/tfm_core_svcalls_func.c
index 98d776b..e7fb2db 100644
--- a/secure_fw/spm/cmsis_func/tfm_core_svcalls_func.c
+++ b/secure_fw/spm/cmsis_func/tfm_core_svcalls_func.c
@@ -13,11 +13,11 @@
 #include "spm_func.h"
 #include "spm_partition_defs.h"
 #include "tfm_api.h"
-#include "tfm_internal.h"
 #include "tfm_memory_utils.h"
 #include "tfm_arch.h"
 #include "tfm_peripherals_def.h"
 #include "tfm_irq_list.h"
+#include "common/tfm_boot_data.h"
 
 #ifdef PLATFORM_SVC_HANDLERS
 extern int32_t platform_svc_handlers(tfm_svc_number_t svc_num,
diff --git a/secure_fw/spm/cmsis_func/tfm_nspm_func.c b/secure_fw/spm/cmsis_func/tfm_nspm_func.c
index 73eca4c..ad4a17e 100644
--- a/secure_fw/spm/cmsis_func/tfm_nspm_func.c
+++ b/secure_fw/spm/cmsis_func/tfm_nspm_func.c
@@ -11,9 +11,9 @@
 #include "tfm_spm_hal.h"
 #include "tfm_arch.h"
 #include "tfm_api.h"
-#include "tfm_internal.h"
 #include "tfm_nspm.h"
 #include "ext/tz_context.h"
+#include "arch.h"
 
 #ifndef TFM_MAX_NS_THREAD_COUNT
 #define TFM_MAX_NS_THREAD_COUNT 8