Tamas Ban | 38e1731 | 2018-11-22 15:26:35 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2018, Arm Limited. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | * |
| 6 | */ |
| 7 | |
| 8 | #ifndef __TFM_PLAT_DEVICE_ID_H__ |
| 9 | #define __TFM_PLAT_DEVICE_ID_H__ |
| 10 | /** |
| 11 | * \file tfm_plat_device_id.h |
| 12 | * Provide the Universal Entity ID (UEID) of the device. |
| 13 | * It identifies the entire device or a submodule or subsystem. Must be |
| 14 | * universally and globally unique and immutable. Variable length with a |
| 15 | * maximum size of 33 bytes: 1 type byte and 256 bits. |
| 16 | */ |
| 17 | |
| 18 | /** |
| 19 | * \note The interfaces defined in this file must be implemented for each |
| 20 | * SoC. |
| 21 | */ |
| 22 | |
| 23 | #include <stdint.h> |
| 24 | #include "tfm_plat_defs.h" |
| 25 | |
| 26 | #ifdef __cplusplus |
| 27 | extern "C" { |
| 28 | #endif |
| 29 | |
| 30 | /** |
| 31 | * \def DEVICE_ID_MAX_SIZE |
| 32 | * |
| 33 | * \brief Maximum size of device ID in bytes |
| 34 | */ |
| 35 | #define DEVICE_ID_MAX_SIZE (33u) |
| 36 | |
| 37 | /** |
| 38 | * \brief Get the UEID of the device. |
| 39 | * |
| 40 | * \param[in] size The size of the buffer in bytes to store the UEID |
| 41 | * \param[out] buf Pointer to the buffer to store the UEID |
| 42 | * |
| 43 | * \return The size of device ID in bytes, if buffer big enough to store the |
| 44 | * ID, otherwise -1. |
| 45 | */ |
| 46 | int32_t tfm_plat_get_device_id(uint32_t size, uint8_t *buf); |
| 47 | |
| 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | #endif /* __TFM_PLAT_DEVICE_ID_H__ */ |