11 #include "hpm_psec_regs.h"
42 #define PSEC_PSECURE_STATE_MASK \
43 (0xFU << PSEC_SECURE_STATE_PMIC_INS_SHIFT)
44 #define PSEC_BATT_SECURE_STATE_MASK \
45 (0xFU << PSEC_SECURE_STATE_BATT_INS_SHIFT)
89 & ~PSEC_SECURE_STATE_CONFIG_ROM_SECRETS_MASK)
90 | PSEC_SECURE_STATE_CONFIG_ROM_SECRETS_SET(presented);
94 bool rom_secrets_presented,
95 bool allow_secure_state_restart,
96 bool lock_secure_state_restart)
104 uint32_t violation_setting,
115 uint32_t violation_setting,
126 uint32_t violation_setting,
137 uint32_t violation_setting,
169 | (1U << (PSEC_SECURE_STATE_BATT_INS_SHIFT + state));
190 & ~PSEC_SECURE_STATE_CONFIG_ROM_SECRETS_MASK)
191 | PSEC_SECURE_STATE_CONFIG_ROM_SECRETS_SET(presented);
195 bool rom_secrets_presented,
196 bool allow_secure_state_restart,
197 bool lock_secure_state_restart)
205 uint32_t violation_setting,
216 uint32_t violation_setting,
227 uint32_t violation_setting,
238 uint32_t violation_setting,
#define PSEC_SECURE_STATE_PMIC_INS_SHIFT
Definition: hpm_psec_regs.h:89
#define PSEC_SECURE_STATE_CONFIG_LOCK_SET(x)
Definition: hpm_psec_regs.h:103
#define PSEC_SECURE_STATE_ALLOW_NSC_GET(x)
Definition: hpm_psec_regs.h:32
#define PSEC_VIOLATION_CONFIG_SEC_VIO_CFG_MASK
Definition: hpm_psec_regs.h:162
#define PSEC_ESCALATE_CONFIG_LOCK_SEC_MASK
Definition: hpm_psec_regs.h:199
#define PSEC_VIOLATION_CONFIG_NSC_VIO_CFG_SET(x)
Definition: hpm_psec_regs.h:140
#define PSEC_ESCALATE_CONFIG_NSC_VIO_CFG_SET(x)
Definition: hpm_psec_regs.h:189
#define PSEC_ESCALATE_CONFIG_NSC_VIO_CFG_MASK
Definition: hpm_psec_regs.h:187
#define PSEC_VIOLATION_CONFIG_LOCK_NSC_SET(x)
Definition: hpm_psec_regs.h:128
#define PSEC_ESCALATE_CONFIG_LOCK_NSC_SET(x)
Definition: hpm_psec_regs.h:177
#define PSEC_ESCALATE_CONFIG_SEC_VIO_CFG_MASK
Definition: hpm_psec_regs.h:211
#define PSEC_SECURE_STATE_CONFIG_ALLOW_RESTART_MASK
Definition: hpm_psec_regs.h:113
#define PSEC_VIOLATION_CONFIG_SEC_VIO_CFG_SET(x)
Definition: hpm_psec_regs.h:164
#define PSEC_LIFECYCLE_LIFECYCLE_GET(x)
Definition: hpm_psec_regs.h:260
#define PSEC_SECURE_STATE_CONFIG_ALLOW_RESTART_SET(x)
Definition: hpm_psec_regs.h:115
#define PSEC_VIOLATION_CONFIG_LOCK_SEC_MASK
Definition: hpm_psec_regs.h:150
#define PSEC_ESCALATE_CONFIG_SEC_VIO_CFG_SET(x)
Definition: hpm_psec_regs.h:213
#define PSEC_SECURE_STATE_ALLOW_SEC_GET(x)
Definition: hpm_psec_regs.h:43
#define PSEC_VIOLATION_CONFIG_LOCK_NSC_MASK
Definition: hpm_psec_regs.h:126
#define PSEC_ESCALATE_CONFIG_LOCK_NSC_MASK
Definition: hpm_psec_regs.h:175
#define PSEC_ESCALATE_CONFIG_LOCK_SEC_SET(x)
Definition: hpm_psec_regs.h:201
#define PSEC_SECURE_STATE_CONFIG_LOCK_MASK
Definition: hpm_psec_regs.h:101
#define PSEC_VIOLATION_CONFIG_NSC_VIO_CFG_MASK
Definition: hpm_psec_regs.h:138
#define PSEC_VIOLATION_CONFIG_LOCK_SEC_SET(x)
Definition: hpm_psec_regs.h:152
uint32_t hpm_stat_t
Definition: hpm_common.h:126
#define MAKE_STATUS(group, code)
Definition: hpm_common.h:135
@ status_success
Definition: hpm_common.h:180
static void psec_lock_psecure_state_restart(PSEC_Type *ptr, bool lock)
Definition: hpm_psec_drv.h:79
static psec_lifecycle_t psec_get_batt_lifecycle(PSEC_Type *ptr)
Definition: hpm_psec_drv.h:152
@ status_psec_switch_state_not_allowed
Definition: hpm_psec_drv.h:39
static void psec_psecure_escalate_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:136
static hpm_stat_t psec_switch_batt_state(PSEC_Type *ptr, batt_sec_state_t state)
Definition: hpm_psec_drv.h:157
static void psec_batt_non_secure_escalate_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:226
static void psec_batt_secure_escalate_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:237
static void psec_pmic_non_secure_violation_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:103
#define PSEC_PSECURE_STATE_MASK
Definition: hpm_psec_drv.h:42
static void psec_batt_rom_secrets_present(PSEC_Type *ptr, bool presented)
Definition: hpm_psec_drv.h:187
static void psec_allow_batt_secure_state_restart(PSEC_Type *ptr, bool allow)
Definition: hpm_psec_drv.h:173
static void psec_batt_non_secure_violation_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:204
static void psec_pmic_rom_secrets_present(PSEC_Type *ptr, bool presented)
Definition: hpm_psec_drv.h:86
enum psec_state psec_state_t
static uint32_t psec_get_batt_status(PSEC_Type *ptr)
Definition: hpm_psec_drv.h:248
static void psec_batt_secure_violation_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:215
static void psec_lock_batt_secure_state_restart(PSEC_Type *ptr, bool lock)
Definition: hpm_psec_drv.h:180
static void psec_psec_secure_state_config(PSEC_Type *ptr, bool rom_secrets_presented, bool allow_secure_state_restart, bool lock_secure_state_restart)
Definition: hpm_psec_drv.h:93
enum psec_lifecycle psec_lifecycle_t
psec_state
Definition: hpm_psec_drv.h:31
@ psec_state_non_secure
Definition: hpm_psec_drv.h:34
@ psec_state_ins
Definition: hpm_psec_drv.h:32
@ psec_state_fail
Definition: hpm_psec_drv.h:35
@ psec_state_secure
Definition: hpm_psec_drv.h:33
static uint32_t psec_get_pmic_status(PSEC_Type *ptr)
Definition: hpm_psec_drv.h:147
static hpm_stat_t psec_switch_pmic_state(PSEC_Type *ptr, psec_state_t state)
Definition: hpm_psec_drv.h:56
psec_lifecycle
Definition: hpm_psec_drv.h:13
@ psec_lifecycle_secucre
Definition: hpm_psec_drv.h:17
@ psec_lifecycle_scribe
Definition: hpm_psec_drv.h:20
@ psec_lifecycle_no_return
Definition: hpm_psec_drv.h:19
@ psec_lifecycle_nonsecucre
Definition: hpm_psec_drv.h:16
@ psec_lifecycle_unknown
Definition: hpm_psec_drv.h:14
@ psec_lifecycle_return
Definition: hpm_psec_drv.h:18
@ psec_lifecycle_debate
Definition: hpm_psec_drv.h:21
@ psec_lifecycle_create
Definition: hpm_psec_drv.h:15
static void psec_pmic_non_secure_escalate_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:125
static void psec_allow_psecure_state_restart(PSEC_Type *ptr, bool allow)
Definition: hpm_psec_drv.h:72
#define PSEC_BATT_SECURE_STATE_MASK
Definition: hpm_psec_drv.h:44
batt_sec_state
Definition: hpm_psec_drv.h:24
@ batt_sec_state_non_secure
Definition: hpm_psec_drv.h:27
@ batt_sec_state_ins
Definition: hpm_psec_drv.h:25
@ batt_sec_state_fail
Definition: hpm_psec_drv.h:28
@ batt_sec_state_secure
Definition: hpm_psec_drv.h:26
enum batt_sec_state batt_sec_state_t
static void psec_psecure_violation_config(PSEC_Type *ptr, uint32_t violation_setting, bool lock)
Definition: hpm_psec_drv.h:114
static psec_lifecycle_t psec_get_pmic_lifecycle(PSEC_Type *ptr)
Definition: hpm_psec_drv.h:51
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)
Definition: hpm_psec_drv.h:194
Definition: hpm_psec_regs.h:12
__RW uint32_t ESCALATE_CONFIG
Definition: hpm_psec_regs.h:16
__R uint32_t EVENT
Definition: hpm_psec_regs.h:17
__RW uint32_t SECURE_STATE_CONFIG
Definition: hpm_psec_regs.h:14
__RW uint32_t VIOLATION_CONFIG
Definition: hpm_psec_regs.h:15
__RW uint32_t SECURE_STATE
Definition: hpm_psec_regs.h:13
__R uint32_t LIFECYCLE
Definition: hpm_psec_regs.h:18