lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseInitMiscCtrl(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseMiscCtrlBits *MiscCtrlBits)
{
	MiscCtrlBits->Ppk0Invalid = XNVM_EFUSE_PPK0_INVLD;
	MiscCtrlBits->Ppk1Invalid = XNVM_EFUSE_PPK1_INVLD;
	MiscCtrlBits->Ppk2Invalid = XNVM_EFUSE_PPK2_INVLD;
	MiscCtrlBits->HaltBootError = XNVM_EFUSE_GEN_ERR_HALT_BOOT_EN_1_0;
	MiscCtrlBits->HaltBootEnv = XNVM_EFUSE_ENV_ERR_HALT_BOOT_EN_1_0;
	MiscCtrlBits->CryptoKatEn = XNVM_EFUSE_CRYPTO_KAT_EN;
	MiscCtrlBits->LbistEn = XNVM_EFUSE_LBIST_EN;
	MiscCtrlBits->SafetyMissionEn = XNVM_EFUSE_SAFETY_MISSION_EN;

	if ((MiscCtrlBits->Ppk0Invalid == TRUE) ||
		(MiscCtrlBits->Ppk1Invalid == TRUE) ||
		(MiscCtrlBits->Ppk2Invalid == TRUE) ||
		(MiscCtrlBits->HaltBootError == TRUE)||
		(MiscCtrlBits->HaltBootEnv == TRUE) ||
		(MiscCtrlBits->CryptoKatEn == TRUE) ||
		(MiscCtrlBits->LbistEn == TRUE) ||
		(MiscCtrlBits->SafetyMissionEn == TRUE)) {
		Xil_DCacheFlushRange((UINTPTR)MiscCtrlBits,
			sizeof(XNvm_EfuseMiscCtrlBits));
		WriteEfuse->MiscCtrlAddr = (UINTPTR)MiscCtrlBits;
	}

	return XST_SUCCESS;
}
/******************************************************************************/
/**
 * This function is used to initialize XNvm_EfuseMiscCtrlBits structure with
 * user provided data and assign the same to global structure XNvm_EfuseDataAddr
 * to program PPK INVLD eFuses.
 *
 * typedef struct {
 *	u8 GlitchDetHaltBootEn;
 *	u8 GlitchDetRomMonitorEn;
 *	u8 HaltBootError;
 *	u8 HaltBootEnv;
 *	u8 CryptoKatEn;
 *	u8 LbistEn;
 *	u8 SafetyMissionEn;
 *	u8 Ppk0Invalid;
 *	u8 Ppk1Invalid;
 *	u8 Ppk2Invalid;
 * }XNvm_EfuseMiscCtrlBits;
 *
 * @param	MiscCtrlBits	Pointer to XNvm_EfuseMiscCtrlBits structure
 *
 * @param	WriteEfuse	Pointer to XNvm_EfuseDataAddr structure
 *
 * @return
 *		- XST_SUCCESS - If the initialization XNvm_EfuseMiscCtrlBits
 *				structure is successful
 *		- Error Code - On Failure.
 *
 ******************************************************************************/
This function is used to initialize XNvm_EfuseMiscCtrlBits structure with
user provided data and assign the same to global structure XNvm_EfuseDataAddr
to program PPK INVLD eFuses.







@return
- XST_SUCCESS - If the initialization XNvm_EfuseMiscCtrlBits
structure is successful
- Error Code - On Failure.
This function is used to initialize XNvm_EfuseMiscCtrlBits structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program PPK INVLD eFuses . @return - XST_SUCCESS - If the initialization XNvm_EfuseMiscCtrlBits structure is successful - Error Code - On Failure .
static int XilNvm_EfuseInitMiscCtrl(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseMiscCtrlBits *MiscCtrlBits)
{
	MiscCtrlBits->Ppk0Invalid = XNVM_EFUSE_PPK0_INVLD;
	MiscCtrlBits->Ppk1Invalid = XNVM_EFUSE_PPK1_INVLD;
	MiscCtrlBits->Ppk2Invalid = XNVM_EFUSE_PPK2_INVLD;
	MiscCtrlBits->HaltBootError = XNVM_EFUSE_GEN_ERR_HALT_BOOT_EN_1_0;
	MiscCtrlBits->HaltBootEnv = XNVM_EFUSE_ENV_ERR_HALT_BOOT_EN_1_0;
	MiscCtrlBits->CryptoKatEn = XNVM_EFUSE_CRYPTO_KAT_EN;
	MiscCtrlBits->LbistEn = XNVM_EFUSE_LBIST_EN;
	MiscCtrlBits->SafetyMissionEn = XNVM_EFUSE_SAFETY_MISSION_EN;
	if ((MiscCtrlBits->Ppk0Invalid == TRUE) ||
		(MiscCtrlBits->Ppk1Invalid == TRUE) ||
		(MiscCtrlBits->Ppk2Invalid == TRUE) ||
		(MiscCtrlBits->HaltBootError == TRUE)||
		(MiscCtrlBits->HaltBootEnv == TRUE) ||
		(MiscCtrlBits->CryptoKatEn == TRUE) ||
		(MiscCtrlBits->LbistEn == TRUE) ||
		(MiscCtrlBits->SafetyMissionEn == TRUE)) {
		Xil_DCacheFlushRange((UINTPTR)MiscCtrlBits,
			sizeof(XNvm_EfuseMiscCtrlBits));
		WriteEfuse->MiscCtrlAddr = (UINTPTR)MiscCtrlBits;
	}
	return XST_SUCCESS;
}
static int XilNvm_EfuseInitMiscCtrl ( XNvm_EfuseDataAddr * WriteEfuse , XNvm_EfuseMiscCtrlBits * MiscCtrlBits ) { MiscCtrlBits -> Ppk0Invalid = XNVM_EFUSE_PPK0_INVLD ; MiscCtrlBits -> Ppk1Invalid = XNVM_EFUSE_PPK1_INVLD ; MiscCtrlBits -> Ppk2Invalid = XNVM_EFUSE_PPK2_INVLD ; MiscCtrlBits -> HaltBootError = XNVM_EFUSE_GEN_ERR_HALT_BOOT_EN_1_0 ; MiscCtrlBits -> HaltBootEnv = XNVM_EFUSE_ENV_ERR_HALT_BOOT_EN_1_0 ; MiscCtrlBits -> CryptoKatEn = XNVM_EFUSE_CRYPTO_KAT_EN ; MiscCtrlBits -> LbistEn = XNVM_EFUSE_LBIST_EN ; MiscCtrlBits -> SafetyMissionEn = XNVM_EFUSE_SAFETY_MISSION_EN ; if ( ( MiscCtrlBits -> Ppk0Invalid == TRUE ) || ( MiscCtrlBits -> Ppk1Invalid == TRUE ) || ( MiscCtrlBits -> Ppk2Invalid == TRUE ) || ( MiscCtrlBits -> HaltBootError == TRUE ) || ( MiscCtrlBits -> HaltBootEnv == TRUE ) || ( MiscCtrlBits -> CryptoKatEn == TRUE ) || ( MiscCtrlBits -> LbistEn == TRUE ) || ( MiscCtrlBits -> SafetyMissionEn == TRUE ) ) { Xil_DCacheFlushRange ( ( UINTPTR ) MiscCtrlBits , sizeof ( XNvm_EfuseMiscCtrlBits ) ) ; WriteEfuse -> MiscCtrlAddr = ( UINTPTR ) MiscCtrlBits ; } return XST_SUCCESS ; }
This function is used to initialize XNvm_EfuseMiscCtrlBits structure with
 user provided data and assign the same to global structure XNvm_EfuseDataAddr
 to program PPK INVLD eFuses.
This function is used to initialize XNvm_EfuseMiscCtrlBits structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program PPK INVLD eFuses .