Platform: Add hardware version

Hardware version is a globally unique number in EAN-13+5
format identifying the GDSII that went to fabrication,
HW and ROM.

Change-Id: I6619f1f28f7b7a4c926c54248de10d1e3e739e4a
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
diff --git a/platform/include/tfm_plat_device_id.h b/platform/include/tfm_plat_device_id.h
index 350505c..dcce837 100644
--- a/platform/include/tfm_plat_device_id.h
+++ b/platform/include/tfm_plat_device_id.h
@@ -14,6 +14,7 @@
  * attributes of the device:
  *  - Instance ID:       Unique identifier of the device.
  *  - Implementation ID: Original implementation signer of the attestation key.
+ *  - Hardware version:  Identify the GDSII that went to fabrication.
  */
 
 /**
@@ -43,6 +44,15 @@
 #define IMPLEMENTATION_ID_MAX_SIZE (32u)
 
 /**
+ * \def HW_VERSION_MAX_SIZE
+ *
+ * \brief Maximum size of hardware version in bytes
+ *
+ * Recommended to use the European Article Number format: EAN-13+5
+ */
+#define HW_VERSION_MAX_SIZE (18u)
+
+/**
  * \brief Get the UEID of the device.
  *
  * This mandatory claim represents the unique identifier of the instance.
@@ -82,6 +92,24 @@
 enum tfm_plat_err_t tfm_plat_get_implementation_id(uint32_t *size,
                                                    uint8_t  *buf);
 
+/**
+ * \brief Get the hardware version of the device.
+ *
+ * This optional claim provides metadata linking the token to the GDSII that
+ * went to fabrication for this instance. It is represented as CBOR text string.
+ * It is recommended to use for identification the format of the European
+ * Article Number: EAN-13+5.
+ *
+ * \param[in/out] size  As an input value it indicates the size of the caller
+ *                      allocated buffer (in bytes) to store the HW version. At
+ *                      return its value is updated with the exact size of the
+ *                      HW version.
+ * \param[out]    buf   Pointer to the buffer to store the HW version
+ *
+ * \return  Returns error code specified in \ref tfm_plat_err_t
+ */
+enum tfm_plat_err_t tfm_plat_get_hw_version(uint32_t *size, uint8_t *buf);
+
 #ifdef __cplusplus
 }
 #endif