xilnvm
Vitis Drivers API Documentation
XilNvm eFUSE Server APIs

Macros

#define XNVM_EFUSE_ERROR_BYTE_SHIFT   (8U)
 Byte shift used in error code. More...
 
#define XNVM_EFUSE_ERROR_NIBBLE_SHIFT   (4U)
 Nibble shift used in error code. More...
 
#define XNVM_EFUSE_MAX_FIPS_VERSION   (7U)
 Max Value of FIPS version. More...
 
#define XNVM_EFUSE_MAX_FIPS_MODE   (0xFFU)
 Max value of FIPS mode. More...
 
#define XNVM_EFUSE_BITS_IN_A_BYTE   (8U)
 Number of bits in a byte. More...
 
#define XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET   (0xFFFFFFFFU)
 Secure Default Value for a register. More...
 
#define XNVM_EFUSE_BYTE_MASK   (0xFF)
 Mask for 8 bits. More...
 
#define REVERSE_POLYNOMIAL   (0x82F63B78U)
 Value used in CRC calculation to reverse a polynomial. More...
 
#define XNVM_EFUSE_SKIP_VERIFY   (1U)
 Skip verification of eFuses after programming. More...
 
#define XNVM_EFUSE_PROGRAM_VERIFY   (0U)
 Verify eFuses after programming. More...
 
#define XNVM_EFUSE_CRC_SALT   (0x000000FFU)
 CRC salt value. More...
 
#define XNVM_EFUSE_REVOKE_ID_127   (127U)
 Efuse revoke ID. More...
 
#define XNVM_EFUSE_PUF_SEC_CTRL_INVLD_MASK   0xE0000000U
 Mask for PUF control bits in PUF_ECC_PUF_CTRL register in EFUSE_CACHE module. More...
 
#define XNVM_EFUSE_PUF_CTRL_PUF_REGEN_DIS_MASK   0x80000000U
 Mask for PUF_REGEN_DISABLE. More...
 
#define XNVM_EFUSE_PUF_CTRL_PUF_HD_INVLD_MASK   0x40000000U
 Mask for PUF_HD_INVLD. More...
 
#define XNVM_EFUSE_PUF_CTRL_PUF_REGIS_DIS_MASK   0x20000000U
 Mask for PUF_REGIS_DIS. More...
 
#define XNVM_EFUSE_DME_KEY_SIZE_IN_BYTES   (48U)
 DME key size in bytes. More...
 
#define XNVM_EFUSE_DME_0_USER_EFUSE_CACHE_OFFSET   (0x240U)
 DME 0 corresponding User eFuse offset. More...
 
#define XNVM_EFUSE_DME_1_USER_EFUSE_CACHE_OFFSET   (0x270U)
 DME 1 corresponding User eFuse offset. More...
 
#define XNVM_EFUSE_DME_2_USER_EFUSE_CACHE_OFFSET   (0x2A0U)
 DME 2 corresponding User eFuse offset. More...
 
#define XNVM_EFUSE_DME_3_USER_EFUSE_CACHE_OFFSET   (0x2D0U)
 DME 3 corresponding User eFuse offset. More...
 
#define XNVM_EFUSE_PPK_HASH_UPPER_WORD_START_OFFSET   (8U)
 PPK HASH upper 128 bit hash start word offset. More...
 
#define XNVM_EFUSE_LAST_ROW_IN_PAGE   (255U)
 Row number of last eFuse row in page. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_0   (0xF1250004U)
 ANLG_TRIM_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_1   (0xF1250008U)
 ANLG_TRIM_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_2   (0xF125000CU)
 ANLG_TRIM_2 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_IP_DISABLE_1   (0xF125001CU)
 IP_DISABLE_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_DNA_0   (0xF1250020U)
 DNA_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_DNA_1   (0xF1250024U)
 DNA_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_DNA_2   (0xF1250028U)
 DNA_2 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_DNA_3   (0xF125002CU)
 DNA_3 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_BRAM   (0xF1250098U)
 TRIM_BRAM eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_URAM   (0xF125009CU)
 TRIM_URAM eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_PMC_BISR_0   (0xF12500D8U)
 PMC_BISR_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_PMC_BISR_1   (0xF12500DCU)
 PMC_BISR_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_5   (0xF12500E0U)
 ANLG_TRIM_5 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_6   (0xF12500F4U)
 ANLG_TRIM_6 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ANLG_TRIM_7   (0xF12500F8U)
 ANLG_TRIM_7 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ME_ID_CODE   (0xF12500FCU)
 ME_ID_CODE eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_EXPORT_DFT   (0xF125018CU)
 EXPORT_DFT eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_4   (0xF1250190U)
 TRIM_AMS_4 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_5   (0xF1250194U)
 TRIM_AMS_5 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_6   (0xF1250198U)
 TRIM_AMS_6 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_7   (0xF125019CU)
 TRIM_AMS_7 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_8   (0xF12501A0U)
 TRIM_AMS_8 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_9   (0xF12501A4U)
 TRIM_AMS_9 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_10   (0xF12501A8U)
 TRIM_AMS_10 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_11   (0xF12501ACU)
 TRIM_AMS_11 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_12   (0xF12501B0U)
 TRIM_AMS_12 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_0   (0xF12501B4U)
 TRIM_CFRM_VGG_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_1   (0xF12501B8U)
 TRIM_CFRM_VGG_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_2   (0xF12501BCU)
 TRIM_CFRM_VGG_2 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_CRAM   (0xF12501C0U)
 TRIM_CRAM eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_NIDB_0   (0xF12501C4U)
 NIDB_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_NIDB_1   (0xF12501C8U)
 NIDB_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_NIDB_2   (0xF12501CCU)
 NIDB_2 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_0   (0xF12501F4U)
 TRIM_AMS_0 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_1   (0xF12501F8U)
 TRIM_AMS_1 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_2   (0xF12501FCU)
 TRIM_AMS_2 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_TRIM_AMS_3   (0xF1250200U)
 TRIM_AMS_3 eFuse cache offset. More...
 
#define XNVM_EFUSE_CACHE_ME_ID_CODE_3_0_MASK   (0x0000000FU)
 ME_ID_CODE_3_0_MASK. More...
 
#define XNVM_CRC_DATA_WORD_COUNT   (37U)
 CRC DATA word count. More...
 
#define XNVM_CRC_DATA_BYTE_COUNT   (XNVM_CRC_DATA_WORD_COUNT * XNVM_WORD_LEN)
 CRC data byte count. More...
 

Functions

int XNvm_EfuseCacheReload (void)
 This function reloads the eFUSE cache, so that eFUSE values can be directly read from cache. More...
 
void XNvm_EfuseDisablePowerDown (void)
 This function disables power down of eFUSE macros. More...
 
int XNvm_EfuseSetReadMode (XNvm_EfuseRdMode RdMode)
 This function sets read mode of eFUSE controller. More...
 
void XNvm_EfuseSetRefClk (void)
 This function sets reference clock of eFUSE controller. More...
 
void XNvm_EfuseEnableProgramming (void)
 This function enables programming mode of eFUSE controller. More...
 
int XNvm_EfuseDisableProgramming (void)
 This function disables programming mode of eFUSE controller. More...
 
int XNvm_EfuseResetReadMode (void)
 This function disables Margin Read mode of eFUSE controller. More...
 
void XNvm_EfuseInitTimers (void)
 This function initializes eFUSE controller timers. More...
 
int XNvm_EfuseSetupController (XNvm_EfuseOpMode Op, XNvm_EfuseRdMode RdMode)
 This function setups eFUSE controller for given operation and read mode. More...
 
int XNvm_EfuseCheckForTBits (void)
 This function checks whether Tbits are programmed or not. More...
 
u32 XNvm_GetSysmonSupplyRegId (UINTPTR SysmonpsvSatBaseAddr)
 This function reads root register ID where measurement is stored in Root SysMon. More...
 
int XNvm_EfuseTempAndVoltChecks (const XSysMonPsv *SysMonInstPtr)
 This function performs the Temparature and Voltage checks to ensure that they are in limits before eFuse programming. More...
 
u32 XNvm_EfuseReadProtectionBits (u32 Mask)
 This function reads the corresponding eFuse protection bits. More...
 
int XNvm_EfuseWrite (const XNvm_EfuseData *WriteNvm)
 This function is used as a wrapper to program below eFuses AES key User key 0 User key 1 PPK0/PPK1/PPK2/PPK3/PPK4 hash IVs Revocation Ids User Fuses Secure and Control bits. More...
 
int XNvm_EfuseReadSecCtrlBits (XNvm_EfuseSecCtrlBits *SecCtrlBits)
 This function is used to read the eFUSE secure control bits from cache. More...
 
int XNvm_EfuseReadSecMisc1Bits (XNvm_EfuseSecMisc1Bits *SecMisc1Bits)
 This function is used to read the security miscellaneous1 bits from cache. More...
 
int XNvm_EfuseReadBootEnvCtrlBits (XNvm_EfuseBootEnvCtrlBits *BootEnvCtrlBits)
 This function reads the Boot Environmental Control bits from cache. More...
 
int XNvm_EfuseWritePuf (const XNvm_EfusePufHd *PufHelperData)
 This function programs the eFUSEs with the PUF helper data. More...
 
int XNvm_EfuseReadPufSecCtrlBits (XNvm_EfusePufSecCtrlBits *PufSecCtrlBits)
 This function is used to read the Puf eFUSE secure control bits from cache. More...
 
int XNvm_EfuseReadMiscCtrlBits (XNvm_EfuseMiscCtrlBits *MiscCtrlBits)
 This function is used to read the miscellaneous eFUSE control bits from cache. More...
 
int XNvm_EfuseWriteIVs (XNvm_EfuseIvs *EfuseIv, XSysMonPsv *SysMonInstPtr)
 This function programs the eFUSEs with the IV. More...
 
int XNvm_EfuseReadIv (XNvm_Iv *EfuseIv, XNvm_IvType IvType)
 This function is used to read IV eFUSE bits from cache. More...
 
int XNvm_EfuseReadPuf (XNvm_EfusePufHd *PufHelperData)
 This function reads the PUF helper data from eFUSE cache. More...
 
int XNvm_EfuseReadDna (XNvm_Dna *EfuseDna)
 This function is used to read Dna eFUSE bits from cache. More...
 
int XNvm_EfuseReadDecOnly (u32 *DecOnly)
 This function is used to read DecEfuseOnly eFUSE bits from cache. More...
 
int XNvm_EfuseReadPpkHash (XNvm_PpkHash *EfusePpk, XNvm_PpkType PpkType)
 This function reads the Ppk Hash from eFUSE cache. More...
 
int XNvm_EfuseRevokePpk (XNvm_PpkType PpkRevoke, XSysMonPsv *SysMonInstPtr)
 This function revokes the Ppk. More...
 
int XNvm_EfuseReadRevocationId (u32 *RevokeFusePtr, XNvm_RevocationId RevokeFuseNum)
 This function reads the Revocation Fuse from eFUSE cache. More...
 
int XNvm_EfuseWriteAesKey (u32 EnvDisFlag, XNvm_AesKeyType KeyType, XNvm_AesKey *EfuseKey)
 This function is used to take care of prerequisites to program below eFuses AES key User key 0 User key 1. More...
 
int XNvm_EfuseWritePpkHash (u32 EnvDisFlag, XNvm_PpkType PpkType, XNvm_PpkHash *EfuseHash)
 This function is used to to take care of prerequisitis to program below eFuses PPK0_HASH PPK1_HASH PPK2_HASH. More...
 
int XNvm_EfuseWriteIv (u32 EnvDisFlag, XNvm_IvType IvType, XNvm_Iv *EfuseIv)
 This function is used to to take care of prerequisitis to program below IV eFuses XNVM_EFUSE_ERR_WRITE_META_HEADER_IV XNVM_EFUSE_ERR_WRITE_BLK_OBFUS_IV XNVM_EFUSE_ERR_WRITE_PLM_IV XNVM_EFUSE_ERR_WRITE_DATA_PARTITION_IV. More...
 
int XNvm_EfuseWriteGlitchConfigBits (u32 EnvDisFlag, u32 GlitchConfig)
 This function is used to program Glitch Configuration given by the user. More...
 
int XNvm_EfuseWriteDecOnly (u32 EnvDisFlag)
 This function is used to program below DEC_ONLY fuses. More...
 
int XNvm_EfuseWriteRevocationID (u32 EnvDisFlag, u32 RevokeIdNum)
 This function writes Revocation eFuses. More...
 
int XNvm_EfuseWriteOffChipRevokeID (u32 EnvDisFlag, u32 OffchipIdNum)
 This function programs OffChip Revoke eFuses. More...
 
int XNvm_EfuseWriteMiscCtrlBits (u32 EnvDisFlag, u32 MiscCtrlBits)
 This function programs MiscCtrl eFuses. More...
 
int XNvm_EfuseWriteSecCtrlBits (u32 EnvDisFlag, u32 SecCtrlBits)
 This function programs SecCtrl eFuses. More...
 
int XNvm_EfuseWriteMisc1Bits (u32 EnvDisFlag, u32 Misc1Bits)
 This function programs Misc1Ctrl eFuses. More...
 
int XNvm_EfuseWriteBootEnvCtrlBits (u32 EnvDisFlag, u32 BootEnvCtrlBits)
 This function programs BootEnvCtrl eFuses. More...
 
int XNvm_EfuseWriteFipsInfo (u32 EnvDisFlag, u32 FipsMode, u32 FipsVersion)
 This function is used to to take care of prerequisitis to program FIPS mode and FIPS version eFuses. More...
 
int XNvm_EfuseWriteUds (u32 EnvDisFlag, XNvm_Uds *EfuseUds)
 This function programs UDS eFuses. More...
 
int XNvm_EfuseWriteDmeUserKey (u32 EnvDisFlag, XNvm_DmeKeyType KeyType, XNvm_DmeKey *EfuseKey)
 This function programs DME userkey eFuses. More...
 
int XNvm_EfuseWriteDmeRevoke (u32 EnvDisFlag, XNvm_DmeRevoke RevokeNum)
 This function programs DME Revoke eFuses. More...
 
int XNvm_EfuseWriteDisableInplacePlmUpdate (u32 EnvDisFlag)
 This function programs PLM_UPDATE eFuse. More...
 
int XNvm_EfuseWriteBootModeDisable (u32 EnvDisFlag, u32 BootModeMask)
 This function programs BootModeDisable eFuses. More...
 
int XNvm_EfuseWriteDmeMode (u32 EnvDisFlag, u32 DmeMode)
 This function programs DmeMode eFuses. More...
 
int XNvm_EfuseWriteCrc (u32 EnvDisFlag, u32 Crc)
 This function programs EFUSE_CRC_SALT eFuses. More...
 
int XNvm_EfuseWritePuf (const XNvm_EfusePufHdAddr *PufHelperData)
 This function programs PUF ctrl and PUF helper data, Chash and Aux. More...
 
int XNvm_EfuseWritePufSecCtrl (u32 EnvDisFlag, u32 PufCtrlBits)
 This function programs Puf control bits specified by user. More...
 
int XNvm_EfuseCacheLoadNPrgmProtectionBits (void)
 This function reloads the cache of eFUSE so that can be directly read from cache and programs required protections eFuses. More...
 
int XNvm_EfuseWriteRomRsvdBits (u32 EnvDisFlag, u32 RomRsvdBits)
 This function programs ROM Rsvd Bits eFuses. More...
 

Variables

u32 XNvm_EfusePrgmInfo::StartRow
 Start row number of eFuse. More...
 
u32 XNvm_EfusePrgmInfo::ColStart
 Start column number of eFuse. More...
 
u32 XNvm_EfusePrgmInfo::ColEnd
 End column number of eFuse. More...
 
u32 XNvm_EfusePrgmInfo::NumOfRows
 Number of rows of eFuse. More...
 
u32 XNvm_EfusePrgmInfo::SkipVerify
 Flag to check if eFuse bit should be verified after programming. More...
 
XNvm_EfuseType XNvm_EfusePrgmInfo::EfuseType
 Efuse page number. More...
 

eFuse ctrls constants

#define XNVM_EFUSE_CTRL_WR_LOCKED   (0x01U)
 < Macros for eFUSE CTRL WRITE LOCKED and UNLOCKED More...
 
#define XNVM_EFUSE_CTRL_WR_UNLOCKED   (0x00U)
 
#define XNVM_EFUSE_FULL_RANGE_TEMP_MIN   (-55.0f)
 Temaperature limits defination for versal Efuses. More...
 
#define XNVM_EFUSE_TEMP_HP_MAX   (125.0f)
 eFuse Range check definations More...
 
#define XNVM_EFUSE_HP_RANGE_CHECK   (3U)
 eFuse volatage limits definations More...
 
#define XNVM_EFUSE_PROTECTION_BIT_CLEAR   (0U)
 To check the corresponding protection eFuse is set or not. More...
 

Operation mode

enum  XNvm_EfuseOpMode { XNVM_EFUSE_MODE_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_MODE_RD, XNVM_EFUSE_MODE_PGM }
 

Read mode

enum  XNvm_EfuseRdMode { XNVM_EFUSE_NORMAL_RD, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_NORMAL_RD, XNVM_EFUSE_MARGIN_RD }
 

eFuse Page

enum  XNvm_EfuseType { XNVM_EFUSE_PAGE_0 = 0, XNVM_EFUSE_PAGE_1, XNVM_EFUSE_PAGE_2 }
 

eFuse macro definitions

#define XNVM_EFUSE_CRC_AES_ZEROS   (0x6858A3D5U)
 < CRC for Aes zero key More...
 
#define XNVM_EFUSE_TOTAL_NUM_OF_ROWS   (768U)
 PPK hash number of eFuse rows. More...
 
#define XNVM_EFUSE_TOTAL_PPK_HASH_ROWS   (XNVM_EFUSE_PPK_HASH_NUM_OF_ROWS * 3U)
 eFuse word length More...
 
#define XNVM_EFUSE_WORD_LEN   (4U)
 Default secure value for 32 bit. More...
 
#define XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET   (0xFFFFFFFFU)
 Sysmon VCCPMC Amux ctrl value. More...
 
#define XNVM_EFUSE_SYSMON_VCCPMC_AMUX_CTRL   (0x0bU)
 Sysmon VCCPMC Abus sw1 value. More...
 
#define XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW1   (0x00U)
 Sysmon VCCPMC Abus sw0 value. More...
 
#define XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW0   (0x02U)
 Sysmon VCCPMC mode value. More...
 
#define XNVM_EFUSE_SYSMON_VCCPMC_MODE   (0x00U)
 Sysmon number of measurement registers. More...
 
#define XNVM_EFUSE_SYSMON_NUM_MEASURE_REGS   (0x20U)
 Sysmon number of supplies per flag. More...
 
#define XNVM_EFUSE_SYSMON_NUM_SUPPLIES_PER_FLAG   (32U)
 Sysmon Psv timeout value. More...
 
#define XNVM_EFUSE_SYSMONPSV_TIMEOUT   (100000U)
 Fraction multiplier value. More...
 
#define XNVM_EFUSE_FRACTION_MUL_VALUE   (1000000U)
 
#define XNVM_NUM_OF_CACHE_ADDR_PER_PAGE   (0x400U)
 PPK3 and PPK4 enable bits mask. More...
 
#define XNVM_EFUSE_PPK_3_PPK_4_ENABLE   (0x00030000U)
 Total number of PPKS. More...
 
#define XNVM_EFUSE_NUM_OF_PPKS   (3U)
 
int XNvm_EfuseWriteRevocationId (u32 RevokeId, XSysMonPsv *SysMonInstPtr)
 This function writes Revocation eFuses. More...
 
int XNvm_EfuseReadOffchipRevokeId (u32 *OffchipIdPtr, XNvm_OffchipId OffchipIdNum)
 This function reads the Offchip revoke eFuse value from eFUSE cache. More...
 
int XNvm_EfuseReadUserFuses (const XNvm_EfuseUserData *UserFusesData)
 This function reads User eFuses from Cache. More...
 
int XNvm_EfuseWriteUserFuses (XNvm_EfuseUserData *WriteUserFuses, XSysMonPsv *SysMonInstPtr)
 This function Programs User eFuses. More...
 
int XNvm_EfuseReadCacheRange (u32 StartRow, u8 RowCount, u32 *RowData)
 This function reads 32-bit rows from eFUSE cache. More...
 

Macro Definition Documentation

#define REVERSE_POLYNOMIAL   (0x82F63B78U)

Value used in CRC calculation to reverse a polynomial.

#define XNVM_CRC_DATA_BYTE_COUNT   (XNVM_CRC_DATA_WORD_COUNT * XNVM_WORD_LEN)

CRC data byte count.

#define XNVM_CRC_DATA_WORD_COUNT   (37U)

CRC DATA word count.

#define XNVM_EFUSE_BITS_IN_A_BYTE   (8U)

Number of bits in a byte.

Referenced by XNvm_EfuseWriteRevocationID().

#define XNVM_EFUSE_BYTE_MASK   (0xFF)

Mask for 8 bits.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_0   (0xF1250004U)

ANLG_TRIM_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_1   (0xF1250008U)

ANLG_TRIM_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_2   (0xF125000CU)

ANLG_TRIM_2 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_5   (0xF12500E0U)

ANLG_TRIM_5 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_6   (0xF12500F4U)

ANLG_TRIM_6 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ANLG_TRIM_7   (0xF12500F8U)

ANLG_TRIM_7 eFuse cache offset.

#define XNVM_EFUSE_CACHE_DNA_0   (0xF1250020U)

DNA_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_DNA_1   (0xF1250024U)

DNA_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_DNA_2   (0xF1250028U)

DNA_2 eFuse cache offset.

#define XNVM_EFUSE_CACHE_DNA_3   (0xF125002CU)

DNA_3 eFuse cache offset.

#define XNVM_EFUSE_CACHE_EXPORT_DFT   (0xF125018CU)

EXPORT_DFT eFuse cache offset.

#define XNVM_EFUSE_CACHE_IP_DISABLE_1   (0xF125001CU)

IP_DISABLE_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_ME_ID_CODE   (0xF12500FCU)

ME_ID_CODE eFuse cache offset.

#define XNVM_EFUSE_CACHE_ME_ID_CODE_3_0_MASK   (0x0000000FU)

ME_ID_CODE_3_0_MASK.

#define XNVM_EFUSE_CACHE_NIDB_0   (0xF12501C4U)

NIDB_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_NIDB_1   (0xF12501C8U)

NIDB_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_NIDB_2   (0xF12501CCU)

NIDB_2 eFuse cache offset.

#define XNVM_EFUSE_CACHE_PMC_BISR_0   (0xF12500D8U)

PMC_BISR_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_PMC_BISR_1   (0xF12500DCU)

PMC_BISR_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_0   (0xF12501F4U)

TRIM_AMS_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_1   (0xF12501F8U)

TRIM_AMS_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_10   (0xF12501A8U)

TRIM_AMS_10 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_11   (0xF12501ACU)

TRIM_AMS_11 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_12   (0xF12501B0U)

TRIM_AMS_12 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_2   (0xF12501FCU)

TRIM_AMS_2 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_3   (0xF1250200U)

TRIM_AMS_3 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_4   (0xF1250190U)

TRIM_AMS_4 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_5   (0xF1250194U)

TRIM_AMS_5 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_6   (0xF1250198U)

TRIM_AMS_6 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_7   (0xF125019CU)

TRIM_AMS_7 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_8   (0xF12501A0U)

TRIM_AMS_8 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_AMS_9   (0xF12501A4U)

TRIM_AMS_9 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_BRAM   (0xF1250098U)

TRIM_BRAM eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_0   (0xF12501B4U)

TRIM_CFRM_VGG_0 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_1   (0xF12501B8U)

TRIM_CFRM_VGG_1 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_CFRM_VGG_2   (0xF12501BCU)

TRIM_CFRM_VGG_2 eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_CRAM   (0xF12501C0U)

TRIM_CRAM eFuse cache offset.

#define XNVM_EFUSE_CACHE_TRIM_URAM   (0xF125009CU)

TRIM_URAM eFuse cache offset.

#define XNVM_EFUSE_CRC_AES_ZEROS   (0x6858A3D5U)

< CRC for Aes zero key

Efuse total number of rows

Referenced by XNvm_EfuseValidateAesKeyWriteReq(), and XNvm_EfuseValidateDecOnlyRequest().

#define XNVM_EFUSE_CRC_SALT   (0x000000FFU)

CRC salt value.

Referenced by XNvm_EfuseWriteCrc().

#define XNVM_EFUSE_CTRL_WR_LOCKED   (0x01U)

< Macros for eFUSE CTRL WRITE LOCKED and UNLOCKED

#define XNVM_EFUSE_DME_0_USER_EFUSE_CACHE_OFFSET   (0x240U)

DME 0 corresponding User eFuse offset.

#define XNVM_EFUSE_DME_1_USER_EFUSE_CACHE_OFFSET   (0x270U)

DME 1 corresponding User eFuse offset.

#define XNVM_EFUSE_DME_2_USER_EFUSE_CACHE_OFFSET   (0x2A0U)

DME 2 corresponding User eFuse offset.

#define XNVM_EFUSE_DME_3_USER_EFUSE_CACHE_OFFSET   (0x2D0U)

DME 3 corresponding User eFuse offset.

#define XNVM_EFUSE_DME_KEY_SIZE_IN_BYTES   (48U)

DME key size in bytes.

#define XNVM_EFUSE_ERROR_BYTE_SHIFT   (8U)
#define XNVM_EFUSE_ERROR_NIBBLE_SHIFT   (4U)

Nibble shift used in error code.

Referenced by XNvm_EfuseValidateAesKeyWriteReq(), and XNvm_EfuseValidatePpkHashWriteReq().

#define XNVM_EFUSE_FULL_RANGE_TEMP_MIN   (-55.0f)

Temaperature limits defination for versal Efuses.

#define XNVM_EFUSE_HP_RANGE_CHECK   (3U)

eFuse volatage limits definations

#define XNVM_EFUSE_LAST_ROW_IN_PAGE   (255U)

Row number of last eFuse row in page.

#define XNVM_EFUSE_MAX_FIPS_MODE   (0xFFU)

Max value of FIPS mode.

Referenced by XNvm_EfuseWriteFipsInfo().

#define XNVM_EFUSE_MAX_FIPS_VERSION   (7U)

Max Value of FIPS version.

Referenced by XNvm_EfuseWriteFipsInfo().

#define XNVM_EFUSE_PPK_3_PPK_4_ENABLE   (0x00030000U)

Total number of PPKS.

#define XNVM_EFUSE_PPK_HASH_UPPER_WORD_START_OFFSET   (8U)

PPK HASH upper 128 bit hash start word offset.

#define XNVM_EFUSE_PROTECTION_BIT_CLEAR   (0U)

To check the corresponding protection eFuse is set or not.

Referenced by XNvm_EfuseReadProtectionBits().

#define XNVM_EFUSE_PUF_CTRL_PUF_HD_INVLD_MASK   0x40000000U

Mask for PUF_HD_INVLD.

Referenced by XNvm_EfuseWritePufSecCtrl().

#define XNVM_EFUSE_PUF_CTRL_PUF_REGEN_DIS_MASK   0x80000000U

Mask for PUF_REGEN_DISABLE.

Referenced by XNvm_EfuseWritePufSecCtrl().

#define XNVM_EFUSE_PUF_CTRL_PUF_REGIS_DIS_MASK   0x20000000U

Mask for PUF_REGIS_DIS.

Referenced by XNvm_EfuseWritePufSecCtrl().

#define XNVM_EFUSE_PUF_SEC_CTRL_INVLD_MASK   0xE0000000U

Mask for PUF control bits in PUF_ECC_PUF_CTRL register in EFUSE_CACHE module.

Referenced by XNvm_EfuseWritePufSecCtrl().

#define XNVM_EFUSE_REVOKE_ID_127   (127U)

Efuse revoke ID.

Referenced by XNvm_EfuseWriteRevocationID().

#define XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET   (0xFFFFFFFFU)

Secure Default Value for a register.

Referenced by XNvm_EfuseWritePuf().

#define XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET   (0xFFFFFFFFU)

Sysmon VCCPMC Amux ctrl value.

Referenced by XNvm_EfuseWritePuf().

#define XNVM_EFUSE_SKIP_VERIFY   (1U)

Skip verification of eFuses after programming.

Referenced by XNvm_EfuseWriteUds().

#define XNVM_EFUSE_SYSMON_NUM_MEASURE_REGS   (0x20U)

Sysmon number of supplies per flag.

#define XNVM_EFUSE_SYSMON_NUM_SUPPLIES_PER_FLAG   (32U)

Sysmon Psv timeout value.

#define XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW0   (0x02U)

Sysmon VCCPMC mode value.

#define XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW1   (0x00U)

Sysmon VCCPMC Abus sw0 value.

#define XNVM_EFUSE_SYSMON_VCCPMC_AMUX_CTRL   (0x0bU)

Sysmon VCCPMC Abus sw1 value.

#define XNVM_EFUSE_SYSMON_VCCPMC_MODE   (0x00U)

Sysmon number of measurement registers.

#define XNVM_EFUSE_SYSMONPSV_TIMEOUT   (100000U)

Fraction multiplier value.

#define XNVM_EFUSE_TEMP_HP_MAX   (125.0f)

eFuse Range check definations

#define XNVM_EFUSE_TOTAL_NUM_OF_ROWS   (768U)

PPK hash number of eFuse rows.

#define XNVM_EFUSE_TOTAL_PPK_HASH_ROWS   (XNVM_EFUSE_PPK_HASH_NUM_OF_ROWS * 3U)

eFuse word length

#define XNVM_EFUSE_WORD_LEN   (4U)

Default secure value for 32 bit.

Referenced by XNvm_EfuseTempAndVoltChecks(), and XNvm_GetSysmonSupplyRegId().

#define XNVM_NUM_OF_CACHE_ADDR_PER_PAGE   (0x400U)

PPK3 and PPK4 enable bits mask.

Enumeration Type Documentation

enum XNvm_EfuseOpMode
Enumerator
XNVM_EFUSE_MODE_RD 

eFuse read mode

XNVM_EFUSE_MODE_PGM 

eFuse program mode

XNVM_EFUSE_MODE_RD 

eFuse read mode

XNVM_EFUSE_MODE_PGM 

eFuse program mode

enum XNvm_EfuseRdMode
Enumerator
XNVM_EFUSE_NORMAL_RD 

eFuse normal read

XNVM_EFUSE_MARGIN_RD 

eFuse margin read

XNVM_EFUSE_NORMAL_RD 

eFuse normal read

XNVM_EFUSE_MARGIN_RD 

eFuse margin read

Enumerator
XNVM_EFUSE_PAGE_0 

Efuse page 0.

XNVM_EFUSE_PAGE_1 

Efuse page 1.

XNVM_EFUSE_PAGE_2 

Efuse page 2.

Function Documentation

int XNvm_EfuseCacheLoadNPrgmProtectionBits ( void  )

This function reloads the cache of eFUSE so that can be directly read from cache and programs required protections eFuses.

Returns
  • XST_SUCCESS On Successful Cache Reload.
  • XNVM_EFUSE_ERR_CACHE_LOAD Error while loading the cache.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.
Note
Not recommended to call this API frequently,if this API is called all the cache memory is reloaded by reading eFUSE array, reading eFUSE bit multiple times may diminish the life time.

Unlock eFuse Controller. Return appropriate error code if not success

Reload Cache and check protection bits.

Write protection bits into eFuse. Return error code upon failure.

Reload cache and check protection bits.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, and XNvm_EfuseSetupController().

int XNvm_EfuseCacheReload ( void  )

This function reloads the eFUSE cache, so that eFUSE values can be directly read from cache.

Returns
  • XST_SUCCESS On successful cache reload.
  • XNVM_EFUSE_ERR_CACHE_LOAD Error while loading the cache.
Note
Not recommended to call this API frequently,if this API is called all the cache memory is reloaded by reading eFUSE array, reading eFUSE bit multiple times may diminish the life time.

Write 1 to load bit of eFuse_CACHE_LOAD register. Wait for CACHE_DONE bit to set in EFUSE_STATUS register. If timed out return timeout error, else return XST_SUCCESS.

Read EFUSE_ISR_REG. If EFUSE_ISR_CACHE_ERROR is set return cache load error else return XST_SUCCES.

Reset EFUSE_ISR_CACHE_ERROR bit to 1.

References XNVM_EFUSE_ERR_CACHE_LOAD, XNvm_EfuseReadReg(), and XNvm_EfuseWriteReg().

int XNvm_EfuseCheckForTBits ( void  )

This function checks whether Tbits are programmed or not.

Returns
  • XST_SUCCESS On Success.
  • XNVM_EFUSE_ERR_PGM_TBIT_PATTERN Error in T-Bit pattern.

Read EFUSE_STATUS_REG register. Return error code if Read register value not equal to Tbit mask.

References XNVM_EFUSE_ERR_PGM_TBIT_PATTERN, and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseSetupController().

void XNvm_EfuseDisablePowerDown ( void  )

This function disables power down of eFUSE macros.

Read EFUSE_PD_REG. If enable disable by writing EFUSE_PD_REG to 0.

When changing the Power Down state, wait a separation period of 1us, before and after accessing the eFuse-Macro.

References XNvm_EfuseReadReg(), XNvm_EfuseWriteReg(), and XNVM_ONE_MICRO_SECOND.

Referenced by XNvm_EfuseSetupController().

int XNvm_EfuseDisableProgramming ( void  )

This function disables programming mode of eFUSE controller.

Returns
XST_SUCCESS - if eFUSE programming is disabled successfully. XST_FAILURE - if there is a failure
  • XST_SUCCESS If eFUSE programming is disabled successfully.
  • XST_FAILURE If there is a failure

Read EFUSE_CFG_REG

disable eFuse program mode by writing EFUSE_CFG_REG register

Read EFUSE_CFG_REG

Disable eFuse program mode by writing EFUSE_CFG_REG register

References XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWrite(), and XNvm_EfuseWritePuf().

void XNvm_EfuseEnableProgramming ( void  )

This function enables programming mode of eFUSE controller.

Read EFUSE_CFG_REG

Enable eFuse program mode by writing EFUSE_CFG_REG register

References XNvm_EfuseReadReg(), and XNvm_EfuseWriteReg().

Referenced by XNvm_EfuseSetupController().

void XNvm_EfuseInitTimers ( void  )
int XNvm_EfuseReadBootEnvCtrlBits ( XNvm_EfuseBootEnvCtrlBits *  BootEnvCtrlBits)

This function reads the Boot Environmental Control bits from cache.

Parameters
BootEnvCtrlBits- Pointer to the XNvm_EfuseBootEnvCtrlBits which holds the Boot Environmental control bits.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error while Cache reload.

Perform input parameter validation. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of BOOT_ENV_CTRL offset to fill the BootEnvCtrlBits structure. Return XST_SUCCESS if read is success.

References XNVM_EFUSE_CACHE_BOOT_ENV_CTRL_SYSMON_TEMP_EN_MASK, and XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadCacheRange ( u32  StartRow,
u8  RowCount,
u32 *  RowData 
)

This function reads 32-bit rows from eFUSE cache.

Parameters
StartRow- Starting Row number (0-based addressing).
RowCount- Number of Rows to be read.
RowData- Pointer to memory location where read 32-bit row data(s) is to be stored.
Returns
  • XST_SUCCESS Specified data read.
  • XNVM_EFUSE_ERR_INVALID_PARAM Input validation failure.
  • XNVM_EFUSE_ERR_CACHE_PARITY Parity Error exist in cache.

Referenced by XNvm_EfuseReadDna(), XNvm_EfuseReadIv(), XNvm_EfuseReadPpkHash(), XNvm_EfuseReadPuf(), and XNvm_EfuseReadUserFuses().

int XNvm_EfuseReadDecOnly ( u32 *  DecOnly)

This function is used to read DecEfuseOnly eFUSE bits from cache.

This function reads DEC only fuses from eFUSE cache.

Parameters
DecOnly- Pointer to the DecOnly efuse data.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_RD_DEC_ONLY Error in reading in Dec_only efuses.
Note
If DecOnly eFuse is programmed that means boot can happen in only Symmetric HWRoT boot mode.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the DecOnly eFuse to fill the input param. Return XST_SUCCESS if read success.

References XNVM_EFUSE_ERR_INVALID_PARAM, and XNVM_EFUSE_ERR_RD_DEC_ONLY.

int XNvm_EfuseReadDna ( XNvm_Dna *  EfuseDna)

This function is used to read Dna eFUSE bits from cache.

Parameters
EfuseDna- Pointer to the XNvm_Dna, which holds the read DNA.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid parameter.
  • XNVM_EFUSE_ERR_RD_DNA Error in reading DNA efuses.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the Dna to fill the Dna array. Return XST_SUCCESS if read success.

References XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_RD_DNA, and XNvm_EfuseReadCacheRange().

int XNvm_EfuseReadIv ( XNvm_Iv *  EfuseIv,
XNvm_IvType  IvType 
)

This function is used to read IV eFUSE bits from cache.

Parameters
EfuseIv- Pointer to the XNvm_Iv, which contains read IV data.
IvType- Iv to be read.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_RD_META_HEADER_IV_RANGE Error while reading MetaHeader IV.
  • XNVM_EFUSE_ERR_RD_BLACK_IV Error while reading BlkObfus IV.
  • XNVM_EFUSE_ERR_RD_PLM_IV_RANGE Error while reading PLM IV.
  • XNVM_EFUSE_ERR_RD_DATA_PARTITION_IV_RANGE Error while reading Data Partition IV.
  • XNVM_EFUSE_ERR_IN_ZEROIZATION Error in zeroization.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Based on user input IvType Reads the efuse cache. Fills EfuseIv structure. If read cache fails zeroize the EfuseIv data and return XST_FAILURE.

References XNVM_EFUSE_ERR_IN_ZEROIZATION, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_RD_BLACK_IV, XNVM_EFUSE_ERR_RD_DATA_PARTITION_IV_RANGE, XNVM_EFUSE_ERR_RD_META_HEADER_IV_RANGE, XNVM_EFUSE_ERR_RD_PLM_IV_RANGE, XNvm_EfuseReadCacheRange(), and XNvm_ZeroizeAndVerify().

int XNvm_EfuseReadMiscCtrlBits ( XNvm_EfuseMiscCtrlBits *  MiscCtrlBits)

This function is used to read the miscellaneous eFUSE control bits from cache.

Parameters
MiscCtrlBits- Pointer to the XNvm_MiscCtrlBits which holds the read secure control bits.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error while Cache reload.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the MiscCtrl to fill the MiscCtrlBits structure.

References XNVM_EFUSE_CACHE_MISC_CTRL_GD_HALT_BOOT_EN_1_0_MASK, and XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadOffchipRevokeId ( u32 *  OffchipIdPtr,
XNvm_OffchipId  OffchipIdNum 
)

This function reads the Offchip revoke eFuse value from eFUSE cache.

Parameters
OffchipIdPtr- Pointer to the data which hold the Offchip revoke ID values.
OffchipIdNum- Offchip fuse number to read.
Returns
  • XST_SUCCESS On successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error in Cache reload.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Calculate offchip_revoke id offset based on which revoke id value is requested.

Read directly from cache offset of the offchip revoke id offset to fill the OffchipIdPtr. Return XST_SUCCESS if the read is successful.

References XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadPpkHash ( XNvm_PpkHash *  EfusePpk,
XNvm_PpkType  PpkType 
)

This function reads the Ppk Hash from eFUSE cache.

Parameters
EfusePpk- Pointer to XNvm_PpkHash which holds the PpkHash from eFUSE Cache.
PpkType- Type of the Ppk to be programmed.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_RD_PPK_HASH Error while reading PPK Hash.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the mentioned ppk type to fill the ppk hash array. Return XST_SUCCESS if read success.

References XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_RD_PPK_HASH, and XNvm_EfuseReadCacheRange().

u32 XNvm_EfuseReadProtectionBits ( u32  Mask)

This function reads the corresponding eFuse protection bits.

Parameters
MaskEfuse Protection bit mask value.
Returns
Return protection bits value as specified by Mask

References XNVM_EFUSE_PROTECTION_BIT_CLEAR, XNVM_EFUSE_TBITS_XILINX_CTRL_ROW, and XNvm_EfuseReadReg().

int XNvm_EfuseReadPuf ( XNvm_EfusePufHd PufHelperData)

This function reads the PUF helper data from eFUSE cache.

Parameters
PufHelperData- Pointer to XNvm_EfusePufHd which holds the PUF helper data read from eFUSEs.
Returns
  • XST_SUCCESS On successful read.
  • XNVM_EFUSE_ERR_RD_PUF_SYN_DATA Error while reading SYN_DATA.
  • XNVM_EFUSE_ERR_RD_PUF_CHASH Error while reading CHASH.
  • XNVM_EFUSE_ERR_RD_PUF_AUX Error while reading AUX.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Puf Syndrome eFuses are in Page 2 of eFuse memory map, hence effective row should be calculated to read correct eFuses.

Read directly from cache offset of the PUF syndrome data, Chash and Aux data to fill the PufHelperData structure. Return XST_SUCCESS if read is successful.

References XNvm_EfusePufHd::Aux, XNvm_EfusePufHd::Chash, XNvm_EfusePufHd::EfuseSynData, XNVM_EFUSE_ERR_IN_ZEROIZATION, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_RD_PUF_AUX, XNVM_EFUSE_ERR_RD_PUF_CHASH, XNVM_EFUSE_ERR_RD_PUF_SYN_DATA, XNVM_EFUSE_PAGE_2, XNvm_EfuseReadCacheRange(), and XNvm_ZeroizeAndVerify().

int XNvm_EfuseReadPufSecCtrlBits ( XNvm_EfusePufSecCtrlBits *  PufSecCtrlBits)

This function is used to read the Puf eFUSE secure control bits from cache.

Parameters
PufSecCtrlBits- Pointer to the XNvm_PufSecCtrlBits, which holds the read secure control bits.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error while Cache reload.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the PUF_ECC_PUF_CTRL and also SEC_CRTL to fill the PufSecCtrlBits structure. Return XST_SUCESS if read is success.

References XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadRevocationId ( u32 *  RevokeFusePtr,
XNvm_RevocationId  RevokeFuseNum 
)

This function reads the Revocation Fuse from eFUSE cache.

Parameters
RevokeFusePtr- Pointer to the data which hold the Revocation IDs from eFUSE Cache.
RevokeFuseNum- Revocation ID fuse number to read.
Returns
  • XST_SUCCESS On successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error in Cache reload.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the Revocation Id to fill the Revocation Id array. Return XST_SUCCESS if the read is successful.

References XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadSecCtrlBits ( XNvm_EfuseSecCtrlBits *  SecCtrlBits)

This function is used to read the eFUSE secure control bits from cache.

This function reads secure control bits and CRC_EN register bits from eFUSE cache.

Parameters
SecCtrlBits- Pointer to the Xnvm_SecCtrlBits which holds the read secure control bits.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error while Cache reload.

Perform input parameter validation. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read Directly from cache offset of security control to fill the SecCtrlBits structure. Return XST_SUCCESS if read is success.

References XNVM_EFUSE_CACHE_SECURITY_CONTROL_REG_INIT_DIS_1_0_MASK, and XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadSecMisc1Bits ( XNvm_EfuseSecMisc1Bits *  SecMisc1Bits)

This function is used to read the security miscellaneous1 bits from cache.

Parameters
SecMisc1Bits- Pointer to the XNvm_EfuseSecMisc1Bits which holds the security miscellaneous1 control bits.
Returns
  • XST_SUCCESS On Successful read.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error while Cache reload.

Perform input parameter validation. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read Directly from cache offset of SEC_MISC1 to fill SecMisc1Bits structure.

References XNVM_EFUSE_CACHE_SEC_MISC_1_LPD_MBIST_EN_2_0_MASK, and XNVM_EFUSE_ERR_INVALID_PARAM.

int XNvm_EfuseReadUserFuses ( const XNvm_EfuseUserData UserFusesData)

This function reads User eFuses from Cache.

Parameters
UserFusesData- UserFuseData to be read from eFuse Cache.
Returns
  • XST_SUCCESS If reads successfully.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_RD_USER_FUSES Error in reading User fuses.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read directly from cache offset of the User Data eFuse to fill the UserFuseData address from specified UserFuse number (StartUserFuseNum) and number of eFuses to be read by NumOfUserFuses. Return XST_SUCCESS if the read is successful.

References XNvm_EfuseUserData::NumOfUserFuses, XNvm_EfuseUserData::StartUserFuseNum, XNvm_EfuseUserData::UserFuseData, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_RD_USER_FUSES, XNvm_EfuseReadCacheRange(), XNVM_NUM_OF_USER_FUSES, XNVM_USER_FUSE_END_NUM, and XNVM_USER_FUSE_START_NUM.

int XNvm_EfuseResetReadMode ( void  )

This function disables Margin Read mode of eFUSE controller.

Returns
XST_SUCCESS - if resetting read mode is successful. XST_FAILURE - if there is a failure
  • XST_SUCCESS If resetting read mode is successful.
  • XST_FAILURE If there is a failure

Read EFUSE_CFG_REG

Reset Read mode from margin read mode by writing the EFUSE_CFG_REG

Read EFUSE_CFG_REG register.

Reset read mode from margin read mode by writing the EFUSE_CFG_REG.

References XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWrite(), and XNvm_EfuseWritePuf().

int XNvm_EfuseRevokePpk ( XNvm_PpkType  PpkRevoke,
XSysMonPsv *  SysMonInstPtr 
)

This function revokes the Ppk.

Parameters
PpkRevoke- Xnvm_RevokePpkFlags that tells which Ppk to revoke.
SysMonInstPtr- Pointer to the XSysMonPsv structure which contains XSysmonPsv driver instance data
Returns
  • XST_SUCCESS On Successful Revocation.
  • XNVM_EFUSE_ERR_INVALID_PARAM Input validation failure.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Fill the XNvm_EfuseMiscCtrlBits structure with PPK INVLD inputs from user and fill the XNvm_EfuseData global structure with the MiscCtrlBits structure and call XNvm_EfuseWrite API. Return the Status.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming Non-NULL indicates, perform Temp and Volt monitoring

References XNvm_EfuseData::EnvMonitorDis, XNvm_EfuseData::MiscCtrlBits, XNvm_EfuseData::SysMonInstPtr, XNVM_EFUSE_ERR_INVALID_PARAM, and XNvm_EfuseWrite().

int XNvm_EfuseSetReadMode ( XNvm_EfuseRdMode  RdMode)

This function sets read mode of eFUSE controller.

Parameters
RdMode- Mode to be used for eFUSE read.
Returns
  • XST_SUCCESS If Setting read mode is successful.
  • XST_FAILURE If there is a failure

Read EFUSE_CFG_REG register.

Read modify and write to EFUSE_CFG_REG to set the read mode.

Read back to check if the write is success, if success return XST_SUCCESS else return error.

References XNVM_EFUSE_NORMAL_RD, XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET, XNVM_EFUSE_SEC_DEF_VAL_BYTE_SET, and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseSetupController().

void XNvm_EfuseSetRefClk ( void  )

This function sets reference clock of eFUSE controller.

Set Reference clock for efuse by writing to EFUSE_REF_CLK_REG

References XNvm_EfuseWriteReg().

Referenced by XNvm_EfuseSetupController().

int XNvm_EfuseSetupController ( XNvm_EfuseOpMode  Op,
XNvm_EfuseRdMode  RdMode 
)

This function setups eFUSE controller for given operation and read mode.

Parameters
Op- Operation to be performed read/program(write).
RdMode- Read mode for eFUSE read operation.
Returns
- XST_SUCCESS - eFUSE controller setup for given op.
  • XNVM_EFUSE_ERR_UNLOCK - Failed to unlock eFUSE controller register access.
Parameters
Op- Operation to be performed read/program(write).
RdMode- Read mode for eFUSE read operation.
Returns
  • XST_SUCCESS eFUSE controller setup for given op.
  • XNVM_EFUSE_ERR_UNLOCK Failed to unlock eFUSE controller register access.
  • XST_FAILURE If eFUSE controller is not unlocked
  • XNVM_EFUSE_ERR_PGM_TBIT_PATTERN If TBITS pattern is not matched with the expected value.

Unlock eFuse controller to write into eFuse registers

Set Read mode

Initialize eFuse Timers

Enable programming of Xilinx reserved eFuse

Check for T bits enabled

Unlock eFuse controller to write into eFuse registers.

Disable power down mode and set reference clock to eFuse.

Set read mode.

Initialize eFuse Timers.

Enable programming of Xilinx reserved eFuse.

Check for T bits for the expected pattern.

References XNVM_EFUSE_MODE_PGM, XNvm_EfuseCheckForTBits(), XNvm_EfuseDisablePowerDown(), XNvm_EfuseEnableProgramming(), XNvm_EfuseInitTimers(), XNvm_EfuseSetReadMode(), XNvm_EfuseSetRefClk(), XNvm_EfuseUnlockController(), and XNvm_EfuseWriteReg().

Referenced by XNvm_EfuseCacheLoadNPrgmProtectionBits(), XNvm_EfuseWrite(), XNvm_EfuseWriteAesKey(), XNvm_EfuseWriteBootEnvCtrlBits(), XNvm_EfuseWriteBootModeDisable(), XNvm_EfuseWriteCrc(), XNvm_EfuseWriteDecOnly(), XNvm_EfuseWriteDisableInplacePlmUpdate(), XNvm_EfuseWriteDmeMode(), XNvm_EfuseWriteDmeRevoke(), XNvm_EfuseWriteDmeUserKey(), XNvm_EfuseWriteFipsInfo(), XNvm_EfuseWriteGlitchConfigBits(), XNvm_EfuseWriteIv(), XNvm_EfuseWriteMisc1Bits(), XNvm_EfuseWriteMiscCtrlBits(), XNvm_EfuseWriteOffChipRevokeID(), XNvm_EfuseWritePpkHash(), XNvm_EfuseWritePuf(), XNvm_EfuseWritePufSecCtrl(), XNvm_EfuseWriteRevocationID(), XNvm_EfuseWriteRomRsvdBits(), XNvm_EfuseWriteSecCtrlBits(), and XNvm_EfuseWriteUds().

int XNvm_EfuseTempAndVoltChecks ( const XSysMonPsv *  SysMonInstPtr)

This function performs the Temparature and Voltage checks to ensure that they are in limits before eFuse programming.

Parameters
SysMonInstPtr- Pointer to SysMon instance.
Returns
  • XST_SUCCESS On successful Voltage and Temparature checks.
  • XNVM_EFUSE_ERR_INVALID_PARAM Input validation failure.
  • XNVM_EFUSE_ERROR_READ_VOLTAGE_OUT_OF_RANGE Voltage is out of range
  • XNVM_EFUSE_ERROR_READ_TMEPERATURE_OUT_OF_RANGE Temparature is out of range

Get the sysmon supply register id.

If supply register id is 0xFFFFFFFF, supply is not enabled, return error.

If supplies are enabled for monitoring, get the new data for the supply. If no new data is available, return error.

Else, clear the New data flag if its set

Read the raw voltage value from the supply.

Convert raw to voltage.

Check for voltage operating limits. Return error if voltage is not withing operating limits.

Read the raw temparature value from the sysmon satellite.

Convert IntegralPart and FractionalPart to absolute values.

Check for temparature operating limits. Return error if temparature is not withing operating limits.

References XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERROR_NO_SUPPLIES_ENABLED, XNVM_EFUSE_ERROR_READ_TMEPERATURE_OUT_OF_RANGE, XNVM_EFUSE_ERROR_READ_VOLTAGE_OUT_OF_RANGE, XNVM_EFUSE_ERROR_SYSMON_NO_NEW_DATA, XNVM_EFUSE_FRACTION_MUL_VALUE, XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET, XNVM_EFUSE_SYSMON_NUM_SUPPLIES_PER_FLAG, XNVM_EFUSE_SYSMONPSV_TIMEOUT, XNVM_EFUSE_WORD_LEN, and XNvm_GetSysmonSupplyRegId().

Referenced by XNvm_EfuseWrite(), XNvm_EfuseWriteAesKey(), XNvm_EfuseWriteBootEnvCtrlBits(), XNvm_EfuseWriteBootModeDisable(), XNvm_EfuseWriteCrc(), XNvm_EfuseWriteDecOnly(), XNvm_EfuseWriteDisableInplacePlmUpdate(), XNvm_EfuseWriteDmeMode(), XNvm_EfuseWriteDmeRevoke(), XNvm_EfuseWriteDmeUserKey(), XNvm_EfuseWriteFipsInfo(), XNvm_EfuseWriteGlitchConfigBits(), XNvm_EfuseWriteIv(), XNvm_EfuseWriteMisc1Bits(), XNvm_EfuseWriteMiscCtrlBits(), XNvm_EfuseWriteOffChipRevokeID(), XNvm_EfuseWritePpkHash(), XNvm_EfuseWritePuf(), XNvm_EfuseWritePufSecCtrl(), XNvm_EfuseWriteRevocationID(), XNvm_EfuseWriteRomRsvdBits(), XNvm_EfuseWriteSecCtrlBits(), and XNvm_EfuseWriteUds().

int XNvm_EfuseWrite ( const XNvm_EfuseData WriteNvm)

This function is used as a wrapper to program below eFuses AES key User key 0 User key 1 PPK0/PPK1/PPK2/PPK3/PPK4 hash IVs Revocation Ids User Fuses Secure and Control bits.

            Miscellaneous Control bits.
            Security Miscellaneous1 bits.
            BootEnvCtrl bits.
Parameters
WriteNvm- Pointer to Efuse data to be written.
Returns
  • XST_SUCCESS On Specified data write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED If nothing is programmed.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING If error before programming.
  • XNVM_EFUSE_ERR_LOCK Lock eFUSE Control Register.
Warning
After eFUSE programming is complete, the cache is automatically reloaded so all programmed eFUSE bits can be directly read from cache. If there is any CACHE_ERROR, user can reboot the system to reload the cache.

Check for input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming. Non-NULL indicates, perform Temp and Volt monitoring.

Perform Environmental monitoring checks.

Unlock Efuse controller.

Validate all the write requests for AesKeys, PPK hash 0/1/2/3/4, Revocation Ids, Ivs, DecOnly, User eFuses, Glitch configuration, BootEnvCtrl, Misc1 Ctrl and offchip revocation eFuses.

Check if GlitchCfgBits user config is NULL, else program Glitch configuration, glitch detection wrlk , glitch gdrommonen and glitch haltbooten eFUSEs.

Check for AesKeys configuration, if NULL do nothing else program aes key eFUSE with the user provided data.

Check for PpkHash configuration, if NULL do nothing else program ppk hash eFUSEs with the user provided data.

Check for Ivs configuration, if NULL do nothing else program IV eFUSE with the user provided data.

Check for DecOnly configuration, if NULL do nothing else program DecOnly eFUSEs.

Check for RevokeIds configuration, if NULL do nothing else program RevocationID eFUSEs with the user provided data.

Check for OffChipIds configuration, if NULL do nothing else program OffChipID eFUSEs with the user provided data.

Check for MiscCtrlBits configuration, if NULL do nothing else program MiscCtrl eFUSEs with the user provided data.

Check for UserFuses configuration, if NULL do nothing else program user eFUSEs with the user provided data.

Check for Misc1Bits configuration, if NULL do nothing else program Misc1Ctrl eFUSEs with the user provided data.

Check for BootEnvCtrl configuration, if NULL do nothing else program BootEnvCtrl eFUSEs with the user provided data.

Check for SecCtrlBits configuration, if NULL do nothing else program SecCtrl eFUSEs with the user provided data.

Reload the eFUSE cache.

Program the Protection Row Efuses.

Reset Read mode.

Disable programming mode.

Lock Efuse controller.

References XNvm_EfuseData::AesKeys, XNvm_EfuseData::BootEnvCtrl, XNvm_EfuseData::DecOnly, XNvm_EfuseData::EnvMonitorDis, XNvm_EfuseData::GlitchCfgBits, XNvm_EfuseData::Ivs, XNvm_EfuseData::Misc1Bits, XNvm_EfuseData::MiscCtrlBits, XNvm_EfuseData::OffChipIds, XNvm_EfuseData::PpkHash, XNvm_EfuseData::RevokeIds, XNvm_EfuseData::SecCtrlBits, XNvm_EfuseData::SysMonInstPtr, XNvm_EfuseData::UserFuses, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNvm_EfuseDisableProgramming(), XNvm_EfuseLockController(), XNvm_EfuseResetReadMode(), XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteAesKey ( u32  EnvDisFlag,
XNvm_AesKeyType  KeyType,
XNvm_AesKey *  EfuseKey 
)

This function is used to take care of prerequisites to program below eFuses AES key User key 0 User key 1.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user. when set to true it will not check for voltage and temparature limits.
KeyType- Type of key to be programmed(AesKey/UserKey0/UserKey1)
EfuseKey- Pointer to the XNvm_AesKey structure, which holds Aes key to be programmed to eFuse.
Returns
  • XST_SUCCESS On Successful Write.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming eFuse.
  • XNVM_EFUSE_ERR_WRITE_AES_KEY Error while writing AES key.
  • XNVM_EFUSE_ERR_WRITE_USER_KEY0 Error while writing User key0.
  • XNVM_EFUSE_ERR_WRITE_USER_KEY1 Error while writing User key1.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse controller. On error return appropriate failure code.

Validate the Aes write request before writing AES into eFuse. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, if not success.

Program Aes key into eFuse.

Lock eFuse Controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseValidateAesKeyWriteReq().

int XNvm_EfuseWriteBootEnvCtrlBits ( u32  EnvDisFlag,
u32  BootEnvCtrlBits 
)

This function programs BootEnvCtrl eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
BootEnvCtrlBits- BootEnvCtrl data to be written to eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_BOOT_ENV_CTRL Error while writing BootEnvCtrl Bits
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Compute BootEnvCtrl programmable bits to program.

Program and verify miscellaneous 1 controls bits. Return XNVM_EFUSE_ERR_WRITE_BOOT_ENV_CTRL upon failure.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_BOOT_ENV_CTRL, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteBootModeDisable ( u32  EnvDisFlag,
u32  BootModeMask 
)

This function programs BootModeDisable eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
BootModeMask- BootModeMask to be programmed to BootModeDisable eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_BOOT_MODE_DISABLE Error while writing BootModeDisable eFuses.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify boot mode disable data.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_BOOT_MODE_DISABLE, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteCrc ( u32  EnvDisFlag,
u32  Crc 
)

This function programs EFUSE_CRC_SALT eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
Crc- Crc value to be written.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_CRC_SALT Error while writing Crc salt eFuses.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks

Read CRC eFUSE cache offset. Return XNVM_EFUSE_ERR_WRITE_CRC | XNVM_EFUSE_ERR_BEFORE_PROGRAMMING if crc non zero.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify Uds Crc data. Return XNVM_EFUSE_ERR_WRITE_CRC upon failure.

Program and verify Uds Crc salt data. Return XNVM_EFUSE_ERR_WRITE_CRC_SALT upon failure.

Lock eFuse controller.

References XNVM_EFUSE_CRC_SALT, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_CRC, XNVM_EFUSE_ERR_WRITE_CRC_SALT, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseReadReg(), XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteDecOnly ( u32  EnvDisFlag)

This function is used to program below DEC_ONLY fuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temparature limits.
Returns
  • XST_SUCCESS If DEC_ONLY eFuse is programmed successfully.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_WRITE_DEC_EFUSE_ONLY Error in DEC_ONLY programming.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error in Cache reload after programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Validate Decrypt only request before programming. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, if not success.

Program and verify decrypt only data. Return XNVM_EFUSE_ERR_WRITE_DEC_EFUSE_ONLY upon failure.

Lock eFuse controller.

References XNVM_EFUSE_CACHE_DEC_EFUSE_ONLY_MASK, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_DEC_EFUSE_ONLY, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseValidateDecOnlyRequest().

int XNvm_EfuseWriteDisableInplacePlmUpdate ( u32  EnvDisFlag)

This function programs PLM_UPDATE eFuse.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_PLM_UPDATE Error while writing PlmUpdate eFuse.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify Plm update data.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_PLM_UPDATE, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteDmeMode ( u32  EnvDisFlag,
u32  DmeMode 
)

This function programs DmeMode eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
DmeMode- DmeMode eFuses to be written.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_DME_MODE Error while writing DmeMode eFuse.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify dme mode data

Lock eFuse controller

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_DME_MODE, XNVM_EFUSE_ERROR_DME_NOT_SUPPORTED, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteDmeRevoke ( u32  EnvDisFlag,
XNvm_DmeRevoke  RevokeNum 
)

This function programs DME Revoke eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
RevokeNum- DmeRevoke eFuse number.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.
  • XNVM_EFUSE_ERR_WRITE_DME_REVOKE_0 Error while writing DmeRevoke 0.
  • XNVM_EFUSE_ERR_WRITE_DME_REVOKE_1 Error while writing DmeRevoke 1.
  • XNVM_EFUSE_ERR_WRITE_DME_REVOKE_2 Error while writing DmeRevoke 2.
  • XNVM_EFUSE_ERR_WRITE_DME_REVOKE_3 Error while writing DmeRevoke 3.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Perform environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify dme revoke data.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_DME_REVOKE_0, XNVM_EFUSE_ERROR_BYTE_SHIFT, XNVM_EFUSE_ERROR_DME_NOT_SUPPORTED, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteDmeUserKey ( u32  EnvDisFlag,
XNvm_DmeKeyType  KeyType,
XNvm_DmeKey *  EfuseKey 
)

This function programs DME userkey eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
KeyType- DME Key type DME_USER_KEY_0/1/2/3
EfuseKey- Pointer to DME userkey structure.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM, if input parameters are invalid.

Perform Environmental monitoring checks.

Check if DmeMode eFuse is programmed. If yes, return failure.

Else unlock eFuse controller. Return appropriate error code if not success.

Program dme user key into eFuse.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERROR_DME_NOT_SUPPORTED, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_IsDmeModeEn().

int XNvm_EfuseWriteFipsInfo ( u32  EnvDisFlag,
u32  FipsMode,
u32  FipsVersion 
)

This function is used to to take care of prerequisitis to program FIPS mode and FIPS version eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
FipsMode- Fips mode to be written to eFuses.
FipsVersion- Fips version to be written to eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Validate Fips information. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING upon failure.

Program Fips information into eFuse.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MAX_FIPS_MODE, XNVM_EFUSE_MAX_FIPS_VERSION, XNVM_EFUSE_MODE_PGM, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseValidateFipsInfo().

int XNvm_EfuseWriteGlitchConfigBits ( u32  EnvDisFlag,
u32  GlitchConfig 
)

This function is used to program Glitch Configuration given by the user.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user. when set to true it will not check for voltage and temparature limits.
GlitchConfig- Pointer to the Glitch configuration
Returns
  • XST_SUCCESS On Successful Write.
  • XNVM_EFUSE_ERR_WRITE_GLITCH_CFG Error in programming of glitch configuration.
  • XNVM_EFUSE_ERR_WRITE_GLITCH_WRLK Error in programming glitch write lock.

Perform Environmental monitoring checks.

Unlock eFuse controller. On error return appropriate failure code.

Compute glitch config programmable bits to program.

Program and verify the glitch config bits.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_GLITCH_CFG, XNVM_EFUSE_ERR_WRITE_GLITCH_WRLK, XNVM_EFUSE_GLITCH_CONFIG_DATA_MASK, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteIv ( u32  EnvDisFlag,
XNvm_IvType  IvType,
XNvm_Iv *  EfuseIv 
)

This function is used to to take care of prerequisitis to program below IV eFuses XNVM_EFUSE_ERR_WRITE_META_HEADER_IV XNVM_EFUSE_ERR_WRITE_BLK_OBFUS_IV XNVM_EFUSE_ERR_WRITE_PLM_IV XNVM_EFUSE_ERR_WRITE_DATA_PARTITION_IV.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user. when set to true it will not check for voltage and temparature limits.
IvType- Type of IV eFuses to be programmmed
EfuseIv- Pointer to the XNvm_EfuseIvs structure which holds IV to be programmed to eFuse.
Returns
  • XST_SUCCESS On Successful Write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_WRITE_META_HEADER_IV Error while writing Meta Iv.
  • XNVM_EFUSE_ERR_WRITE_BLK_OBFUS_IV Error while writing BlkObfus IV.
  • XNVM_EFUSE_ERR_WRITE_PLM_IV Error while writing PLM IV.
  • XNVM_EFUSE_ERR_WRITE_DATA_PARTITION_IV Error while writing Data Partition IV.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM, if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse controller. On error return appropriate failure code.

Validate IVs write request before writing IVs into eFuse. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, if not success.

Program IVs into eFuse.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseValidateIvWriteReq().

int XNvm_EfuseWriteIVs ( XNvm_EfuseIvs *  EfuseIv,
XSysMonPsv *  SysMonInstPtr 
)

This function programs the eFUSEs with the IV.

Parameters
EfuseIv- Pointer to the XNvm_EfuseIvs, which contains IVs data to be written to the Efuse..
SysMonInstPtr- Pointer to the XSysMonPsv structure which contains XSysmonPsv driver instance data
Returns
  • XST_SUCCESS On Successful Write.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_WRITE_META_HEADER_IV Error while writing MetaHeader Iv.
  • XNVM_EFUSE_ERR_WRITE_BLK_OBFUS_IV Error while writing BlkObfus IV.
  • XNVM_EFUSE_ERR_WRITE_PLM IV Error while writing PLM IV.
  • XNVM_EFUSE_ERR_WRITE_DATA_PARTITION_IV Error while writing Data Partition IV.
  • XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED If NULL request is sent.

Validate Input parameters. Return XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED if input parameters are invalid.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming. Non-NULL indicates, perform Temp and Volt monitoring.

Fill the EfuseData structure with the IV address, Environmental disable flag and remaining as NULL.

Fill the XNvm_EfuseData global structure with the EfuseIv structure and call XNvm_EfuseWrite API. Return the Status.

References XNvm_EfuseData::EnvMonitorDis, XNvm_EfuseData::Ivs, XNvm_EfuseData::SysMonInstPtr, XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED, and XNvm_EfuseWrite().

int XNvm_EfuseWriteMisc1Bits ( u32  EnvDisFlag,
u32  Misc1Bits 
)

This function programs Misc1Ctrl eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
Misc1Bits- Misc1Bits data to be written to eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_MISC1_CTRL_BITS Error while writing Misc1CtrlBits
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Compute security misc1 programmable bits to program.

Program and verify miscellaneous 1 controls bits. Return XNVM_EFUSE_ERR_WRITE_MISC1_CTRL_BITS upon failure.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_MISC1_CTRL_BITS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteMiscCtrlBits ( u32  EnvDisFlag,
u32  MiscCtrlBits 
)

This function programs MiscCtrl eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
MiscCtrlBits- MiscCtrl data to be written to eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_MISC_CTRL_BITS Error while writing MiscCtrlBits
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Compute MiscCtrl programmable bits to program.

Program and verify miscellaneous control bits. Return XNVM_EFUSE_ERR_WRITE_MISC_CTRL_BITS upon failure.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_MISC_CTRL_BITS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteOffChipRevokeID ( u32  EnvDisFlag,
u32  OffchipIdNum 
)

This function programs OffChip Revoke eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
OffchipIdNum- OffchipIdNum number to program OffchipId eFuses.
Returns
  • XST_SUCCESS On successful write of OffChipId.
  • XNVM_EFUSE_ERR_WRITE_OFFCHIP_REVOKE_IDS Error in writing OffChipId eFuses.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_CACHE_PARITY Error in Cache reload.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM, if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Program and verify revocation Ids data. Return XNVM_EFUSE_ERR_WRITE_OFFCHIP_REVOKE_IDS upon failure.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_OFFCHIP_REVOKE_IDS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNVM_MAX_REVOKE_ID_FUSES.

int XNvm_EfuseWritePpkHash ( u32  EnvDisFlag,
XNvm_PpkType  PpkType,
XNvm_PpkHash *  EfuseHash 
)

This function is used to to take care of prerequisitis to program below eFuses PPK0_HASH PPK1_HASH PPK2_HASH.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user. when set to true it will not check for voltage and temparature limits.
PpkType- Type of ppk hash to be programmed(PPK0/PPK1/PPK2)
EfuseHash- Pointer to the XNvm_PpkHash structure which holds PPK hash to be programmed to eFuse.
Returns
  • XST_SUCCESS On Successful Write.
  • XNVM_EFUSE_ERR_WRITE_PPK0_HASH Error while writing PPK0 Hash.
  • XNVM_EFUSE_ERR_WRITE_PPK1_HASH Error while writing PPK1 Hash.
  • XNVM_EFUSE_ERR_WRITE_PPK2_HASH Error while writing PPK2 Hash.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM, if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse controller. On error return appropriate failure code.

Validate the PPK hash write request before writing PPK into eFuse. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, if not success.

Program PPK hash into eFuse.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseValidatePpkHashWriteReq().

int XNvm_EfuseWritePuf ( const XNvm_EfusePufHd PufHelperData)

This function programs the eFUSEs with the PUF helper data.

Parameters
PufHelperData- Pointer to the Puf helper data to be written to eFuse.
Returns
  • XST_SUCCESS If programs successfully.
  • XNVM_EFUSE_ERR_INVALID_PARAM Input validation failure
  • XNVM_EFUSE_ERR_RD_PUF_SEC_CTRL Error while reading PufSecCtrl.
  • XNVM_EFUSE_ERR_WRITE_PUF_HELPER_DATA Error while writing Puf helper data.
  • XNVM_EFUSE_ERR_WRITE_PUF_SYN_DATA Error while writing Puf Syndata.
  • XNVM_EFUSE_ERR_WRITE_PUF_CHASH Error while writing Puf Chash.
    • XNVM_EFUSE_ERR_WRITE_PUF_AUX Error while writing Puf Aux.
  • XNVM_EFUSE_ERR_FUSE_PROTECTED Error if Puf is protected from write
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming
Note
To generate PufSyndromeData please use XPuf_Registration API.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Read from cache offset of Puf SecCtrl bits.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming Non-NULL indicates, perform Temp and Volt monitoring.

Check Environmental monitoring checks for temperature and voltage.

Unlock Efuse controller.

Set eFuse controller parameters for efuse write operation.

Programming Puf Security control bits.

Reload the cache once the programming of all the efuses requested are programmed.

Program Corresponding Protection Row eFuses.

Reset Read mode.

Disable eFuse programming mode.

Lock eFuse controller.

References XNvm_EfusePufHd::Aux, XNvm_EfusePufHd::Chash, XNvm_EfusePufHd::EfuseSynData, XNvm_EfusePufHd::EnvMonitorDis, XNvm_EfusePufHd::PrgmPufHelperData, XNvm_EfusePufHd::PrgmPufSecCtrlBits, XNvm_EfusePufHd::PufSecCtrlBits, XNvm_EfusePufHd::SysMonInstPtr, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_FUSE_PROTECTED, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_PUF_AUX, XNVM_EFUSE_ERR_WRITE_PUF_CHASH, XNVM_EFUSE_ERR_WRITE_PUF_HELPER_DATA, XNVM_EFUSE_ERR_WRITE_PUF_SYN_DATA, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET, XNvm_EfuseDisableProgramming(), XNvm_EfuseLockController(), XNvm_EfuseResetReadMode(), XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWritePuf ( const XNvm_EfusePufHdAddr PufHelperData)

This function programs PUF ctrl and PUF helper data, Chash and Aux.

Parameters
PufHelperData- Pointer to XNvm_EfusePufHdAddr structure
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_PUF_HELPER_DATA Error while writing Puf helper data.
  • XNVM_EFUSE_ERR_WRITE_PUF_SYN_DATA Error while writing Puf Syndata.
  • XNVM_EFUSE_ERR_WRITE_PUF_CHASH Error while writing Puf Chash.
  • XNVM_EFUSE_ERR_WRITE_PUF_AUX Error while writing Puf Aux.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.
Note
To generate PufSyndromeData please use XPuf_Registration API.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Unlock eFuse Controller. Return appropriate error code if not success.

Read directly from cache offset of the PufCtrl data.

Perform Environmental monitoring checks.

Check if Puf helper data is empty. Return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING if empty.

Write puf syndrome data into eFuse. Return XNVM_EFUSE_ERR_WRITE_PUF_SYN_DATA upon failure.

Write puf chash data into eFuse. Return XNVM_EFUSE_ERR_WRITE_PUF_CHASH upon failure.

Write puf aux into eFuse. Return XNVM_EFUSE_ERR_WRITE_PUF_AUX upon failure.

Write puf RoSwap data into eFuse. Return XNVM_EFUSE_ERR_WRITE_RO_SWAP upon failure.

Lock eFuse controller.

References XNvm_EfusePufHdAddr::Aux, XNvm_EfusePufHdAddr::Chash, XNvm_EfusePufHdAddr::EfuseSynData, XNvm_EfusePufHdAddr::EnvMonitorDis, XNvm_EfusePufHdAddr::PrgmPufHelperData, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_FUSE_PROTECTED, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_PUF_AUX, XNVM_EFUSE_ERR_WRITE_PUF_CHASH, XNVM_EFUSE_ERR_WRITE_PUF_HELPER_DATA, XNVM_EFUSE_ERR_WRITE_PUF_SYN_DATA, XNVM_EFUSE_ERR_WRITE_RO_SWAP, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET, XNvm_EfuseIsPufHelperDataEmpty(), XNvm_EfuseReadReg(), XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWritePufSecCtrl ( u32  EnvDisFlag,
u32  PufCtrlBits 
)

This function programs Puf control bits specified by user.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
PufCtrlBits- PufCtrlBits input to be programmed
Returns
  • XST_SUCCESS On success.
  • XNVM_EFUSE_ERR_INVALID_PARAM Invalid parameter.
  • XNVM_EFUSE_ERR_WRITE_PUF_REGEN_DIS Error while writing PUF_REGEN_DIS.
  • XNVM_EFUSE_ERR_WRITE_PUF_HD_INVLD Error while writing PUF_HD_INVLD.
  • XNVM_EFUSE_ERR_WRITE_PUF_SYN_LK Error while writing PUF_SYN_LK.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Unlock eFuse Controller. Return appropriate error code if not success.

Perform Environmental monitoring checks.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_PUF_SEC_CTRL_BITS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNVM_EFUSE_PUF_CTRL_PUF_HD_INVLD_MASK, XNVM_EFUSE_PUF_CTRL_PUF_REGEN_DIS_MASK, XNVM_EFUSE_PUF_CTRL_PUF_REGIS_DIS_MASK, XNVM_EFUSE_PUF_SEC_CTRL_INVLD_MASK, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNvm_EfuseWritePufSecCtrl().

Referenced by XNvm_EfuseWritePufSecCtrl().

int XNvm_EfuseWriteRevocationID ( u32  EnvDisFlag,
u32  RevokeIdNum 
)

This function writes Revocation eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
RevokeIdNum- RevokeId number to program Revocation Id eFuses.
Returns
  • XST_SUCCESS On successful write to eFuse.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_LOCK Error while Locking the controller.
Note
Example: If the revoke id to program is 64, it will program the 0th bit of the REVOCATION_ID_2 eFuse row.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM, if input parameters are invalid.

Perform Environmental monitoring checks.

Unlock eFuse controller. Return appropriate error code upon failure.

Compute start column and row offset values.

Calculate the Row and Column numbers based on the revoke id number input provided.

Program revocation Ids data. Return XNVM_EFUSE_ERR_WRITE_REVOCATION_IDS upon failure.

Lock eFuse controller.

References XNVM_EFUSE_BITS_IN_A_BYTE, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_REVOCATION_IDS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_PROGRAM_VERIFY, XNVM_EFUSE_REVOKE_ID_127, XNvm_EfuseSetupController(), XNvm_EfuseTempAndVoltChecks(), and XNVM_MAX_REVOKE_ID_FUSES.

int XNvm_EfuseWriteRevocationId ( u32  RevokeId,
XSysMonPsv *  SysMonInstPtr 
)

This function writes Revocation eFuses.

Parameters
RevokeId- RevokeId number to program Revocation Id eFuses.
SysMonInstPtr- Pointer to the XSysMonPsv structure which contains XSysmonPsv driver instance data
Returns
  • XST_SUCCESS On successful write to eFuse.
  • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid Parameter.
  • XNVM_EFUSE_ERR_LOCK Error while Locking the controller.
Note
Example: If the revoke id to program is 64, it will program the 0th bit of the REVOCATION_ID_2 eFuse row.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Calculate the REVOCATION_ID eFuse row and the column based on the input provided.

Fill the XNvm_EfuseRevokeIds structure with the calculated inputs and fill the XNvm_EfuseData global structure with the XNvm_EfuseRevokeIds and call XNvm_EfuseWrite API. Return the Status.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming. Non-NULL indicates, perform Temp and Volt monitoring.

References XNvm_EfuseData::EnvMonitorDis, XNvm_EfuseData::RevokeIds, XNvm_EfuseData::SysMonInstPtr, XNVM_EFUSE_ERR_INVALID_PARAM, XNvm_EfuseWrite(), and XNVM_MAX_REVOKE_ID_FUSES.

int XNvm_EfuseWriteRomRsvdBits ( u32  EnvDisFlag,
u32  RomRsvdBits 
)

This function programs ROM Rsvd Bits eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
RomRsvdBits- RomRsvdBits to be programmed to RomRsvd eFUSE bits
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_ROM_RSVD Error while writing ROM Rsvd eFuse bits.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Compute programmable data for RomRsvd data.

Program and verify RomRsvdBits.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_ROM_RSVD_BITS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteSecCtrlBits ( u32  EnvDisFlag,
u32  SecCtrlBits 
)

This function programs SecCtrl eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
SecCtrlBits- SecCtrl data to be written to eFuses.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_SEC_CTRL_BITS Error while writing SecCtrlBits
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Perform Environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Compute secure control programmable bits to program.

Program and verify security controls bits. Return XNVM_EFUSE_ERR_WRITE_SEC_CTRL_BITS upon failure.

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_WRITE_SEC_CTRL_BITS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteUds ( u32  EnvDisFlag,
XNvm_Uds *  EfuseUds 
)

This function programs UDS eFuses.

Parameters
EnvDisFlag- Environmental monitoring flag set by the user, when set to true it will not check for voltage and temperature limits.
EfuseUds- Pointer to the XNvm_Uds structure.
Returns
  • XST_SUCCESS On successful write.
  • XNVM_EFUSE_ERR_WRITE_UDS On failure in UDS write.
    • XNVM_EFUSE_ERR_INVALID_PARAM On Invalid input parameter.
  • XNVM_EFUSE_ERR_BEFORE_PROGRAMMING Error before programming.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

Perform environmental monitoring checks.

Unlock eFuse Controller. Return appropriate error code if not success.

Read security ctrl efuse cache register and check if UDS_WR_LK is programmed. If yes, return XNVM_EFUSE_ERR_BEFORE_PROGRAMMING else proceed for UDS programming.

Program and verify UDS data.

Reload cache and check protection bits.

Calculate CRC for UDS data.

Check UDS Crc. Return XNVM_EFUSE_ERR_WRITE_UDS upon failure

Lock eFuse controller.

References XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_FUSE_PROTECTED, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_UDS, XNVM_EFUSE_MARGIN_RD, XNVM_EFUSE_MODE_PGM, XNVM_EFUSE_PAGE_0, XNVM_EFUSE_SKIP_VERIFY, XNvm_EfuseCheckAesKeyCrc(), XNvm_EfuseReadReg(), XNvm_EfuseSetupController(), and XNvm_EfuseTempAndVoltChecks().

int XNvm_EfuseWriteUserFuses ( XNvm_EfuseUserData WriteUserFuses,
XSysMonPsv *  SysMonInstPtr 
)

This function Programs User eFuses.

Parameters
WriteUserFuses- Pointer to the XNvm_EfuseUserData structure.
SysMonInstPtr- Pointer to the XSysMonPsv structure which contains XSysmonPsv driver instance data
Returns
  • XST_SUCCESS If programming is successful.
  • XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED If NULL request is sent.

Validate input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if input parameters are invalid.

NULL for SysMonInstPtr indicates, no need to check for Temparature and Voltage before eFUSE programming. Non-NULL indicates, perform Temp and Volt monitoring.

Fill the XNvm_EfuseData global structure with the user provided WriteUserFuses and call XNvm_EfuseWrite API. Return the XST_SUCCESS.

References XNvm_EfuseData::EnvMonitorDis, XNvm_EfuseData::SysMonInstPtr, XNvm_EfuseData::UserFuses, XNVM_EFUSE_ERR_NTHG_TO_BE_PROGRAMMED, and XNvm_EfuseWrite().

u32 XNvm_GetSysmonSupplyRegId ( UINTPTR  SysmonpsvSatBaseAddr)

This function reads root register ID where measurement is stored in Root SysMon.

Parameters
SysmonpsvSatBaseAddr- Pointer to SysMon base address
Returns
On Success Reads and returns SupplyReg Id On Failure Returns default SupplyReg value

References XNVM_EFUSE_SEC_DEF_VAL_ALL_BIT_SET, XNVM_EFUSE_SYSMON_NUM_MEASURE_REGS, XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW0, XNVM_EFUSE_SYSMON_VCCPMC_ABUS_SW1, XNVM_EFUSE_SYSMON_VCCPMC_AMUX_CTRL, XNVM_EFUSE_SYSMON_VCCPMC_MODE, and XNVM_EFUSE_WORD_LEN.

Referenced by XNvm_EfuseTempAndVoltChecks().

Variable Documentation

u32 XNvm_EfusePrgmInfo::ColEnd

End column number of eFuse.

u32 XNvm_EfusePrgmInfo::ColStart

Start column number of eFuse.

XNvm_EfuseType XNvm_EfusePrgmInfo::EfuseType

Efuse page number.

u32 XNvm_EfusePrgmInfo::NumOfRows

Number of rows of eFuse.

u32 XNvm_EfusePrgmInfo::SkipVerify

Flag to check if eFuse bit should be verified after programming.

u32 XNvm_EfusePrgmInfo::StartRow

Start row number of eFuse.