lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseInitOffChipRevokeIds(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseOffChipIds *OffChipIds)
{
	int Status = XST_FAILURE;

	if ((XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_0 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_1 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_2 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_3 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_4 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_5 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_6 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_7) != 0U) {

		OffChipIds->PrgmOffchipId = TRUE;
	}

	if (OffChipIds->PrgmOffchipId == TRUE) {
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_0_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_0],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_1_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_1],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_2_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_2],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_3_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_3],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_4_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_4],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_5_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_5],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_6_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_6],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_7_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_7],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}

	if (Status == XST_SUCCESS) {
		Xil_DCacheFlushRange((UINTPTR)OffChipIds,
			sizeof(XNvm_EfuseOffChipIds));
		WriteEfuse->OffChipIdAddr = (UINTPTR)OffChipIds;
	}

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







@return
- XST_SUCCESS - If the initialization of XNvm_EfuseOffChipIds
structure is successful
- Error Code - On Failure.
This function is used to initialize XNvm_EfuseOffChipIds structure with user provided data and assign it to global structure XNvm_EfuseDataAddr to program OffChip_Revoke ID eFuses @return - XST_SUCCESS - If the initialization of XNvm_EfuseOffChipIds structure is successful - Error Code - On Failure .
static int XilNvm_EfuseInitOffChipRevokeIds(XNvm_EfuseDataAddr *WriteEfuse,
	XNvm_EfuseOffChipIds *OffChipIds)
{
	int Status = XST_FAILURE;
	if ((XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_0 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_1 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_2 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_3 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_4 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_5 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_6 |
		XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_7) != 0U) {
		OffChipIds->PrgmOffchipId = TRUE;
	}
	if (OffChipIds->PrgmOffchipId == TRUE) {
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_0_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_0],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_1_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_1],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_2_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_2],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_3_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_3],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_4_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_4],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_5_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_5],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_6_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_6],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
		Status = XilNvm_PrepareRevokeIdsForWrite(
			(char *)XNVM_EFUSE_OFFCHIP_REVOKE_ID_7_FUSES,
			&OffChipIds->OffChipId[XNVM_EFUSE_OFFCHIP_REVOKE_ID_7],
			XNVM_EFUSE_ROW_STRING_LEN);
		if (Status != XST_SUCCESS) {
			goto END;
		}
	}
	if (Status == XST_SUCCESS) {
		Xil_DCacheFlushRange((UINTPTR)OffChipIds,
			sizeof(XNvm_EfuseOffChipIds));
		WriteEfuse->OffChipIdAddr = (UINTPTR)OffChipIds;
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XilNvm_EfuseInitOffChipRevokeIds ( XNvm_EfuseDataAddr * WriteEfuse , XNvm_EfuseOffChipIds * OffChipIds ) { int Status = XST_FAILURE ; if ( ( XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_0 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_1 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_2 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_3 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_4 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_5 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_6 | XNVM_EFUSE_WRITE_OFFCHIP_REVOKE_ID_7 ) != 0U ) { OffChipIds -> PrgmOffchipId = TRUE ; } if ( OffChipIds -> PrgmOffchipId == TRUE ) { Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_0_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_0 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_1_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_1 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_2_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_2 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_3_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_3 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_4_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_4 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_5_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_5 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_6_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_6 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } Status = XilNvm_PrepareRevokeIdsForWrite ( ( char * ) XNVM_EFUSE_OFFCHIP_REVOKE_ID_7_FUSES , & OffChipIds -> OffChipId [ XNVM_EFUSE_OFFCHIP_REVOKE_ID_7 ] , XNVM_EFUSE_ROW_STRING_LEN ) ; if ( Status != XST_SUCCESS ) { goto END ; } } if ( Status == XST_SUCCESS ) { Xil_DCacheFlushRange ( ( UINTPTR ) OffChipIds , sizeof ( XNvm_EfuseOffChipIds ) ) ; WriteEfuse -> OffChipIdAddr = ( UINTPTR ) OffChipIds ; } Status = XST_SUCCESS ; END : return Status ; }
This function is used to initialize XNvm_EfuseOffChipIds structure with user
 provided data and assign it to global structure XNvm_EfuseDataAddr to program
 OffChip_Revoke ID eFuses
This function is used to initialize XNvm_EfuseOffChipIds structure with user provided data and assign it to global structure XNvm_EfuseDataAddr to program OffChip_Revoke ID eFuses