HPM SDK
HPMicro Software Development Kit
hpm_otp_drv.c File Reference
#include "hpm_common.h"
#include "hpm_soc.h"
#include "hpm_otp_drv.h"

Macros

#define SHADOW_INDEX_IN_PMIC_OTP_END   (15U)
 
#define OTP_UNLOCK_MAGIC_NUM   (0x4E45504FUL)
 
#define OTP_LOCK_MAGIC_NUM   (~OTP_UNLOCK_MAGIC_NUM)
 
#define OTP_CMD_PROGRAM   (0x574F4C42UL)
 
#define OTP_CMD_READ   (0x44414552UL)
 

Functions

void otp_init (void)
 Initialize OTP controller. More...
 
void otp_deinit (void)
 De-initialize OTP controller. More...
 
uint32_t otp_read_from_shadow (uint32_t addr)
 Read the OTP word from shadow register. More...
 
uint32_t otp_read_from_ip (uint32_t addr)
 Read the specified OTP word from OTP IP bus. More...
 
hpm_stat_t otp_program (uint32_t addr, const uint32_t *src, uint32_t num_of_words)
 Program a word to specified OTP field. More...
 
hpm_stat_t otp_reload (otp_region_t region)
 Reload a OTP region. More...
 
hpm_stat_t otp_lock_otp (uint32_t addr, otp_lock_option_t lock_option)
 Change the Software lock permission. More...
 
hpm_stat_t otp_lock_shadow (uint32_t addr, otp_lock_option_t lock_option)
 OTP lock shadow. More...
 
hpm_stat_t otp_set_configurable_region (uint32_t start, uint32_t num_of_words)
 Set the configurable region range. More...
 
hpm_stat_t otp_write_shadow_register (uint32_t addr, uint32_t val)
 

Macro Definition Documentation

◆ OTP_CMD_PROGRAM

#define OTP_CMD_PROGRAM   (0x574F4C42UL)

ASCII: BLOW

◆ OTP_CMD_READ

#define OTP_CMD_READ   (0x44414552UL)

ASCII: READ

◆ OTP_LOCK_MAGIC_NUM

#define OTP_LOCK_MAGIC_NUM   (~OTP_UNLOCK_MAGIC_NUM)

◆ OTP_UNLOCK_MAGIC_NUM

#define OTP_UNLOCK_MAGIC_NUM   (0x4E45504FUL)

ASCII: OPEN

◆ SHADOW_INDEX_IN_PMIC_OTP_END

#define SHADOW_INDEX_IN_PMIC_OTP_END   (15U)