1 /*
2  * Copyright (c) 2020, Arm Limited. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __PSA_LIFECYCLE_H__
9 #define __PSA_LIFECYCLE_H__
10 
11 #include "psa_config.h"
12 
13 #ifdef __cplusplus
14 extern "C" {
15 #endif
16 
17 #define PSA_LIFECYCLE_PSA_STATE_MASK            (0xff00u)
18 #define PSA_LIFECYCLE_IMP_STATE_MASK            (0x00ffu)
19 #define PSA_LIFECYCLE_UNKNOWN                   (0x0000u)
20 #define PSA_LIFECYCLE_ASSEMBLY_AND_TEST         (0x1000u)
21 #define PSA_LIFECYCLE_PSA_ROT_PROVISIONING      (0x2000u)
22 #define PSA_LIFECYCLE_SECURED                   (0x3000u)
23 #define PSA_LIFECYCLE_NON_PSA_ROT_DEBUG         (0x4000u)
24 #define PSA_LIFECYCLE_RECOVERABLE_PSA_ROT_DEBUG (0x5000u)
25 #define PSA_LIFECYCLE_DECOMMISSIONED            (0x6000u)
26 
27 /*
28  * \brief This function retrieves the current PSA RoT lifecycle state.
29  *
30  * \return state                The current security lifecycle state of the PSA
31  *                              RoT. The PSA state and implementation state are
32  *                              encoded as follows:
33  * \arg                           state[15:8] – PSA lifecycle state
34  * \arg                           state[7:0] – IMPLEMENTATION DEFINED state
35  */
36 uint32_t psa_rot_lifecycle_state(void);
37 
38 #ifdef __cplusplus
39 }
40 #endif
41 
42 #endif /* __PSA_LIFECYCLE_H__ */
43