xilnvm
Vitis Drivers API Documentation
XilNvm Versal Net API IDs

Functions

int XNvm_EfuseValidateAesKeyWriteReq (XNvm_AesKeyType KeyType)
 This function validates AES key/User Key 0/User key 1 requested for programming into eFUSEs. More...
 
int XNvm_EfuseValidatePpkHashWriteReq (XNvm_PpkType PpkType)
 This function validates PPK Hash requested for programming. More...
 
int XNvm_EfuseValidateIvWriteReq (XNvm_IvType IvType, XNvm_Iv *EfuseIv)
 This function validates all IVs requested for programming. More...
 
int XNvm_EfuseCheckZeros (u32 CacheOffset, u32 Count)
 This function is used verify eFuse for Zeros. More...
 
int XNvm_EfuseValidateDecOnlyRequest (void)
 This function validates DEC_ONLY eFuse programming request. More...
 
int XNvm_EfuseValidateFipsInfo (u32 FipsMode, u32 FipsVersion)
 This function is used to validate FIPS mode and FIPS version inputs before programming. More...
 
int XNvm_IsDmeModeEn (void)
 This function checks DME Mode is enabled or disabled. More...
 
int XNvm_EfuseIsPufHelperDataEmpty (void)
 This function checks whether PUF is already programmed or not. More...
 

Function Documentation

int XNvm_EfuseCheckZeros ( u32  CacheOffset,
u32  Count 
)

This function is used verify eFuse for Zeros.

Parameters
CacheOffset- Cache Offset from which verification has to be started.
Count- Number of rows till which verification has to be ended.
Returns
- XST_SUCCESS - if eFuses are not programmed.
  • XST_FAILURE - if eFuses are already programmed.

Read ISR_REG offset. Return XNVM_EFUSE_ERR_CACHE_PARITY if not success

Read the eFuse data at user specified offset. Return XST_FAILURE upon failure

References XNVM_EFUSE_ERR_CACHE_PARITY, XNvm_EfuseCheckZeros(), XNvm_EfuseReadReg(), and XNVM_WORD_LEN.

Referenced by XNvm_EfuseCheckZeros(), XNvm_EfuseIsPufHelperDataEmpty(), XNvm_EfuseValidateIvWriteReq(), and XNvm_EfuseValidatePpkHashWriteReq().

int XNvm_EfuseIsPufHelperDataEmpty ( void  )

This function checks whether PUF is already programmed or not.

Returns
- XST_SUCCESS - if all rows are zero.
  • XNVM_EFUSE_ERR_PUF_SYN_ALREADY_PRGMD - Puf Syn data already programmed.
  • XNVM_EFUSE_ERR_PUF_CHASH_ALREADY_PRGMD - Puf chash already programmed.
  • XNVM_EFUSE_ERR_PUF_AUX_ALREADY_PRGMD - Puf Aux is already programmed.

References XNVM_EFUSE_ERR_PUF_AUX_ALREADY_PRGMD, XNVM_EFUSE_ERR_PUF_CHASH_ALREADY_PRGMD, XNVM_EFUSE_ERR_PUF_SYN_ALREADY_PRGMD, XNvm_EfuseCheckZeros(), XNvm_EfuseIsPufHelperDataEmpty(), and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseIsPufHelperDataEmpty(), XNvm_EfuseValidateDecOnlyRequest(), and XNvm_EfuseWritePuf().

int XNvm_EfuseValidateAesKeyWriteReq ( XNvm_AesKeyType  KeyType)

This function validates AES key/User Key 0/User key 1 requested for programming into eFUSEs.

Parameters
KeyType- Type of AES key requested to be validated. Possible options are AES key, User0 key and User1 key.
Returns
- XST_SUCCESS - if validation is successful.
  • XNVM_EFUSE_ERR_AES_ALREADY_PRGMD - Aes key already programmed.
  • XNVM_EFUSE_ERR_USER_KEY0_ALREADY_PRGMD - User key 0 is already programmed.
  • XNVM_EFUSE_ERR_USER_KEY1_ALREADY_PRGMD - User key 1 is already programmed.
  • XNVM_EFUSE_ERR_FUSE_PROTECTED - eFuse is write protected.
  • XNVM_EFUSE_ERR_WRITE_AES_KEY - Error in writing Aes key.
  • XNVM_EFUSE_ERR_WRITE_USER0_KEY - Error in writing User key 0.
  • XNVM_EFUSE_ERR_WRITE_USER1_KEY - Error in writing User key 1.

Read the Security control eFUSE bits and check if the bit to disable AES engine is set. If set, return XNVM_EFUSE_ERR_AES_DISABLED.

Check if write is locked for the requested key type. If locked then return XNVM_EFUSE_ERR_FUSE_PROTECTED.

Check if CRC of the requested key type is zero. If non-zero then it implies that the key is already programmed and return XNVM_EFUSE_ERR_AES_ALREADY_PRGMD.

References XNVM_EFUSE_CRC_AES_ZEROS, XNVM_EFUSE_ERR_AES_ALREADY_PRGMD, XNVM_EFUSE_ERR_AES_DISABLED, XNVM_EFUSE_ERR_FUSE_PROTECTED, XNVM_EFUSE_ERR_WRITE_AES_KEY, XNVM_EFUSE_ERROR_BYTE_SHIFT, XNVM_EFUSE_ERROR_NIBBLE_SHIFT, XNvm_EfuseCheckAesKeyCrc(), and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWriteAesKey().

int XNvm_EfuseValidateDecOnlyRequest ( void  )

This function validates DEC_ONLY eFuse programming request.

Returns
- XST_SUCCESS - if validation is successful.
  • XNVM_EFUSE_ERR_INVALID_PARAM - On Invalid Parameter.
  • XNVM_EFUSE_ERR_DEC_ONLY_KEY_MUST_BE_PRGMD- Aes key should be programmed for DEC_ONLY eFuse programming.
  • XNVM_EFUSE_ERR_DEC_ONLY_IV_MUST_BE_PRGMD - Blk IV should be programmed for DEC_ONLY eFuse programming.
  • XNVM_EFUSE_ERR_DEC_ONLY_PUF_HD_MUST_BE_PRGMD - Puf helper should be programmed for DEC_ONLY eFuse programming.

Read direct from cache at offset of SECURITY_MISC_0. Return XNVM_EFUSE_ERR_DEC_ONLY_ALREADY_PRGMD if decrypt only not enabled

Check Zeros at offset of all IVs. Return XNVM_EFUSE_ERR_DEC_ONLY_IV_MUST_BE_PRGMD if not success

References XNVM_EFUSE_CACHE_DEC_EFUSE_ONLY_MASK, XNVM_EFUSE_CRC_AES_ZEROS, XNVM_EFUSE_ERR_DEC_ONLY_ALREADY_PRGMD, XNVM_EFUSE_ERR_DEC_ONLY_KEY_MUST_BE_PRGMD, XNVM_EFUSE_ERR_DEC_ONLY_PUF_HD_MUST_BE_PRGMD, XNvm_EfuseCheckAesKeyCrc(), XNvm_EfuseIsPufHelperDataEmpty(), and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWriteDecOnly().

int XNvm_EfuseValidateFipsInfo ( u32  FipsMode,
u32  FipsVersion 
)

This function is used to validate FIPS mode and FIPS version inputs before programming.

Parameters
FipsMode- Fips mode to be written to eFuses.
FipsVersion- Fips version to be written to eFuses.
Returns
- XST_SUCCESS - On successful write.

Read Fips version direct from cache at offset of CACHE_IP_DISABLE. Return Error code upon failure

Read Fips mode directly from cache at offset of CACHE_DME_FIPS. Return Error code upon failure

References XNVM_EFUSE_CACHE_DME_FIPS_FIPS_MODE_MASK, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERR_BIT_CANT_REVERT, and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWriteFipsInfo().

int XNvm_EfuseValidateIvWriteReq ( XNvm_IvType  IvType,
XNvm_Iv *  EfuseIv 
)

This function validates all IVs requested for programming.

Parameters
IvType- IvType to be validated
EfuseIv- Pointer to XNvm_EfuseIvs structure which holds IV data to be programmed to eFuse.
Returns
- XST_SUCCESS - if validation is successful.
  • XNVM_EFUSE_ERR_WRITE_META_HEADER_IV_RANGE - Error in Metaheader IV range write request.
  • XNVM_EFUSE_ERR_BLK_OBFUS_IV_ALREADY_PRGMD - Error in Blk Obfus Iv write request.
  • XNVM_EFUSE_ERR_WRITE_PLM_IV_RANGE - Error in Plm Iv range write request.
  • XNVM_EFUSE_ERR_WRITE_DATA_PARTITION_IV_RANGE - Error in Data Partition Iv range write request.

validate the input parameters. Return XNVM_EFUSE_ERR_INVALID_PARAM if inputs parameters are invalid

Check Zeros at offset of Black_Iv. Return XNVM_EFUSE_ERR_BLK_OBFUS_IV_ALREADY_PRGMD if not success

Validate Ivs. Return Error code upon failure

References XNVM_EFUSE_CACHE_METAHEADER_IV_RANGE_0_OFFSET, XNVM_EFUSE_ERR_BLK_OBFUS_IV_ALREADY_PRGMD, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_WRITE_META_HEADER_IV_RANGE, XNVM_EFUSE_ERROR_BYTE_SHIFT, and XNvm_EfuseCheckZeros().

Referenced by XNvm_EfuseWriteIv().

int XNvm_EfuseValidatePpkHashWriteReq ( XNvm_PpkType  PpkType)

This function validates PPK Hash requested for programming.

Parameters
PpkType- PpkHash0/PpkHash1/PpkHash2 type of PpkHash request to be validated
Returns
- XST_SUCCESS - if validates successfully.
  • XNVM_EFUSE_ERR_PPK0_HASH_ALREADY_PRGMD - Ppk0 hash already programmed.
  • XNVM_EFUSE_ERR_PPK1_HASH_ALREADY_PRGMD - Ppk1 hash already programmed.
  • XNVM_EFUSE_ERR_PPK2_HASH_ALREADY_PRGMD - Ppk2 hash already programmed.
  • XNVM_EFUSE_ERR_FUSE_PROTECTED - eFuse is write protected.
  • XNVM_EFUSE_ERR_WRITE_PPK0_HASH - Error in writing ppk0 hash.
  • XNVM_EFUSE_ERR_WRITE_PPK1_HASH - Error in writing ppk1 hash.
  • XNVM_EFUSE_ERR_WRITE_PPK2_HASH - Error in writing ppk2 hash.

Read the security control bits at offset of SECURITY_CTRL

Check for zeros in eFuse. Return XNVM_EFUSE_ERR_PPK0_HASH_ALREADY_PRGMD if not success

References XNVM_EFUSE_ERR_FUSE_PROTECTED, XNVM_EFUSE_ERR_INVALID_PARAM, XNVM_EFUSE_ERR_PPK0_HASH_ALREADY_PRGMD, XNVM_EFUSE_ERR_WRITE_PPK0_HASH, XNVM_EFUSE_ERROR_BYTE_SHIFT, XNVM_EFUSE_ERROR_NIBBLE_SHIFT, XNvm_EfuseCheckZeros(), and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseWritePpkHash().

int XNvm_IsDmeModeEn ( void  )

This function checks DME Mode is enabled or disabled.

Returns
- XST_SUCCESS - if DME Mode is not set.
  • XNVM_EFUSE_ERROR_DME_MODE_SET | XNVM_EFUSE_ERR_BEFORE_PROGRAMMING
    • if DME Mdoe is set.

Read DME Mode from DME FIPS register and return error if DME Mode is set

References XNVM_EFUSE_CACHE_DME_FIPS_DME_MODE_MASK, XNVM_EFUSE_ERR_BEFORE_PROGRAMMING, XNVM_EFUSE_ERROR_DME_MODE_SET, and XNvm_EfuseReadReg().

Referenced by XNvm_EfuseReadUserFuses(), and XNvm_EfuseWriteDmeUserKey().