lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseInitGlitchData(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseGlitchCfgBits *GlitchData)
{
	int Status = XST_FAILURE;

	GlitchData->PrgmGlitch = XNVM_EFUSE_WRITE_GLITCH_CFG;

	if(GlitchData->PrgmGlitch == TRUE) {
		Status = Xil_ConvertStringToHex(XNVM_EFUSE_GLITCH_CFG,
					&(GlitchData->GlitchDetTrim),
					XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}

		/**
		 * Config data size is 31 bits Bit[30:0]
		 */
		GlitchData->GlitchDetTrim = GlitchData->GlitchDetTrim &
						(~XNVM_EFUSE_GLITCH_WR_LK_MASK);

		if(XNVM_EFUSE_GLITCH_DET_WR_LK == TRUE) {
			GlitchData->GlitchDetWrLk = 1U;
		}
		else {
			GlitchData->GlitchDetWrLk = 0U;
		}

		if(XNVM_EFUSE_GD_ROM_MONITOR_EN == TRUE) {
			GlitchData->GdRomMonitorEn = 1U;
		}
		else {
			GlitchData->GdRomMonitorEn = 0U;
		}

		if(XNVM_EFUSE_GD_HALT_BOOT_EN_1_0 == TRUE) {
			GlitchData->GdHaltBootEn = 1U;
		}
		else {
			GlitchData->GdHaltBootEn = 0U;
		}

		Xil_DCacheFlushRange((UINTPTR)GlitchData,
			sizeof(XNvm_EfuseGlitchCfgBits));
		WriteEfuse->GlitchCfgAddr = (UINTPTR)GlitchData;
	}

	Status = XST_SUCCESS;

END:
	return Status;
}
/****************************************************************************/
/**
 * This function is used to initialize Glitch config structure with user
 * provided data and assign the same to global structure XNvm_EfuseDataAddr to
 * program below eFuses.
 * - Glitch Configuration Row write lock
 * - Glitch configuration data
 *
 * typedef struct {
 *	u8 PrgmGlitch;
 *	u8 GlitchDetWrLk;
 *	u32 GlitchDetTrim;
 *	u8 GdRomMonitorEn;
 *	u8 GdHaltBootEn;
 * }XNvm_EfuseGlitchCfgBits;
 *
 * @param	WriteEfuse	Pointer to XNvm_EfuseDataAddr structure.
 *
 * @param 	GlitchData	Pointer to XNvm_EfuseGlitchCfgBits structure.
 *
 * @return
 *		- XST_SUCCESS - If initialization is successful
 *		- ErrorCode - On Failure
 *
 ******************************************************************************/
This function is used to initialize Glitch config structure with user
provided data and assign the same to global structure XNvm_EfuseDataAddr to
program below eFuses.
- Glitch Configuration Row write lock
- Glitch configuration data







@return
- XST_SUCCESS - If initialization is successful
- ErrorCode - On Failure
This function is used to initialize Glitch config structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program below eFuses . - Glitch Configuration Row write lock - Glitch configuration data @return - XST_SUCCESS - If initialization is successful - ErrorCode - On Failure
static int XilNvm_EfuseInitGlitchData(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseGlitchCfgBits *GlitchData)
{
	int Status = XST_FAILURE;
	GlitchData->PrgmGlitch = XNVM_EFUSE_WRITE_GLITCH_CFG;
	if(GlitchData->PrgmGlitch == TRUE) {
		Status = Xil_ConvertStringToHex(XNVM_EFUSE_GLITCH_CFG,
					&(GlitchData->GlitchDetTrim),
					XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		GlitchData->GlitchDetTrim = GlitchData->GlitchDetTrim &
						(~XNVM_EFUSE_GLITCH_WR_LK_MASK);
		if(XNVM_EFUSE_GLITCH_DET_WR_LK == TRUE) {
			GlitchData->GlitchDetWrLk = 1U;
		}
		else {
			GlitchData->GlitchDetWrLk = 0U;
		}
		if(XNVM_EFUSE_GD_ROM_MONITOR_EN == TRUE) {
			GlitchData->GdRomMonitorEn = 1U;
		}
		else {
			GlitchData->GdRomMonitorEn = 0U;
		}
		if(XNVM_EFUSE_GD_HALT_BOOT_EN_1_0 == TRUE) {
			GlitchData->GdHaltBootEn = 1U;
		}
		else {
			GlitchData->GdHaltBootEn = 0U;
		}
		Xil_DCacheFlushRange((UINTPTR)GlitchData,
			sizeof(XNvm_EfuseGlitchCfgBits));
		WriteEfuse->GlitchCfgAddr = (UINTPTR)GlitchData;
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XilNvm_EfuseInitGlitchData ( XNvm_EfuseDataAddr * WriteEfuse , XNvm_EfuseGlitchCfgBits * GlitchData ) { int Status = XST_FAILURE ; GlitchData -> PrgmGlitch = XNVM_EFUSE_WRITE_GLITCH_CFG ; if ( GlitchData -> PrgmGlitch == TRUE ) { Status = Xil_ConvertStringToHex ( XNVM_EFUSE_GLITCH_CFG , & ( GlitchData -> GlitchDetTrim ) , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } GlitchData -> GlitchDetTrim = GlitchData -> GlitchDetTrim & ( ~ XNVM_EFUSE_GLITCH_WR_LK_MASK ) ; if ( XNVM_EFUSE_GLITCH_DET_WR_LK == TRUE ) { GlitchData -> GlitchDetWrLk = 1U ; } else { GlitchData -> GlitchDetWrLk = 0U ; } if ( XNVM_EFUSE_GD_ROM_MONITOR_EN == TRUE ) { GlitchData -> GdRomMonitorEn = 1U ; } else { GlitchData -> GdRomMonitorEn = 0U ; } if ( XNVM_EFUSE_GD_HALT_BOOT_EN_1_0 == TRUE ) { GlitchData -> GdHaltBootEn = 1U ; } else { GlitchData -> GdHaltBootEn = 0U ; } Xil_DCacheFlushRange ( ( UINTPTR ) GlitchData , sizeof ( XNvm_EfuseGlitchCfgBits ) ) ; WriteEfuse -> GlitchCfgAddr = ( UINTPTR ) GlitchData ; } Status = XST_SUCCESS ; END : return Status ; }
This function is used to initialize Glitch config structure with user
 provided data and assign the same to global structure XNvm_EfuseDataAddr to
 program below eFuses.
This function is used to initialize Glitch config structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program below eFuses .
/**
		 * Config data size is 31 bits Bit[30:0]
		 */