lib/sw_services/xilnvm/examples/xilnvm_efuse_versal_client_example.c
static int XilNvm_EfuseShowSecCtrlBits(void)
{
	int Status = XST_FAILURE;
	XNvm_EfuseSecCtrlBits *SecCtrlBits =
		(XNvm_EfuseSecCtrlBits *)CacheAlignedArr;

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

	Status = XNvm_EfuseReadSecCtrlBits((UINTPTR)SecCtrlBits);
	if (Status != XST_SUCCESS) {
		goto END;
	}

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

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

	if (SecCtrlBits->AesDis == TRUE) {
		xil_printf("\r\nAES is disabled\n\r");
	}
	else {
		xil_printf("\r\nAES is not disabled\n\r");
	}

	if (SecCtrlBits->JtagErrOutDis == TRUE) {
		xil_printf("JTAG Error Out is disabled\n\r");
	}
	else {
		xil_printf("JTAG Error Out is not disabled\n\r");
	}
	if (SecCtrlBits->JtagDis == TRUE) {
		xil_printf("JTAG is disabled\n\r");
	}
	else {
		xil_printf("JTAG is not disabled\n\r");
	}
	if (SecCtrlBits->Ppk0WrLk == TRUE) {
		xil_printf("Locks writing to PPK0 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK0 efuse is not locked\n\r");
	}
	if (SecCtrlBits->Ppk1WrLk == TRUE) {
		xil_printf("Locks writing to PPK1 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK1 efuse is not locked\n\r");
	}
	if (SecCtrlBits->Ppk2WrLk == TRUE) {
		xil_printf("Locks writing to PPK2 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK2 efuse is not locked\n\r");
	}
	if (SecCtrlBits->AesCrcLk != FALSE) {
		xil_printf("CRC check on AES key is disabled\n\r");
	}
	else {
		xil_printf("CRC check on AES key is not disabled\n\r");
	}
	if (SecCtrlBits->AesWrLk == TRUE) {
		xil_printf("Programming AES key is disabled\n\r");
	}
	else {
		xil_printf("Programming AES key is not disabled\n\r");
	}
	if (SecCtrlBits->UserKey0CrcLk == TRUE) {
		xil_printf("CRC check on User key 0 is disabled\n\r");
	}
	else {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	if (SecCtrlBits->UserKey0WrLk == TRUE) {
		xil_printf("Programming User key 0 is disabled\n\r");
	}
	else {
		xil_printf("Programming User key 0 is not disabled\n\r");
	}
	if (SecCtrlBits->UserKey1CrcLk == TRUE) {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	else {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	if (SecCtrlBits->UserKey1WrLk == TRUE) {
		xil_printf("Programming User key 1 is disabled\n\r");
	}
	else {
		xil_printf("Programming User key 1 is not disabled\n\r");
	}
	if (SecCtrlBits->SecDbgDis != FALSE) {
		xil_printf("Secure Debug feature is disabled\n\r");
	}
	else {
		xil_printf("Secure Debug feature is enabled\n\r");
	}
	if (SecCtrlBits->SecLockDbgDis != FALSE) {
		xil_printf("Secure Debug feature in JTAG is disabled\n\r");
	}
	else {
		xil_printf("Secure Debug feature in JTAG is enabled\n\r");
	}
	if (SecCtrlBits->BootEnvWrLk == TRUE) {
		xil_printf("Update to BOOT_ENV_CTRL row is disabled\n\r");
	}
	else {
		xil_printf("Update to BOOT_ENV_CTRL row is enabled\n\r");
	}
	if(SecCtrlBits->RegInitDis != FALSE) {
		xil_printf("Register Init is disabled\n\r");
	}
	else {
		xil_printf("Register Init is enabled\n\r");
	}
	Status = XST_SUCCESS;

END:
	return Status;
}
/****************************************************************************/
/**
 * This API reads secure and control bits from efuse cache and displays here.
 *
 * @return
 * 		- XST_SUCCESS - If read is successful
 * 		- ErrorCode - On failure
 *
 ******************************************************************************/
This API reads secure and control bits from efuse cache and displays here.
@return
- XST_SUCCESS - If read is successful
- ErrorCode - On failure
This API reads secure and control bits from efuse cache and displays here . @return - XST_SUCCESS - If read is successful - ErrorCode - On failure
static int XilNvm_EfuseShowSecCtrlBits(void)
{
	int Status = XST_FAILURE;
	XNvm_EfuseSecCtrlBits *SecCtrlBits =
		(XNvm_EfuseSecCtrlBits *)CacheAlignedArr;
	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));
	Status = XNvm_EfuseReadSecCtrlBits((UINTPTR)SecCtrlBits);
	if (Status != XST_SUCCESS) {
		goto END;
	}
	Xil_DCacheInvalidateRange((UINTPTR)&CacheAlignedArr,
		sizeof(CacheAlignedArr));
	xil_printf("\r\nSecurity Control eFuses:\n\r");
	if (SecCtrlBits->AesDis == TRUE) {
		xil_printf("\r\nAES is disabled\n\r");
	}
	else {
		xil_printf("\r\nAES is not disabled\n\r");
	}
	if (SecCtrlBits->JtagErrOutDis == TRUE) {
		xil_printf("JTAG Error Out is disabled\n\r");
	}
	else {
		xil_printf("JTAG Error Out is not disabled\n\r");
	}
	if (SecCtrlBits->JtagDis == TRUE) {
		xil_printf("JTAG is disabled\n\r");
	}
	else {
		xil_printf("JTAG is not disabled\n\r");
	}
	if (SecCtrlBits->Ppk0WrLk == TRUE) {
		xil_printf("Locks writing to PPK0 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK0 efuse is not locked\n\r");
	}
	if (SecCtrlBits->Ppk1WrLk == TRUE) {
		xil_printf("Locks writing to PPK1 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK1 efuse is not locked\n\r");
	}
	if (SecCtrlBits->Ppk2WrLk == TRUE) {
		xil_printf("Locks writing to PPK2 efuse\n\r");
	}
	else {
		xil_printf("Writing to PPK2 efuse is not locked\n\r");
	}
	if (SecCtrlBits->AesCrcLk != FALSE) {
		xil_printf("CRC check on AES key is disabled\n\r");
	}
	else {
		xil_printf("CRC check on AES key is not disabled\n\r");
	}
	if (SecCtrlBits->AesWrLk == TRUE) {
		xil_printf("Programming AES key is disabled\n\r");
	}
	else {
		xil_printf("Programming AES key is not disabled\n\r");
	}
	if (SecCtrlBits->UserKey0CrcLk == TRUE) {
		xil_printf("CRC check on User key 0 is disabled\n\r");
	}
	else {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	if (SecCtrlBits->UserKey0WrLk == TRUE) {
		xil_printf("Programming User key 0 is disabled\n\r");
	}
	else {
		xil_printf("Programming User key 0 is not disabled\n\r");
	}
	if (SecCtrlBits->UserKey1CrcLk == TRUE) {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	else {
		xil_printf("CRC check on User key 1 is disabled\n\r");
	}
	if (SecCtrlBits->UserKey1WrLk == TRUE) {
		xil_printf("Programming User key 1 is disabled\n\r");
	}
	else {
		xil_printf("Programming User key 1 is not disabled\n\r");
	}
	if (SecCtrlBits->SecDbgDis != FALSE) {
		xil_printf("Secure Debug feature is disabled\n\r");
	}
	else {
		xil_printf("Secure Debug feature is enabled\n\r");
	}
	if (SecCtrlBits->SecLockDbgDis != FALSE) {
		xil_printf("Secure Debug feature in JTAG is disabled\n\r");
	}
	else {
		xil_printf("Secure Debug feature in JTAG is enabled\n\r");
	}
	if (SecCtrlBits->BootEnvWrLk == TRUE) {
		xil_printf("Update to BOOT_ENV_CTRL row is disabled\n\r");
	}
	else {
		xil_printf("Update to BOOT_ENV_CTRL row is enabled\n\r");
	}
	if(SecCtrlBits->RegInitDis != FALSE) {
		xil_printf("Register Init is disabled\n\r");
	}
	else {
		xil_printf("Register Init is enabled\n\r");
	}
	Status = XST_SUCCESS;
END:
	return Status;
}
static int XilNvm_EfuseShowSecCtrlBits ( void ) { int Status = XST_FAILURE ; XNvm_EfuseSecCtrlBits * SecCtrlBits = ( XNvm_EfuseSecCtrlBits * ) CacheAlignedArr ; Xil_DCacheInvalidateRange ( ( UINTPTR ) & CacheAlignedArr , sizeof ( CacheAlignedArr ) ) ; Status = XNvm_EfuseReadSecCtrlBits ( ( UINTPTR ) SecCtrlBits ) ; if ( Status != XST_SUCCESS ) { goto END ; } Xil_DCacheInvalidateRange ( ( UINTPTR ) & CacheAlignedArr , sizeof ( CacheAlignedArr ) ) ; xil_printf ( " \r \n \n \r " ) ; if ( SecCtrlBits -> AesDis == TRUE ) { xil_printf ( " \r \n \n \r " ) ; } else { xil_printf ( " \r \n \n \r " ) ; } if ( SecCtrlBits -> JtagErrOutDis == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> JtagDis == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> Ppk0WrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> Ppk1WrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> Ppk2WrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> AesCrcLk != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> AesWrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> UserKey0CrcLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> UserKey0WrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> UserKey1CrcLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> UserKey1WrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> SecDbgDis != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> SecLockDbgDis != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> BootEnvWrLk == TRUE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } if ( SecCtrlBits -> RegInitDis != FALSE ) { xil_printf ( " \n \r " ) ; } else { xil_printf ( " \n \r " ) ; } Status = XST_SUCCESS ; END : return Status ; }
This API reads secure and control bits from efuse cache and displays here.
This API reads secure and control bits from efuse cache and displays here .