Mbed OS Reference
Loading...
Searching...
No Matches
lifecycle.h File Reference

This file describes the PSA RoT Lifecycle API. More...

#include <stddef.h>
#include <stdint.h>
#include "mbed_toolchain.h"
#include "psa/error.h"

Go to the source code of this file.

Macros

#define PSA_LIFECYCLE_STATE_MASK   (0xff00u)
 A mask value that extracts the main lifecycle state. More...
 
#define PSA_LIFECYCLE_SUBSTATE_MASK   (0x00ffu)
 A mask value that extracts the IMPLEMENTATION DEFINED lifecycle sub-state. More...
 
#define PSA_LIFECYCLE_UNKNOWN   (0x0000u)
 State is unknown. More...
 
#define PSA_LIFECYCLE_ASSEMBLY_AND_TEST   (0x1000u)
 Assembly and Test state. More...
 
#define PSA_LIFECYCLE_PSA_ROT_PROVISIONING   (0x2000u)
 PSA RoT Provisioning state. More...
 
#define PSA_LIFECYCLE_SECURED   (0x3000u)
 Secured state. More...
 
#define PSA_LIFECYCLE_NON_PSA_ROT_DEBUG   (0x4000u)
 Non PSA RoT debug state. More...
 
#define PSA_LIFECYCLE_RECOVERABLE_PSA_ROT_DEBUG   (0x5000u)
 Recoverable PSA RoT Debug state. More...
 
#define PSA_LIFECYCLE_DECOMMISSIONED   (0x6000u)
 Decommissioned state. More...
 

Functions

uint32_t psa_security_lifecycle_state (void)
 Get PSA RoT lifecycle state. More...
 
psa_status_t mbed_psa_reboot_and_request_new_security_state (uint32_t new_state)
 Request state change. More...
 
MBED_NORETURN void mbed_psa_system_reset ()
 Resets the system. More...
 

Detailed Description

This file describes the PSA RoT Lifecycle API.

Definition in file lifecycle.h.

Macro Definition Documentation

◆ PSA_LIFECYCLE_STATE_MASK

#define PSA_LIFECYCLE_STATE_MASK   (0xff00u)

A mask value that extracts the main lifecycle state.

Definition at line 35 of file lifecycle.h.

◆ PSA_LIFECYCLE_SUBSTATE_MASK

#define PSA_LIFECYCLE_SUBSTATE_MASK   (0x00ffu)

A mask value that extracts the IMPLEMENTATION DEFINED lifecycle sub-state.

Definition at line 36 of file lifecycle.h.

◆ PSA_LIFECYCLE_UNKNOWN

#define PSA_LIFECYCLE_UNKNOWN   (0x0000u)

State is unknown.

Definition at line 38 of file lifecycle.h.

◆ PSA_LIFECYCLE_ASSEMBLY_AND_TEST

#define PSA_LIFECYCLE_ASSEMBLY_AND_TEST   (0x1000u)

Assembly and Test state.

Definition at line 39 of file lifecycle.h.

◆ PSA_LIFECYCLE_PSA_ROT_PROVISIONING

#define PSA_LIFECYCLE_PSA_ROT_PROVISIONING   (0x2000u)

PSA RoT Provisioning state.

Definition at line 40 of file lifecycle.h.

◆ PSA_LIFECYCLE_SECURED

#define PSA_LIFECYCLE_SECURED   (0x3000u)

Secured state.

Definition at line 41 of file lifecycle.h.

◆ PSA_LIFECYCLE_NON_PSA_ROT_DEBUG

#define PSA_LIFECYCLE_NON_PSA_ROT_DEBUG   (0x4000u)

Non PSA RoT debug state.

Definition at line 42 of file lifecycle.h.

◆ PSA_LIFECYCLE_RECOVERABLE_PSA_ROT_DEBUG

#define PSA_LIFECYCLE_RECOVERABLE_PSA_ROT_DEBUG   (0x5000u)

Recoverable PSA RoT Debug state.

Definition at line 43 of file lifecycle.h.

◆ PSA_LIFECYCLE_DECOMMISSIONED

#define PSA_LIFECYCLE_DECOMMISSIONED   (0x6000u)

Decommissioned state.

Definition at line 44 of file lifecycle.h.

Function Documentation

◆ psa_security_lifecycle_state()

uint32_t psa_security_lifecycle_state ( void  )

Get PSA RoT lifecycle state.

Return values
Themain state and sub-state are encoded as follows:
version[15:8] – main lifecycle state version[7:0] – IMPLEMENTATION DEFINED sub-state

◆ mbed_psa_reboot_and_request_new_security_state()

psa_status_t mbed_psa_reboot_and_request_new_security_state ( uint32_t  new_state)

Request state change.

State change requested and the reset the system.

Note
System reset will not be performed when switching from PSA_LIFECYCLE_ASSEMBLY_AND_TEST to PSA_LIFECYCLE_ASSEMBLY_AND_TEST.
state change to follwing states will delete PSA internal storage:
  • PSA_LIFECYCLE_ASSEMBLY_AND_TEST
  • PSA_LIFECYCLE_PSA_ROT_PROVISIONING
  • PSA_LIFECYCLE_DECOMMISSIONED

◆ mbed_psa_system_reset()

MBED_NORETURN void mbed_psa_system_reset ( )

Resets the system.

PSA targets do not allow NSPE to access system power domain. This API requests system reset to be carried out by SPE once all critical secure tasks are finished.