lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseShowMiscCtrlBits(void)
{
	int Status = XST_FAILURE;
	XNvm_EfuseMiscCtrlBits *MiscCtrlBits =
		(XNvm_EfuseMiscCtrlBits *)CacheAlignedArr;

	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));

	Status = XNvm_EfuseReadMiscCtrlBits((UINTPTR)MiscCtrlBits);
	if (Status != XST_SUCCESS) {
		goto END;
	}

	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));

	xil_printf("\r\nMisc Control eFuses:\n\r");

	if (MiscCtrlBits->GlitchDetHaltBootEn != FALSE) {
		xil_printf("GdHaltBootEn efuse is programmed\r\n");
	}
	else {
		xil_printf("GdHaltBootEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->GlitchDetRomMonitorEn == TRUE) {
		xil_printf("GdRomMonitorEn efuse is programmed\n\r");
	}
	else {
		xil_printf("GdRomMonitorEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->HaltBootError != FALSE) {
		xil_printf("HaltBootError efuse is programmed\n\r");
	}
	else {
		xil_printf("HaltBootError efuse is not programmed\r\n");
	}
	if (MiscCtrlBits->HaltBootEnv != FALSE) {
		xil_printf("HaltBootEnv efuse is programmed\n\r");
	}
	else {
		xil_printf("HaltBootEnv efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->CryptoKatEn == TRUE) {
		xil_printf("CryptoKatEn efuse is programmed\n\r");
	}
	else {
		xil_printf("CryptoKatEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->LbistEn == TRUE) {
		xil_printf("LbistEn efuse is programmed\n\r");
	}
	else {
		xil_printf("LbistEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->SafetyMissionEn == TRUE) {
		xil_printf("SafetyMissionEn efuse is programmed\n\r");
	}
	else {
		xil_printf("SafetyMissionEn efuse is not programmed\n\r");
	}
	if(MiscCtrlBits->Ppk0Invalid != FALSE) {
		xil_printf("Ppk0 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk0 hash stored in efuse is valid\n\r");
	}
	if(MiscCtrlBits->Ppk1Invalid != FALSE) {
		xil_printf("Ppk1 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk1 hash stored in efuse is valid\n\r");
	}
	if(MiscCtrlBits->Ppk2Invalid != FALSE) {
		xil_printf("Ppk2 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk2 hash stored in efuse is valid\n\r");
	}
	Status = XST_SUCCESS;

END:
	return Status;
}
/****************************************************************************/
/**
 * This API reads Misc control bits from efuse cache and displays here.
 *
 * @return
 * 		- XST_SUCCESS - If read is successful
 * 		- ErrorCode - On failure
 *
 ******************************************************************************/
This API reads Misc control bits from efuse cache and displays here.
@return
- XST_SUCCESS - If read is successful
- ErrorCode - On failure
This API reads Misc control bits from efuse cache and displays here . @return - XST_SUCCESS - If read is successful - ErrorCode - On failure
static int XilNvm_EfuseShowMiscCtrlBits(void)
{
	int Status = XST_FAILURE;
	XNvm_EfuseMiscCtrlBits *MiscCtrlBits =
		(XNvm_EfuseMiscCtrlBits *)CacheAlignedArr;
	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));
	Status = XNvm_EfuseReadMiscCtrlBits((UINTPTR)MiscCtrlBits);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));
	xil_printf("\r\nMisc Control eFuses:\n\r");
	if (MiscCtrlBits->GlitchDetHaltBootEn != FALSE) {
		xil_printf("GdHaltBootEn efuse is programmed\r\n");
	}
	else {
		xil_printf("GdHaltBootEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->GlitchDetRomMonitorEn == TRUE) {
		xil_printf("GdRomMonitorEn efuse is programmed\n\r");
	}
	else {
		xil_printf("GdRomMonitorEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->HaltBootError != FALSE) {
		xil_printf("HaltBootError efuse is programmed\n\r");
	}
	else {
		xil_printf("HaltBootError efuse is not programmed\r\n");
	}
	if (MiscCtrlBits->HaltBootEnv != FALSE) {
		xil_printf("HaltBootEnv efuse is programmed\n\r");
	}
	else {
		xil_printf("HaltBootEnv efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->CryptoKatEn == TRUE) {
		xil_printf("CryptoKatEn efuse is programmed\n\r");
	}
	else {
		xil_printf("CryptoKatEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->LbistEn == TRUE) {
		xil_printf("LbistEn efuse is programmed\n\r");
	}
	else {
		xil_printf("LbistEn efuse is not programmed\n\r");
	}
	if (MiscCtrlBits->SafetyMissionEn == TRUE) {
		xil_printf("SafetyMissionEn efuse is programmed\n\r");
	}
	else {
		xil_printf("SafetyMissionEn efuse is not programmed\n\r");
	}
	if(MiscCtrlBits->Ppk0Invalid != FALSE) {
		xil_printf("Ppk0 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk0 hash stored in efuse is valid\n\r");
	}
	if(MiscCtrlBits->Ppk1Invalid != FALSE) {
		xil_printf("Ppk1 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk1 hash stored in efuse is valid\n\r");
	}
	if(MiscCtrlBits->Ppk2Invalid != FALSE) {
		xil_printf("Ppk2 hash stored in efuse is invalid\n\r");
	}
	else {
		xil_printf("Ppk2 hash stored in efuse is valid\n\r");
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XilNvm_EfuseShowMiscCtrlBits ( void ) { int Status = XST_FAILURE ; XNvm_EfuseMiscCtrlBits * MiscCtrlBits = ( XNvm_EfuseMiscCtrlBits * ) CacheAlignedArr ; Xil_DCacheInvalidateRange ( ( UINTPTR ) & CacheAlignedArr , sizeof ( CacheAlignedArr ) ) ; Status = XNvm_EfuseReadMiscCtrlBits ( ( UINTPTR ) MiscCtrlBits ) ; if ( Status != XST_SUCCESS ) { goto END ; } Xil_DCacheInvalidateRange ( ( UINTPTR ) & CacheAlignedArr , sizeof ( CacheAlignedArr ) ) ; xil_printf ( " \r \n \n \r " ) ; if ( MiscCtrlBits -> GlitchDetHaltBootEn != FALSE ) { xil_printf ( " \r \n " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> GlitchDetRomMonitorEn == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> HaltBootError != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \r \n " ) ; } if ( MiscCtrlBits -> HaltBootEnv != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> CryptoKatEn == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> LbistEn == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> SafetyMissionEn == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> Ppk0Invalid != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> Ppk1Invalid != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( MiscCtrlBits -> Ppk2Invalid != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } Status = XST_SUCCESS ; END : return Status ; }
This API reads Misc control bits from efuse cache and displays here.
This API reads Misc control bits from efuse cache and displays here .