xilnvm
Vitis Drivers API Documentation
versal_gen/versal/server/xnvm_efuse.c File Reference

Overview

This file contains eFuse functions of xilnvm library and provides the access to program eFUSE.

MODIFICATION HISTORY:
Ver   Who  Date        Changes


1.0 kal 08/16/2019 Initial release 2.0 kal 02/27/2020 Added eFuse wrapper APIs to program AES keys, PPK hash, Revocation ID, SecCtrl eFuses, Puf HD and APIs to read eFuse Cache values. kal 03/03/2020 Added protection eFuse row programming. kal 05/04/2020 Restructured the code to have single interface XNvm_EfuseWrite for eFuse programming. Removed usage of conversion APIs and achieved the same logic with bitwise operators. Reduced number of Cache reloads. 2.1 rpo 06/06/2020 Support added to write glitch configuration data. rpo 06/08/2020 Support added to program eFUSE halt boot bits to stop at ROM stage. kal 07/09/2020 Fixed bugs in PUF Syndrome data read, ROW_58 protection Row programming. Read provision is expanded to all Misc Ctrl eFuses. am 08/19/2020 Resolved MISRA C violations. kal 09/03/2020 Fixed Security CoE review comments am 10/13/2020 Resolved MISRA C violations 2.2 am 11/23/2020 Resolved MISRA C and Coverity warnings kal 12/23/2020 Removed unused variables kal 01/07/2021 Added support to SecurityMisc1, BootEnvCtrl,MiscCtrl and remaining eFuses in SecCtrl eFuse rows programming and reading kal 01/25/2021 Initialized variables to more secure state kal 01/25/2021 Fix cache logic error in XNvm_EfuseReadCacheRange API 2.3 kal 02/22/2021 Add redundancy to loop in XNvm_EfusePgmAndVerifyRows kal 02/26/2021 Fix all SW-BP-ZEROIZE related review comments kal 03/02/2021 Add Environmental monitoring support before eFuse programming kal 04/08/2021 Fix SW-BP-INPUT-VALID related review comments. kal 04/14/2021 Add a validation check for RowCount in XNvm_EfusePgmAndVerifyRows API kal 04/15/2021 Fix XNvm_EfuseSetReadMode - Blind writes kal 04/27/2021 Reset status to failure when status is used more than once in security critical places kal 04/30/2021 Added a warning for user to re-boot the system when CACHE_ERROR kpt 05/06/2021 Corrected check to program SafetyMissionEn bit kal 05/07/2021 Reset the read mode after eFuse operations are done kpt 05/12/2021 Added check to set environmental disable flag and sysmon instance for individual write API's kpt 05/20/2021 Added support for programming PUF efuses as general purpose data am 05/22/2021 Resolved MISRA C violations 2.4 kal 07/13/2021 Fixed doxygen warnings am 07/07/2021 Fixed 2021.1 review comments kal 07/25/2021 Moved XNvm_Printf definition to xnvm_def.h kpt 08/03/2021 Added XNvm_EfuseResetReadMode in XNvm_EfuseWritePufAsUserFuses kal 08/13/2021 Add most restrictive range check for device temparature before eFuse programming har 09/16/2021 Removed magic numbers in XNvm_EfuseWriteSecCtrl function Check for Trim2 instead of Trim3 before programming Protection bit 37 2.5 har 11/17/2021 Fix Blind Write in XNvm_EfuseDisableProgramming and XNvm_EfuseResetReadMode har 01/03/2022 Renamed NumOfPufFuses as NumOfPufFusesRows har 11/22/2021 Added an error case and full range check case for switch in XNvm_EfuseTemparatureCheck and XNvm_EfusePmcVoltageCheck Added checks for return value for XNvm_EfuseDisableProgramming() and XNvm_EfuseResetReadMode() am 02/28/2022 Resolved MISRA C violations 3.0 kal 07/12/2022 Moved common code to xnvm_efuse_common.c in common directory kal 08/02/2022 Fix Row37 protection check in XNvm_EfuseProtectionChecks API kpt 08/03/2022 Added volatile keyword to avoid compiler optimization of loop redundancy check dc 08/29/2022 Changed u8 to u32 type 3.1 skg 10/25/2022 Added in body comments for APIs skg 12/07/2022 Added Additional PPKs hash and invalid support kal 03/07/2023 Added volatile keyword to avoid compiler optimization in XNvm_EfuseWriteSecMisc1Fuses 3.2 kum 04/11/2023 Moved common code to xnvm_efuse_common.c kpt 07/26/2023 Add missing else check in XNvm_EfuseReadPpkHash 3.3 har 12/04/2023 Added support for HWTSTBITS_DIS and PMC_SC_EN efuse bits vss 12/31/2023 Added support for Program the eFuse protection bits only once vss 02/23/2024 Added IPI support for eFuse read and write kpt 03/28/2024 Updated validation to allow additional PPK programming along with PPK0/1/2 and additional ppk enable bit ng 12/12/2023 Fixed doxygen grouping

 

Macros

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)
 

Functions

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_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...