lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseInitUserFuses(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseUserDataAddr *Data)
{
	int Status = XST_FAILURE;

	if (XNVM_EFUSE_WRITE_USER_FUSES == TRUE) {
		Status = XilNvm_ValidateUserFuseStr(
				(char *)XNVM_EFUSE_USER_FUSES);
		if (Status != XST_SUCCESS) {
			xil_printf("UserFuse string validation failed\r\n");
			goto END;
		}
		Status = Xil_ConvertStringToHex(
				XNVM_EFUSE_USER_FUSES,
				(u32 *)(UINTPTR)Data->UserFuseDataAddr,
				(XNVM_EFUSE_NUM_OF_USER_FUSES *
				XNVM_EFUSE_ROW_STRING_LEN));
		if (Status != XST_SUCCESS) {
			goto END;
		}

		Data->StartUserFuseNum = XNVM_EFUSE_PRGM_USER_FUSE_NUM;
		Data->NumOfUserFuses = XNVM_EFUSE_NUM_OF_USER_FUSES;

		Xil_DCacheFlushRange((UINTPTR)Data,
			sizeof(XNvm_EfuseUserDataAddr));
		WriteEfuse->UserFuseAddr = (UINTPTR)Data;
	}
	Status = XST_SUCCESS;

END:
	return  Status;
}
/****************************************************************************/
/**
 * This function is used to initialize XNvm_UserEfuseData structure with user
 * provided data and assign the same to global structure XNvm_EfuseDataAddr to
 * program User Fuses.
 *
 * typedef struct {
 *	u32 StartUserFuseNum;
 *	u32 NumOfUserFuses;
 *	u64 UserFuseDataAddr;
 * }XNvm_EfuseUserDataAddr;
 *
 * @param	WriteEfuse      Pointer to XNvm_EfuseDataAddr structure
 *
 * @param 	Data		Pointer to XNvm_UserEfuseData structure
 *
 * @return
 *		- XST_SUCCESS - If the initialization of XNvm_UserEfuseData
 *				structure is successful
 *		- Error Code - On Failure.
 *
 ******************************************************************************/
This function is used to initialize XNvm_UserEfuseData structure with user
provided data and assign the same to global structure XNvm_EfuseDataAddr to
program User Fuses.





@param       Data            Pointer to XNvm_UserEfuseData structure

@return
- XST_SUCCESS - If the initialization of XNvm_UserEfuseData
structure is successful
- Error Code - On Failure.
This function is used to initialize XNvm_UserEfuseData structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program User Fuses . @param Data Pointer to XNvm_UserEfuseData structure @return - XST_SUCCESS - If the initialization of XNvm_UserEfuseData structure is successful - Error Code - On Failure .
static int XilNvm_EfuseInitUserFuses(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseUserDataAddr *Data)
{
	int Status = XST_FAILURE;
	if (XNVM_EFUSE_WRITE_USER_FUSES == TRUE) {
		Status = XilNvm_ValidateUserFuseStr(
				(char *)XNVM_EFUSE_USER_FUSES);
		if (Status != XST_SUCCESS) {
			xil_printf("UserFuse string validation failed\r\n");
			goto END;
		}
		Status = Xil_ConvertStringToHex(
				XNVM_EFUSE_USER_FUSES,
				(u32 *)(UINTPTR)Data->UserFuseDataAddr,
				(XNVM_EFUSE_NUM_OF_USER_FUSES *
				XNVM_EFUSE_ROW_STRING_LEN));
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Data->StartUserFuseNum = XNVM_EFUSE_PRGM_USER_FUSE_NUM;
		Data->NumOfUserFuses = XNVM_EFUSE_NUM_OF_USER_FUSES;
		Xil_DCacheFlushRange((UINTPTR)Data,
			sizeof(XNvm_EfuseUserDataAddr));
		WriteEfuse->UserFuseAddr = (UINTPTR)Data;
	}
	Status = XST_SUCCESS;
END:
	return  Status;
}
static int XilNvm_EfuseInitUserFuses ( XNvm_EfuseDataAddr * WriteEfuse , XNvm_EfuseUserDataAddr * Data ) { int Status = XST_FAILURE ; if ( XNVM_EFUSE_WRITE_USER_FUSES == TRUE ) { Status = XilNvm_ValidateUserFuseStr ( ( char * ) XNVM_EFUSE_USER_FUSES ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \r \n " ) ; goto END ; } Status = Xil_ConvertStringToHex ( XNVM_EFUSE_USER_FUSES , ( u32 * ) ( UINTPTR ) Data -> UserFuseDataAddr , ( XNVM_EFUSE_NUM_OF_USER_FUSES * XNVM_EFUSE_ROW_STRING_LEN ) ) ; if ( Status != XST_SUCCESS ) { goto END ; } Data -> StartUserFuseNum = XNVM_EFUSE_PRGM_USER_FUSE_NUM ; Data -> NumOfUserFuses = XNVM_EFUSE_NUM_OF_USER_FUSES ; Xil_DCacheFlushRange ( ( UINTPTR ) Data , sizeof ( XNvm_EfuseUserDataAddr ) ) ; WriteEfuse -> UserFuseAddr = ( UINTPTR ) Data ; } Status = XST_SUCCESS ; END : return Status ; }
This function is used to initialize XNvm_UserEfuseData structure with user
 provided data and assign the same to global structure XNvm_EfuseDataAddr to
 program User Fuses.
This function is used to initialize XNvm_UserEfuseData structure with user provided data and assign the same to global structure XNvm_EfuseDataAddr to program User Fuses .