Build: Create pid.h file

- Create the partition ID header file by tools, which is used for macro
  definitions that map from Secure Partition names to Secure Partition
  IDs.
- The partition ID is added to the "tfm_manifest_list.yaml" manually so
  that the values will keep the same if the build sequence of secure
  partition is changed.
- The "short_name" in "tfm_manifest_list.yaml" should be the same as the
  "name" in the related manifest.

Change-Id: I0955a700e2a0c195f97c38c3ceb29f3b8c237674
Signed-off-by: Edison Ai <edison.ai@arm.com>
diff --git a/interface/include/psa_manifest/pid.h b/interface/include/psa_manifest/pid.h
new file mode 100644
index 0000000..42eeab3
--- /dev/null
+++ b/interface/include/psa_manifest/pid.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+/*********** WARNING: This is an auto-generated file. Do not edit! ***********/
+
+#ifndef __PSA_MANIFEST_PID_H__
+#define __PSA_MANIFEST_PID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define TFM_SP_STORAGE                                                 (256)
+#define TFM_SP_ITS                                                     (257)
+#define TFM_SP_AUDIT_LOG                                               (258)
+#define TFM_SP_CRYPTO                                                  (259)
+#define TFM_SP_PLATFORM                                                (260)
+#define TFM_SP_INITIAL_ATTESTATION                                     (261)
+#define TFM_SP_CORE_TEST                                               (262)
+#define TFM_SP_CORE_TEST_2                                             (263)
+#define TFM_SP_SECURE_TEST_PARTITION                                   (264)
+#define TFM_SP_IPC_SERVICE_TEST                                        (265)
+#define TFM_SP_IPC_CLIENT_TEST                                         (266)
+#define TFM_IRQ_TEST_1                                                 (267)
+
+#define TFM_MAX_USER_PARTITIONS                                        (12)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PSA_MANIFEST_PID_H__ */
diff --git a/interface/include/psa_manifest/pid.h.template b/interface/include/psa_manifest/pid.h.template
new file mode 100644
index 0000000..f5381f6
--- /dev/null
+++ b/interface/include/psa_manifest/pid.h.template
@@ -0,0 +1,31 @@
+/*
+ * Copyright (c) 2019, Arm Limited. All rights reserved.
+ *
+ * SPDX-License-Identifier: BSD-3-Clause
+ *
+ */
+
+{{utilities.donotedit_warning}}
+
+#ifndef __PSA_MANIFEST_PID_H__
+#define __PSA_MANIFEST_PID_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+{% for manifest in manifests %}
+    {% if manifest.attr.pid - 256 < 0 %}
+#error "Partition ID for '{{manifest.manifest.name}}' have to be at least TFM_SP_BASE"
+    {% else %}
+#define {{"%-62s"|format(manifest.manifest.name)}} ({{manifest.attr.pid}})
+    {% endif %}
+{% endfor %}
+
+#define {{"%-62s"|format("TFM_MAX_USER_PARTITIONS")}} ({{manifests | length()}})
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __PSA_MANIFEST_PID_H__ */