Mistake on this page?
Report an issue in GitHub or email us
lifecycle.h
Go to the documentation of this file.
1 /* Copyright (c) 2018 ARM Limited
2  *
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __LIFECYCLE_H__
19 #define __LIFECYCLE_H__
20 
21 /** @file
22 @brief This file describes the PSA RoT Lifecycle API
23 */
24 
25 #include <stddef.h>
26 #include <stdint.h>
27 #include "mbed_toolchain.h"
28 #include "psa/error.h"
29 
30 #ifdef __cplusplus
31 extern "C"
32 {
33 #endif
34 
35 #define PSA_LIFECYCLE_STATE_MASK (0xff00u) /**< A mask value that extracts the main lifecycle state */
36 #define PSA_LIFECYCLE_SUBSTATE_MASK (0x00ffu) /**< A mask value that extracts the IMPLEMENTATION DEFINED lifecycle sub-state */
37 
38 #define PSA_LIFECYCLE_UNKNOWN (0x0000u) /**< State is unknown */
39 #define PSA_LIFECYCLE_ASSEMBLY_AND_TEST (0x1000u) /**< Assembly and Test state */
40 #define PSA_LIFECYCLE_PSA_ROT_PROVISIONING (0x2000u) /**< PSA RoT Provisioning state */
41 #define PSA_LIFECYCLE_SECURED (0x3000u) /**< Secured state */
42 #define PSA_LIFECYCLE_NON_PSA_ROT_DEBUG (0x4000u) /**< Non PSA RoT debug state */
43 #define PSA_LIFECYCLE_RECOVERABLE_PSA_ROT_DEBUG (0x5000u) /**< Recoverable PSA RoT Debug state */
44 #define PSA_LIFECYCLE_DECOMMISSIONED (0x6000u) /**< Decommissioned state */
45 
46 /** \brief Get PSA RoT lifecycle state
47  *
48  * \retval The main state and sub-state are encoded as follows:@n
49  @a version[15:8] – main lifecycle state
50  @a version[7:0] – IMPLEMENTATION DEFINED sub-state
51  */
52 uint32_t psa_security_lifecycle_state(void);
53 
54 /** \brief Request state change
55  *
56  * State change requested and the reset the system.
57  * \note System reset will not be performed when switching from PSA_LIFECYCLE_ASSEMBLY_AND_TEST
58  * to PSA_LIFECYCLE_ASSEMBLY_AND_TEST.
59  *
60  * \note state change to follwing states will delete PSA internal storage:
61  * - PSA_LIFECYCLE_ASSEMBLY_AND_TEST
62  * - PSA_LIFECYCLE_PSA_ROT_PROVISIONING
63  * - PSA_LIFECYCLE_DECOMMISSIONED
64  */
66 
67 
68 /** \brief Resets the system
69  *
70  * PSA targets do not allow NSPE to access system power domain.
71  * This API requests system reset to be carried out by SPE once all critical secure tasks are finished.
72  */
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif // __LIFECYCLE_H__
MBED_NORETURN void mbed_psa_system_reset()
Resets the system.
uint32_t psa_security_lifecycle_state(void)
Get PSA RoT lifecycle state.
psa_status_t mbed_psa_reboot_and_request_new_security_state(uint32_t new_state)
Request state change.
#define MBED_NORETURN
MBED_NORETURN Declare a function that will never return.
int32_t psa_status_t
Function return status.
Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.