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

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

	switch (Cmd->CmdId & 0xFFU) {
	case XNVM_API(XNVM_API_FEATURES):
		Status = XNvm_FeaturesCmd(Pload[0]);
		break;
	case XNVM_API(XNVM_BBRAM_WRITE_AES_KEY):
	case XNVM_API(XNVM_BBRAM_ZEROIZE):
	case XNVM_API(XNVM_BBRAM_WRITE_USER_DATA):
	case XNVM_API(XNVM_BBRAM_READ_USER_DATA):
	case XNVM_API(XNVM_BBRAM_LOCK_WRITE_USER_DATA):
		Status = XNvm_BbramIpiHandler(Cmd);
		break;
	case XNVM_API(XNVM_EFUSE_WRITE):
	case XNVM_API(XNVM_EFUSE_READ_IV):
	case XNVM_API(XNVM_EFUSE_READ_REVOCATION_ID):
	case XNVM_API(XNVM_EFUSE_READ_OFFCHIP_REVOCATION_ID):
	case XNVM_API(XNVM_EFUSE_READ_USER_FUSES):
	case XNVM_API(XNVM_EFUSE_READ_MISC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_SEC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_SEC_MISC1_BITS):
	case XNVM_API(XNVM_EFUSE_READ_BOOT_ENV_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_PUF_SEC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_PPK_HASH):
	case XNVM_API(XNVM_EFUSE_READ_DEC_EFUSE_ONLY):
	case XNVM_API(XNVM_EFUSE_READ_DNA):
#ifdef XNVM_ACCESS_PUF_USER_DATA
	case XNVM_API(XNVM_EFUSE_PUF_USER_FUSE_WRITE):
	case XNVM_API(XNVM_EFUSE_READ_PUF_USER_FUSE):
#else
	case XNVM_API(XNVM_EFUSE_WRITE_PUF):
	case XNVM_API(XNVM_EFUSE_READ_PUF):
#endif
		Status = XNvm_EfuseIpiHandler(Cmd);
		break;
	default:
		XNvm_Printf(XNVM_DEBUG_GENERAL, "CMD: INVALID PARAM\r\n");
		Status = XST_INVALID_PARAM;
		break;
	}

END:
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function processes XilNvm IPI commands
 *
 * @param	Cmd 	Pointer to the XPlmi_Cmd structure
 *
 * @return 	XST_SUCCESS		On successful IPI processing
 * 		XST_INVALID_PARAM	On invalid command
 * 		Error Code 		On Failure
 *****************************************************************************/
@brief       This function processes XilNvm IPI commands
@param       Cmd     Pointer to the XPlmi_Cmd structure

@return      XST_SUCCESS             On successful IPI processing
XST_INVALID_PARAM       On invalid command
Error Code              On Failure
@brief This function processes XilNvm IPI commands @param Cmd Pointer to the XPlmi_Cmd structure @return XST_SUCCESS On successful IPI processing XST_INVALID_PARAM On invalid command Error Code On Failure
static int XNvm_ProcessCmd(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	u32 *Pload = Cmd->Payload;
	if (Pload == NULL) {
		Status = XST_INVALID_PARAM;
		goto END;
	}
	switch (Cmd->CmdId & 0xFFU) {
	case XNVM_API(XNVM_API_FEATURES):
		Status = XNvm_FeaturesCmd(Pload[0]);
		break;
	case XNVM_API(XNVM_BBRAM_WRITE_AES_KEY):
	case XNVM_API(XNVM_BBRAM_ZEROIZE):
	case XNVM_API(XNVM_BBRAM_WRITE_USER_DATA):
	case XNVM_API(XNVM_BBRAM_READ_USER_DATA):
	case XNVM_API(XNVM_BBRAM_LOCK_WRITE_USER_DATA):
		Status = XNvm_BbramIpiHandler(Cmd);
		break;
	case XNVM_API(XNVM_EFUSE_WRITE):
	case XNVM_API(XNVM_EFUSE_READ_IV):
	case XNVM_API(XNVM_EFUSE_READ_REVOCATION_ID):
	case XNVM_API(XNVM_EFUSE_READ_OFFCHIP_REVOCATION_ID):
	case XNVM_API(XNVM_EFUSE_READ_USER_FUSES):
	case XNVM_API(XNVM_EFUSE_READ_MISC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_SEC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_SEC_MISC1_BITS):
	case XNVM_API(XNVM_EFUSE_READ_BOOT_ENV_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_PUF_SEC_CTRL_BITS):
	case XNVM_API(XNVM_EFUSE_READ_PPK_HASH):
	case XNVM_API(XNVM_EFUSE_READ_DEC_EFUSE_ONLY):
	case XNVM_API(XNVM_EFUSE_READ_DNA):
#ifdef XNVM_ACCESS_PUF_USER_DATA
	case XNVM_API(XNVM_EFUSE_PUF_USER_FUSE_WRITE):
	case XNVM_API(XNVM_EFUSE_READ_PUF_USER_FUSE):
#else
	case XNVM_API(XNVM_EFUSE_WRITE_PUF):
	case XNVM_API(XNVM_EFUSE_READ_PUF):
#endif
		Status = XNvm_EfuseIpiHandler(Cmd);
		break;
	default:
		XNvm_Printf(XNVM_DEBUG_GENERAL, "CMD: INVALID PARAM\r\n");
		Status = XST_INVALID_PARAM;
		break;
	}
END:
	return Status;
}
static int XNvm_ProcessCmd ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; u32 * Pload = Cmd -> Payload ; if ( Pload == NULL ) { Status = XST_INVALID_PARAM ; goto END ; } switch ( Cmd -> CmdId & 0xFFU ) { case XNVM_API ( XNVM_API_FEATURES ) : Status = XNvm_FeaturesCmd ( Pload [ 0 ] ) ; break ; case XNVM_API ( XNVM_BBRAM_WRITE_AES_KEY ) : case XNVM_API ( XNVM_BBRAM_ZEROIZE ) : case XNVM_API ( XNVM_BBRAM_WRITE_USER_DATA ) : case XNVM_API ( XNVM_BBRAM_READ_USER_DATA ) : case XNVM_API ( XNVM_BBRAM_LOCK_WRITE_USER_DATA ) : Status = XNvm_BbramIpiHandler ( Cmd ) ; break ; case XNVM_API ( XNVM_EFUSE_WRITE ) : case XNVM_API ( XNVM_EFUSE_READ_IV ) : case XNVM_API ( XNVM_EFUSE_READ_REVOCATION_ID ) : case XNVM_API ( XNVM_EFUSE_READ_OFFCHIP_REVOCATION_ID ) : case XNVM_API ( XNVM_EFUSE_READ_USER_FUSES ) : case XNVM_API ( XNVM_EFUSE_READ_MISC_CTRL_BITS ) : case XNVM_API ( XNVM_EFUSE_READ_SEC_CTRL_BITS ) : case XNVM_API ( XNVM_EFUSE_READ_SEC_MISC1_BITS ) : case XNVM_API ( XNVM_EFUSE_READ_BOOT_ENV_CTRL_BITS ) : case XNVM_API ( XNVM_EFUSE_READ_PUF_SEC_CTRL_BITS ) : case XNVM_API ( XNVM_EFUSE_READ_PPK_HASH ) : case XNVM_API ( XNVM_EFUSE_READ_DEC_EFUSE_ONLY ) : case XNVM_API ( XNVM_EFUSE_READ_DNA ) : #ifdef XNVM_ACCESS_PUF_USER_DATA case XNVM_API ( XNVM_EFUSE_PUF_USER_FUSE_WRITE ) : case XNVM_API ( XNVM_EFUSE_READ_PUF_USER_FUSE ) : #else case XNVM_API ( XNVM_EFUSE_WRITE_PUF ) : case XNVM_API ( XNVM_EFUSE_READ_PUF ) : #endif Status = XNvm_EfuseIpiHandler ( Cmd ) ; break ; default : XNvm_Printf ( XNVM_DEBUG_GENERAL , " \r \n " ) ; Status = XST_INVALID_PARAM ; break ; } END : return Status ; }
@brief       This function processes XilNvm IPI commands
 @param       Cmd     Pointer to the XPlmi_Cmd structure
@brief This function processes XilNvm IPI commands @param Cmd Pointer to the XPlmi_Cmd structure