Interface: Clean up the tfm_api.h header file

This file does not look like an "interface" file as it contains
some SPM internal usage definitions.

This patch:
- Moves the SPM internal definitions to spm.h.
- Use the error codes in `internal_status_code.h` instead of the
  ones in tfm_api.h.
- Removes error codes in tfm_api.h.
- Renames tfm_api.h to tfm_veneers.h to reflect what it does.
- Corresponding changes in source files.

Change-Id: Iba5d1aae6837c9f0bf52c9a0c456023d19a735ea
Signed-off-by: Kevin Peng <kevin.peng@arm.com>
diff --git a/interface/include/tfm_ns_interface.h b/interface/include/tfm_ns_interface.h
index 6b55fc3..32a04c5 100644
--- a/interface/include/tfm_ns_interface.h
+++ b/interface/include/tfm_ns_interface.h
@@ -14,7 +14,7 @@
 #endif
 
 #include <stdint.h>
-#include "tfm_api.h"
+#include "tfm_veneers.h"
 
 typedef int32_t (*veneer_fn) (uint32_t arg0, uint32_t arg1,
                               uint32_t arg2, uint32_t arg3);
diff --git a/interface/include/tfm_platform_api.h b/interface/include/tfm_platform_api.h
index f7f3972..e925503 100644
--- a/interface/include/tfm_platform_api.h
+++ b/interface/include/tfm_platform_api.h
@@ -11,7 +11,7 @@
 #include <limits.h>
 #include <stdbool.h>
 #include <stdint.h>
-#include "tfm_api.h"
+#include "psa/client.h"
 
 #ifdef __cplusplus
 extern "C" {
diff --git a/interface/include/tfm_api.h b/interface/include/tfm_veneers.h
similarity index 60%
rename from interface/include/tfm_api.h
rename to interface/include/tfm_veneers.h
index 7e79746..24c4036 100644
--- a/interface/include/tfm_api.h
+++ b/interface/include/tfm_veneers.h
@@ -5,59 +5,15 @@
  *
  */
 
-#ifndef __TFM_API_H__
-#define __TFM_API_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
+#ifndef __TFM_VENEERS_H__
+#define __TFM_VENEERS_H__
 
 #include <stdint.h>
 #include "psa/client.h"
 
-#define TFM_INVALID_CLIENT_ID 0
-
-/**
- * \brief Checks if the provided client ID is a secure client ID.
- *
- * \param[in] client_id         Client ID to check.
- *
- * \retval 1                    Client ID is secure.
- * \retval 0                    Client ID is non-secure.
- */
-#define TFM_CLIENT_ID_IS_S(client_id)  ((client_id)>0)
-
-/**
- * \brief Checks if the provided client ID is a non-secure client ID.
- *
- * \param[in] client_id         Client ID to check.
- *
- * \retval 1                    Client ID is non-secure.
- * \retval 0                    Client ID is secure.
- */
-#define TFM_CLIENT_ID_IS_NS(client_id) ((client_id)<0)
-
-/* The mask used for timeout values */
-#define PSA_TIMEOUT_MASK        PSA_BLOCK
-
-/* FixMe: sort out DEBUG compile option and limit return value options
- * on external interfaces */
-enum tfm_status_e
-{
-    TFM_SUCCESS = 0,
-    TFM_PARTITION_BUSY,
-    TFM_ERROR_SECURE_DOMAIN_LOCKED,
-    TFM_ERROR_INVALID_PARAMETER,
-    TFM_ERROR_PARTITION_NON_REENTRANT,
-    TFM_ERROR_NS_THREAD_MODE_CALL,
-    TFM_ERROR_NOT_INITIALIZED,
-    TFM_ERROR_NO_ACTIVE_PARTITION,
-    TFM_ERROR_INVALID_EXC_MODE,
-    TFM_ERROR_NOT_IN_RANGE,
-    TFM_SECURE_LOCK_FAILED,
-    TFM_SECURE_UNLOCK_FAILED,
-    TFM_ERROR_GENERIC = 0x1F,
-};
+#ifdef __cplusplus
+extern "C" {
+#endif
 
 /********************* Secure function declarations ***************************/
 
@@ -116,4 +72,4 @@
 }
 #endif
 
-#endif /* __TFM_API_H__ */
+#endif /* __TFM_VENEERS_H__ */
diff --git a/interface/src/multi_core/tfm_multi_core_psa_ns_api.c b/interface/src/multi_core/tfm_multi_core_psa_ns_api.c
index 2d25d09..d02e3a4 100644
--- a/interface/src/multi_core/tfm_multi_core_psa_ns_api.c
+++ b/interface/src/multi_core/tfm_multi_core_psa_ns_api.c
@@ -12,7 +12,6 @@
 
 #include "psa/client.h"
 #include "psa/error.h"
-#include "tfm_api.h"
 #include "tfm_ns_mailbox.h"
 
 /*
diff --git a/interface/src/tfm_fwu_api.c b/interface/src/tfm_fwu_api.c
index f7565bf..80c4778 100644
--- a/interface/src/tfm_fwu_api.c
+++ b/interface/src/tfm_fwu_api.c
@@ -8,7 +8,6 @@
 #include "psa/client.h"
 #include "psa/update.h"
 #include "psa_manifest/sid.h"
-#include "tfm_api.h"
 
 psa_status_t psa_fwu_start(psa_fwu_component_t component,
                            const void *manifest,
diff --git a/interface/src/tfm_its_api.c b/interface/src/tfm_its_api.c
index a52197b..adea920 100644
--- a/interface/src/tfm_its_api.c
+++ b/interface/src/tfm_its_api.c
@@ -8,7 +8,6 @@
 #include "psa/client.h"
 #include "psa/internal_trusted_storage.h"
 #include "psa_manifest/sid.h"
-#include "tfm_api.h"
 #include "tfm_its_defs.h"
 
 psa_status_t psa_its_set(psa_storage_uid_t uid,
diff --git a/interface/src/tfm_platform_api.c b/interface/src/tfm_platform_api.c
index d709607..4fc564b 100644
--- a/interface/src/tfm_platform_api.c
+++ b/interface/src/tfm_platform_api.c
@@ -7,6 +7,7 @@
 
 #include <stdbool.h>
 #include "tfm_platform_api.h"
+#include "psa/client.h"
 #include "psa_manifest/sid.h"
 
 enum tfm_platform_err_t tfm_platform_system_reset(void)
diff --git a/interface/src/tfm_psa_ns_api.c b/interface/src/tfm_psa_ns_api.c
index 819c72b..1f9fbe4 100644
--- a/interface/src/tfm_psa_ns_api.c
+++ b/interface/src/tfm_psa_ns_api.c
@@ -7,7 +7,6 @@
 
 #include "psa/client.h"
 #include "tfm_ns_interface.h"
-#include "tfm_api.h"
 #include "tfm_psa_call_pack.h"
 
 /**** API functions ****/