lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseInitRevocationIds(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseRevokeIds *RevokeIds)
{
	int Status = XST_FAILURE;

	if ((XNVM_EFUSE_WRITE_REVOCATION_ID_0 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_1 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_2 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_3 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_4 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_5 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_6 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_7) != 0U) {

		RevokeIds->PrgmRevokeId = TRUE;
	}

	if (RevokeIds->PrgmRevokeId == TRUE) {
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_0_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_0],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_1_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_1],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_2_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_2],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_3_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_3],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_4_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_4],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_5_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_5],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_6_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_6],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_7_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_7],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}

	if (Status == XST_SUCCESS) {
		Xil_DCacheFlushRange((UINTPTR)RevokeIds,
			sizeof(XNvm_EfuseRevokeIds));
		WriteEfuse->RevokeIdAddr = (UINTPTR)RevokeIds;
	}

	Status = XST_SUCCESS;
END:
	return Status;
}
/****************************************************************************/
/**
 * This function is used to initialize XNvm_EfuseRevokeIds structure with user
 * provided data and assign it to global structure  XNvm_EfuseDataAddr to
 * program revocation ID eFuses
 *
 * typedef struct {
 *	u8 PrgmRevokeId;
 *	u32 RevokeId[XNVM_NUM_OF_REVOKE_ID_FUSES];
 * }XNvm_EfuseRevokeIds;
 *
 * @param	WriteEfuse      Pointer to XNvm_EfuseDataAddr structure
 *
 * @param 	RevokeIds	Pointer to XNvm_EfuseRevokeIds structure
 *
 * @return
 *		- XST_SUCCESS - If the initialization of XNvm_EfuseRevokeIds
 *				structure is successful
 *		- Error Code - On Failure.
 *
 ******************************************************************************/
This function is used to initialize XNvm_EfuseRevokeIds structure with user
provided data and assign it to global structure  XNvm_EfuseDataAddr to
program revocation ID eFuses







@return
- XST_SUCCESS - If the initialization of XNvm_EfuseRevokeIds
structure is successful
- Error Code - On Failure.
This function is used to initialize XNvm_EfuseRevokeIds structure with user provided data and assign it to global structure XNvm_EfuseDataAddr to program revocation ID eFuses @return - XST_SUCCESS - If the initialization of XNvm_EfuseRevokeIds structure is successful - Error Code - On Failure .
static int XilNvm_EfuseInitRevocationIds(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseRevokeIds *RevokeIds)
{
	int Status = XST_FAILURE;
	if ((XNVM_EFUSE_WRITE_REVOCATION_ID_0 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_1 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_2 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_3 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_4 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_5 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_6 |
		XNVM_EFUSE_WRITE_REVOCATION_ID_7) != 0U) {
		RevokeIds->PrgmRevokeId = TRUE;
	}
	if (RevokeIds->PrgmRevokeId == TRUE) {
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_0_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_0],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_1_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_1],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_2_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_2],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_3_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_3],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_4_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_4],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_5_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_5],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_6_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_6],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_REVOCATION_ID_7_FUSES,
			&RevokeIds->RevokeId[XNVM_EFUSE_REVOCATION_ID_7],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}
	if (Status == XST_SUCCESS) {
		Xil_DCacheFlushRange((UINTPTR)RevokeIds,
			sizeof(XNvm_EfuseRevokeIds));
		WriteEfuse->RevokeIdAddr = (UINTPTR)RevokeIds;
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XilNvm_EfuseInitRevocationIds ( XNvm_EfuseDataAddr * WriteEfuse , XNvm_EfuseRevokeIds * RevokeIds ) { int Status = XST_FAILURE ; if ( ( XNVM_EFUSE_WRITE_REVOCATION_ID_0 | XNVM_EFUSE_WRITE_REVOCATION_ID_1 | XNVM_EFUSE_WRITE_REVOCATION_ID_2 | XNVM_EFUSE_WRITE_REVOCATION_ID_3 | XNVM_EFUSE_WRITE_REVOCATION_ID_4 | XNVM_EFUSE_WRITE_REVOCATION_ID_5 | XNVM_EFUSE_WRITE_REVOCATION_ID_6 | XNVM_EFUSE_WRITE_REVOCATION_ID_7 ) != 0U ) { RevokeIds -> PrgmRevokeId = TRUE ; } if ( RevokeIds -> PrgmRevokeId == TRUE ) { Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_0_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_0 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_1_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_1 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_2_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_2 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_3_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_3 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_4_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_4 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_5_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_5 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_6_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_6 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_REVOCATION_ID_7_FUSES , & RevokeIds -> RevokeId [ XNVM_EFUSE_REVOCATION_ID_7 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } } if ( Status == XST_SUCCESS ) { Xil_DCacheFlushRange ( ( UINTPTR ) RevokeIds , sizeof ( XNvm_EfuseRevokeIds ) ) ; WriteEfuse -> RevokeIdAddr = ( UINTPTR ) RevokeIds ; } Status = XST_SUCCESS ; END : return Status ; }
This function is used to initialize XNvm_EfuseRevokeIds structure with user
 provided data and assign it to global structure  XNvm_EfuseDataAddr to
 program revocation ID eFuses
This function is used to initialize XNvm_EfuseRevokeIds structure with user provided data and assign it to global structure XNvm_EfuseDataAddr to program revocation ID eFuses