HPM SDK
HPMicro Software Development Kit
hpm_psec_drv.h File Reference
#include "hpm_common.h"
#include "hpm_psec_regs.h"

Go to the source code of this file.

Macros

#define PSEC_PSECURE_STATE_MASK    (0xFU << PSEC_SECURE_STATE_PMIC_INS_SHIFT)
 
#define PSEC_BATT_SECURE_STATE_MASK    (0xFU << PSEC_SECURE_STATE_BATT_INS_SHIFT)
 

Typedefs

typedef enum psec_lifecycle psec_lifecycle_t
 
typedef enum batt_sec_state batt_sec_state_t
 
typedef enum psec_state psec_state_t
 

Enumerations

enum  psec_lifecycle {
  psec_lifecycle_unknown = 1 << 0 , psec_lifecycle_create = 1 << 1 , psec_lifecycle_nonsecucre = 1 << 2 , psec_lifecycle_secucre = 1 << 3 ,
  psec_lifecycle_return = 1 << 4 , psec_lifecycle_no_return = 1 << 5 , psec_lifecycle_scribe = 1 << 6 , psec_lifecycle_debate = 1 << 7
}
 
enum  batt_sec_state { batt_sec_state_ins = 0 , batt_sec_state_secure = 1 , batt_sec_state_non_secure = 2 , batt_sec_state_fail = 3 }
 
enum  psec_state { psec_state_ins = 0 , psec_state_secure = 1 , psec_state_non_secure = 2 , psec_state_fail = 3 }
 
enum  { status_psec_switch_state_not_allowed = ((uint32_t)( status_group_psec )*1000U + (uint32_t)( 1 )) }
 

Functions

static psec_lifecycle_t psec_get_pmic_lifecycle (PSEC_Type *ptr)
 
static hpm_stat_t psec_switch_pmic_state (PSEC_Type *ptr, psec_state_t state)
 
static void psec_allow_psecure_state_restart (PSEC_Type *ptr, bool allow)
 
static void psec_lock_psecure_state_restart (PSEC_Type *ptr, bool lock)
 
static void psec_pmic_rom_secrets_present (PSEC_Type *ptr, bool presented)
 
static void psec_psec_secure_state_config (PSEC_Type *ptr, bool rom_secrets_presented, bool allow_secure_state_restart, bool lock_secure_state_restart)
 
static void psec_pmic_non_secure_violation_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_psecure_violation_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_pmic_non_secure_escalate_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_psecure_escalate_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static uint32_t psec_get_pmic_status (PSEC_Type *ptr)
 
static psec_lifecycle_t psec_get_batt_lifecycle (PSEC_Type *ptr)
 
static hpm_stat_t psec_switch_batt_state (PSEC_Type *ptr, batt_sec_state_t state)
 
static void psec_allow_batt_secure_state_restart (PSEC_Type *ptr, bool allow)
 
static void psec_lock_batt_secure_state_restart (PSEC_Type *ptr, bool lock)
 
static void psec_batt_rom_secrets_present (PSEC_Type *ptr, bool presented)
 
static void psec_batt_set_secure_state_config (PSEC_Type *ptr, bool rom_secrets_presented, bool allow_secure_state_restart, bool lock_secure_state_restart)
 
static void psec_batt_non_secure_violation_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_batt_secure_violation_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_batt_non_secure_escalate_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static void psec_batt_secure_escalate_config (PSEC_Type *ptr, uint32_t violation_setting, bool lock)
 
static uint32_t psec_get_batt_status (PSEC_Type *ptr)
 

Macro Definition Documentation

◆ PSEC_BATT_SECURE_STATE_MASK

#define PSEC_BATT_SECURE_STATE_MASK    (0xFU << PSEC_SECURE_STATE_BATT_INS_SHIFT)

◆ PSEC_PSECURE_STATE_MASK

#define PSEC_PSECURE_STATE_MASK    (0xFU << PSEC_SECURE_STATE_PMIC_INS_SHIFT)

Typedef Documentation

◆ batt_sec_state_t

◆ psec_lifecycle_t

◆ psec_state_t

typedef enum psec_state psec_state_t

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
status_psec_switch_state_not_allowed 

◆ batt_sec_state

Enumerator
batt_sec_state_ins 
batt_sec_state_secure 
batt_sec_state_non_secure 
batt_sec_state_fail 

◆ psec_lifecycle

Enumerator
psec_lifecycle_unknown 
psec_lifecycle_create 
psec_lifecycle_nonsecucre 
psec_lifecycle_secucre 
psec_lifecycle_return 
psec_lifecycle_no_return 
psec_lifecycle_scribe 
psec_lifecycle_debate 

◆ psec_state

enum psec_state
Enumerator
psec_state_ins 
psec_state_secure 
psec_state_non_secure 
psec_state_fail 

Function Documentation

◆ psec_allow_batt_secure_state_restart()

static void psec_allow_batt_secure_state_restart ( PSEC_Type ptr,
bool  allow 
)
inlinestatic

◆ psec_allow_psecure_state_restart()

static void psec_allow_psecure_state_restart ( PSEC_Type ptr,
bool  allow 
)
inlinestatic

◆ psec_batt_non_secure_escalate_config()

static void psec_batt_non_secure_escalate_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_batt_non_secure_violation_config()

static void psec_batt_non_secure_violation_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_batt_rom_secrets_present()

static void psec_batt_rom_secrets_present ( PSEC_Type ptr,
bool  presented 
)
inlinestatic

◆ psec_batt_secure_escalate_config()

static void psec_batt_secure_escalate_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_batt_secure_violation_config()

static void psec_batt_secure_violation_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_batt_set_secure_state_config()

static void psec_batt_set_secure_state_config ( PSEC_Type ptr,
bool  rom_secrets_presented,
bool  allow_secure_state_restart,
bool  lock_secure_state_restart 
)
inlinestatic

◆ psec_get_batt_lifecycle()

static psec_lifecycle_t psec_get_batt_lifecycle ( PSEC_Type ptr)
inlinestatic

◆ psec_get_batt_status()

static uint32_t psec_get_batt_status ( PSEC_Type ptr)
inlinestatic

◆ psec_get_pmic_lifecycle()

static psec_lifecycle_t psec_get_pmic_lifecycle ( PSEC_Type ptr)
inlinestatic

◆ psec_get_pmic_status()

static uint32_t psec_get_pmic_status ( PSEC_Type ptr)
inlinestatic

◆ psec_lock_batt_secure_state_restart()

static void psec_lock_batt_secure_state_restart ( PSEC_Type ptr,
bool  lock 
)
inlinestatic

◆ psec_lock_psecure_state_restart()

static void psec_lock_psecure_state_restart ( PSEC_Type ptr,
bool  lock 
)
inlinestatic

◆ psec_pmic_non_secure_escalate_config()

static void psec_pmic_non_secure_escalate_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_pmic_non_secure_violation_config()

static void psec_pmic_non_secure_violation_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_pmic_rom_secrets_present()

static void psec_pmic_rom_secrets_present ( PSEC_Type ptr,
bool  presented 
)
inlinestatic

◆ psec_psec_secure_state_config()

static void psec_psec_secure_state_config ( PSEC_Type ptr,
bool  rom_secrets_presented,
bool  allow_secure_state_restart,
bool  lock_secure_state_restart 
)
inlinestatic

◆ psec_psecure_escalate_config()

static void psec_psecure_escalate_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_psecure_violation_config()

static void psec_psecure_violation_config ( PSEC_Type ptr,
uint32_t  violation_setting,
bool  lock 
)
inlinestatic

◆ psec_switch_batt_state()

static hpm_stat_t psec_switch_batt_state ( PSEC_Type ptr,
batt_sec_state_t  state 
)
inlinestatic

◆ psec_switch_pmic_state()

static hpm_stat_t psec_switch_pmic_state ( PSEC_Type ptr,
psec_state_t  state 
)
inlinestatic