Attest: Use macros generated by tools

- Use the SID and service version defined in sid.h.
- Use signal defined in tfm_initial_attestation.h.
- Remove tfm_attest_defs.h and tfm_attest_signal.h.

Change-Id: I36a5be19c8d89ca1e9dfb5978438bb0e66f3cde7
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/interface/include/tfm_attest_defs.h b/interface/include/tfm_attest_defs.h
deleted file mode 100644
index 5cbca7a..0000000
--- a/interface/include/tfm_attest_defs.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_ATTEST_DEFS_H__
-#define __TFM_ATTEST_DEFS_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef TFM_PSA_API
-/*
- * Defines for SID and minor version number. These SIDs must align with the
- * value in service manifest file.
- */
-#define TFM_ATTEST_GET_TOKEN_SID               (0x00000020)
-#define TFM_ATTEST_GET_TOKEN_MINOR_VER         (0x0001)
-#define TFM_ATTEST_GET_TOKEN_SIZE_SID          (0x00000021)
-#define TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER    (0x0001)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __TFM_ATTEST_DEFS_H__ */
\ No newline at end of file
diff --git a/interface/src/tfm_initial_attestation_api.c b/interface/src/tfm_initial_attestation_api.c
index 9d00214..7324b1f 100644
--- a/interface/src/tfm_initial_attestation_api.c
+++ b/interface/src/tfm_initial_attestation_api.c
@@ -10,7 +10,7 @@
 #include "tfm_ns_lock.h"
 #include "psa/client.h"
 #ifdef TFM_PSA_API
-#include "tfm_attest_defs.h"
+#include "psa_manifest/sid.h"
 #endif
 
 #define IOVEC_LEN(x) (sizeof(x)/sizeof(x[0]))
@@ -36,7 +36,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_ATTEST_GET_TOKEN_SID,
-                         TFM_ATTEST_GET_TOKEN_MINOR_VER);
+                         TFM_ATTEST_GET_TOKEN_VERSION);
     if (handle <= 0) {
         return PSA_ATTEST_ERR_GENERAL;
     }
@@ -85,7 +85,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_ATTEST_GET_TOKEN_SIZE_SID,
-                         TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER);
+                         TFM_ATTEST_GET_TOKEN_SIZE_VERSION);
     if (handle <= 0) {
         return PSA_ATTEST_ERR_GENERAL;
     }
diff --git a/secure_fw/services/initial_attestation/tfm_attest_signal.h b/secure_fw/services/initial_attestation/tfm_attest_signal.h
deleted file mode 100644
index 2acd0fd..0000000
--- a/secure_fw/services/initial_attestation/tfm_attest_signal.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Copyright (c) 2019, Arm Limited. All rights reserved.
- *
- * SPDX-License-Identifier: BSD-3-Clause
- *
- */
-
-#ifndef __TFM_ATTEST_SIGNAL_H__
-#define __TFM_ATTEST_SIGNAL_H__
-
-/* FixMe: hardcode it since the tool cannot support now */
-#define PSA_ATTEST_GET_TOKEN_SIG         (1 << (0 + 4))
-#define PSA_ATTEST_GET_TOKEN_SIZE_SIG    (1 << (1 + 4))
-
-#endif /* __TFM_ATTEST_SIGNAL_H__ */
\ No newline at end of file
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
index 97042bd..8036fcf 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_req_mngr.c
@@ -10,7 +10,7 @@
 #include "attestation.h"
 
 #ifdef TFM_PSA_API
-#include "tfm_attest_signal.h"
+#include "psa_manifest/tfm_initial_attestation.h"
 #include "tfm_client.h"
 #include "psa/service.h"
 #include "region_defs.h"
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
index 1e426d7..282698c 100644
--- a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
+++ b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c
@@ -11,7 +11,7 @@
 #include "tfm_client.h"
 #include "tfm_secure_api.h"
 #ifdef TFM_PSA_API
-#include "tfm_attest_defs.h"
+#include "psa_manifest/sid.h"
 #endif
 #include <string.h>
 
@@ -49,7 +49,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_ATTEST_GET_TOKEN_SID,
-                         TFM_ATTEST_GET_TOKEN_MINOR_VER);
+                         TFM_ATTEST_GET_TOKEN_VERSION);
     if (handle <= 0) {
         return PSA_ATTEST_ERR_GENERAL;
     }
@@ -129,7 +129,7 @@
 
 #ifdef TFM_PSA_API
     handle = psa_connect(TFM_ATTEST_GET_TOKEN_SIZE_SID,
-                         TFM_ATTEST_GET_TOKEN_SIZE_MINOR_VER);
+                         TFM_ATTEST_GET_TOKEN_SIZE_VERSION);
     if (handle <= 0) {
         return PSA_ATTEST_ERR_GENERAL;
     }