lib/sw_services/xilnvm/examples/xilnvm_bbram_versal_client_example.c
static int BbramWriteAesKey(void)
{
	int Status = XST_FAILURE;
	u8 AesKey[XNVM_BBRAM_AES_KEY_LEN_IN_BYTES];

	/* Validate the key */
	Status = XNvm_ValidateAesKey((char *)XNVM_BBRAM_AES_KEY);
	if(Status != XST_SUCCESS) {
		goto END;
	}

	/* Convert key given in macro and assign it to the variable */
	Xil_ConvertStringToHexLE((char *)XNVM_BBRAM_AES_KEY,
				AesKey, XNVM_BBRAM_AES_KEY_LEN_IN_BITS);

	Xil_DCacheFlushRange((UINTPTR)AesKey, XNVM_BBRAM_AES_KEY_LEN_IN_BYTES);

	/* Write AES key to BBRAM */
	Status = XNvm_BbramWriteAesKey((UINTPTR)AesKey,
				       XNVM_BBRAM_AES_KEY_LEN_IN_BYTES);

END:
	return Status;
}
/*****************************************************************************/
/**
* BbramWriteAesKey function writes AES key defined by macro XNVM_BBRAM_AES_KEY
* in BBRAM.
*
* @return
*		- XST_SUCCESS if the Aes key write successful
*		- XST_FAILURE if the Aes key write failed
*
******************************************************************************/
BbramWriteAesKey function writes AES key defined by macro XNVM_BBRAM_AES_KEY
in BBRAM.
BbramWriteAesKey function writes AES key defined by macro XNVM_BBRAM_AES_KEY in BBRAM .
static int BbramWriteAesKey(void)
{
	int Status = XST_FAILURE;
	u8 AesKey[XNVM_BBRAM_AES_KEY_LEN_IN_BYTES];
	Status = XNvm_ValidateAesKey((char *)XNVM_BBRAM_AES_KEY);
	if(Status != XST_SUCCESS) {
		goto END;
	}
	Xil_ConvertStringToHexLE((char *)XNVM_BBRAM_AES_KEY,
				AesKey, XNVM_BBRAM_AES_KEY_LEN_IN_BITS);
	Xil_DCacheFlushRange((UINTPTR)AesKey, XNVM_BBRAM_AES_KEY_LEN_IN_BYTES);
	Status = XNvm_BbramWriteAesKey((UINTPTR)AesKey,
				       XNVM_BBRAM_AES_KEY_LEN_IN_BYTES);
END:
	return Status;
}
static int BbramWriteAesKey ( void ) { int Status = XST_FAILURE ; u8 AesKey [ XNVM_BBRAM_AES_KEY_LEN_IN_BYTES ] ; Status = XNvm_ValidateAesKey ( ( char * ) XNVM_BBRAM_AES_KEY ) ; if ( Status != XST_SUCCESS ) { goto END ; } Xil_ConvertStringToHexLE ( ( char * ) XNVM_BBRAM_AES_KEY , AesKey , XNVM_BBRAM_AES_KEY_LEN_IN_BITS ) ; Xil_DCacheFlushRange ( ( UINTPTR ) AesKey , XNVM_BBRAM_AES_KEY_LEN_IN_BYTES ) ; Status = XNvm_BbramWriteAesKey ( ( UINTPTR ) AesKey , XNVM_BBRAM_AES_KEY_LEN_IN_BYTES ) ; END : return Status ; }
BbramWriteAesKey function writes AES key defined by macro XNVM_BBRAM_AES_KEY
in BBRAM.
BbramWriteAesKey function writes AES key defined by macro XNVM_BBRAM_AES_KEY in BBRAM .
/* Validate the key */ /* Convert key given in macro and assign it to the variable */ /* Write AES key to BBRAM */