lib/sw_services/xilnvm/src/server/xnvm_bbram_ipihandler.c
int XNvm_BbramIpiHandler(XPlmi_Cmd *Cmd)
{
	volatile int Status = XST_FAILURE;
	u32 *Pload = Cmd->Payload;

	if (Pload == NULL) {
		Status = XST_INVALID_PARAM;
		goto END;
	}

	switch (Cmd->CmdId & XNVM_API_ID_MASK) {
	case XNVM_API(XNVM_BBRAM_WRITE_AES_KEY):
		Status = XNvm_BbramKeyWrite(Pload[0], Pload[1], Pload[2]);
		break;
	case XNVM_API(XNVM_BBRAM_ZEROIZE):
		Status = XNvm_BbramClear();
		break;
	case XNVM_API(XNVM_BBRAM_WRITE_USER_DATA):
		Status = XNvm_BbramUsrDataWrite(Pload[0]);
		break;
	case XNVM_API(XNVM_BBRAM_READ_USER_DATA):
		Status = XNvm_BbramUsrDataRead(Pload[0], Pload[1]);
		break;
	case XNVM_API(XNVM_BBRAM_LOCK_WRITE_USER_DATA):
		Status = XNvm_BbramLockUsrData();
		break;
	default:
		XNvm_Printf(XNVM_DEBUG_GENERAL, "CMD: INVALID PARAM\r\n");
		Status = XST_INVALID_PARAM;
		break;
	}

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief       This function calls respective IPI handler based on the API_ID
 *
 * @param 	Cmd is pointer to the command structure
 *
 * @return	- XST_SUCCESS - If the handler execution is successful
 * 		- ErrorCode - If there is a failure
 *
 ******************************************************************************/
@brief       This function calls respective IPI handler based on the API_ID
@param       Cmd is pointer to the command structure

@return      - XST_SUCCESS - If the handler execution is successful
- ErrorCode - If there is a failure
@brief This function calls respective IPI handler based on the API_ID @param Cmd is pointer to the command structure @return - XST_SUCCESS - If the handler execution is successful - ErrorCode - If there is a failure
int XNvm_BbramIpiHandler(XPlmi_Cmd *Cmd)
{
	volatile int Status = XST_FAILURE;
	u32 *Pload = Cmd->Payload;
	if (Pload == NULL) {
		Status = XST_INVALID_PARAM;
		goto END;
	}
	switch (Cmd->CmdId & XNVM_API_ID_MASK) {
	case XNVM_API(XNVM_BBRAM_WRITE_AES_KEY):
		Status = XNvm_BbramKeyWrite(Pload[0], Pload[1], Pload[2]);
		break;
	case XNVM_API(XNVM_BBRAM_ZEROIZE):
		Status = XNvm_BbramClear();
		break;
	case XNVM_API(XNVM_BBRAM_WRITE_USER_DATA):
		Status = XNvm_BbramUsrDataWrite(Pload[0]);
		break;
	case XNVM_API(XNVM_BBRAM_READ_USER_DATA):
		Status = XNvm_BbramUsrDataRead(Pload[0], Pload[1]);
		break;
	case XNVM_API(XNVM_BBRAM_LOCK_WRITE_USER_DATA):
		Status = XNvm_BbramLockUsrData();
		break;
	default:
		XNvm_Printf(XNVM_DEBUG_GENERAL, "CMD: INVALID PARAM\r\n");
		Status = XST_INVALID_PARAM;
		break;
	}
END:
	return Status;
}
int XNvm_BbramIpiHandler ( XPlmi_Cmd * Cmd ) { volatile int Status = XST_FAILURE ; u32 * Pload = Cmd -> Payload ; if ( Pload == NULL ) { Status = XST_INVALID_PARAM ; goto END ; } switch ( Cmd -> CmdId & XNVM_API_ID_MASK ) { case XNVM_API ( XNVM_BBRAM_WRITE_AES_KEY ) : Status = XNvm_BbramKeyWrite ( Pload [ 0 ] , Pload [ 1 ] , Pload [ 2 ] ) ; break ; case XNVM_API ( XNVM_BBRAM_ZEROIZE ) : Status = XNvm_BbramClear ( ) ; break ; case XNVM_API ( XNVM_BBRAM_WRITE_USER_DATA ) : Status = XNvm_BbramUsrDataWrite ( Pload [ 0 ] ) ; break ; case XNVM_API ( XNVM_BBRAM_READ_USER_DATA ) : Status = XNvm_BbramUsrDataRead ( Pload [ 0 ] , Pload [ 1 ] ) ; break ; case XNVM_API ( XNVM_BBRAM_LOCK_WRITE_USER_DATA ) : Status = XNvm_BbramLockUsrData ( ) ; break ; default : XNvm_Printf ( XNVM_DEBUG_GENERAL , " \r \n " ) ; Status = XST_INVALID_PARAM ; break ; } END : return Status ; }
@brief       This function calls respective IPI handler based on the API_ID
 @param       Cmd is pointer to the command structure
@brief This function calls respective IPI handler based on the API_ID @param Cmd is pointer to the command structure