lib/sw_services/xilskey/examples/xilskey_efuseps_zynqmp_example.c
static inline u32 XilSKey_EfusePs_ZynqMp_ProgramPufFuses() {
	XilSKey_PufEfuse PufFuse = {0};
	u32 Status = XST_FAILURE;
	u32 XSK_EFUSEPS_PufData[XSK_EFUSEPS_PUF_NUM_OF_ROWS];

	/* Program PUF Fuses */
	PufFuse.PrgrmPufFuse = XSK_EFUSEPS_WRITE_PUF_FUSE;
	if (PufFuse.PrgrmPufFuse == TRUE) {
		Status = Xil_ConvertStringToHex((char*)XSK_EFUSEPS_PUF_FUSE_DATA,
						XSK_EFUSEPS_PufData,
						XSK_EFUSEPS_PUF_NUM_OF_ROWS * 8U);
		if (Status != XST_SUCCESS) {
			xil_printf("String conversion failed with err:%02x",Status);
			goto END;
		}
		PufFuse.PufFuseData= XSK_EFUSEPS_PufData;
		PufFuse.PufFuseStartRow= XSK_EFUSEPS_PUF_START_ROW;
		PufFuse.PufNumOfFuses= XSK_EFUSEPS_PUF_NUM_OF_ROWS;

		Status = XilSKey_ZynqMp_EfusePs_ProgramPufAsUserFuses(&PufFuse);
		if (Status != XST_SUCCESS) {
			xil_printf("Programming user efuses to PUF Helper Data failed\n\r");
			goto END;
		}
	}

	Status = XST_SUCCESS;
END:
	return Status;
}
/****************************************************************************/
/**
*
* This function programs the puf fuses as general purpose data
*
* @return
*		- XST_SUCCESS - In case of Program or Read Success
*		- XST_FAILURE - If program fails
*
*****************************************************************************/
This function programs the puf fuses as general purpose data
This function programs the puf fuses as general purpose data
static inline u32 XilSKey_EfusePs_ZynqMp_ProgramPufFuses() {
	XilSKey_PufEfuse PufFuse = {0};
	u32 Status = XST_FAILURE;
	u32 XSK_EFUSEPS_PufData[XSK_EFUSEPS_PUF_NUM_OF_ROWS];
	PufFuse.PrgrmPufFuse = XSK_EFUSEPS_WRITE_PUF_FUSE;
	if (PufFuse.PrgrmPufFuse == TRUE) {
		Status = Xil_ConvertStringToHex((char*)XSK_EFUSEPS_PUF_FUSE_DATA,
						XSK_EFUSEPS_PufData,
						XSK_EFUSEPS_PUF_NUM_OF_ROWS * 8U);
		if (Status != XST_SUCCESS) {
			xil_printf("String conversion failed with err:%02x",Status);
			goto END;
		}
		PufFuse.PufFuseData= XSK_EFUSEPS_PufData;
		PufFuse.PufFuseStartRow= XSK_EFUSEPS_PUF_START_ROW;
		PufFuse.PufNumOfFuses= XSK_EFUSEPS_PUF_NUM_OF_ROWS;
		Status = XilSKey_ZynqMp_EfusePs_ProgramPufAsUserFuses(&PufFuse);
		if (Status != XST_SUCCESS) {
			xil_printf("Programming user efuses to PUF Helper Data failed\n\r");
			goto END;
		}
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static inline u32 XilSKey_EfusePs_ZynqMp_ProgramPufFuses ( ) { XilSKey_PufEfuse PufFuse = { 0 } ; u32 Status = XST_FAILURE ; u32 XSK_EFUSEPS_PufData [ XSK_EFUSEPS_PUF_NUM_OF_ROWS ] ; PufFuse . PrgrmPufFuse = XSK_EFUSEPS_WRITE_PUF_FUSE ; if ( PufFuse . PrgrmPufFuse == TRUE ) { Status = Xil_ConvertStringToHex ( ( char * ) XSK_EFUSEPS_PUF_FUSE_DATA , XSK_EFUSEPS_PufData , XSK_EFUSEPS_PUF_NUM_OF_ROWS * 8U ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " " , Status ) ; goto END ; } PufFuse . PufFuseData = XSK_EFUSEPS_PufData ; PufFuse . PufFuseStartRow = XSK_EFUSEPS_PUF_START_ROW ; PufFuse . PufNumOfFuses = XSK_EFUSEPS_PUF_NUM_OF_ROWS ; Status = XilSKey_ZynqMp_EfusePs_ProgramPufAsUserFuses ( & PufFuse ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \n \r " ) ; goto END ; } } Status = XST_SUCCESS ; END : return Status ; }
This function programs the puf fuses as general purpose data
This function programs the puf fuses as general purpose data
/* Program PUF Fuses */