1 /*
2  * Copyright (c) 2021, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __TFM_PLAT_PROVISIONING_H__
9 #define __TFM_PLAT_PROVISIONING_H__
10 
11 #include "tfm_plat_defs.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 /**
18  * \brief                               Check the contents of OTP memory for the
19  *                                      presence of keys provisioned by
20  *                                      TFM_DUMMY_PROVISIONING
21  *
22  * \note                                This function should print a warning to
23  *                                      the UART, or otherwise notify the device
24  *                                      user, if dummy keys are detected.
25  */
26 void tfm_plat_provisioning_check_for_dummy_keys(void);
27 
28 /**
29  * \brief                               Check if a provisioning operation is
30  *                                      required.
31  *
32  * \retval 1                            A provisioning operation is required.
33  * \retval 0                            A provisioning operation is not
34  *                                      required.
35  */
36 int tfm_plat_provisioning_is_required(void);
37 
38 /**
39  * \brief                               Performs a provisioning operation.
40  *
41  * \retval TFM_PLAT_ERR_SUCCESS         The provisioning operation completed
42  *                                      successfully.
43  * \retval TFM_PLAT_ERR_INVALID_INPUT   The provisioning data that was input to
44  *                                      the device is invalid
45  * \retval TFM_PLAT_ERR_SYSTEM_ERR      An unspecified error occurred.
46  */
47 enum tfm_plat_err_t tfm_plat_provisioning_perform(void);
48 
49 #ifdef __cplusplus
50 }
51 #endif
52 
53 #endif /* __TFM_PLAT_PROVISIONING_H__ */
54