lib/sw_services/xilloader/src/xloader_cmd.c
static int XLoader_LoadReadBackPdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	XPlmi_ReadBackProps ReadBack;
	XPlmi_ReadBackProps DefaultReadBack = {
		XPLMI_READBACK_DEF_DST_ADDR, 0U, 0U
	};

	ReadBack.DestAddr = (u64)Cmd->Payload[XLOADER_CMD_READBACK_PDIADDR_HIGH_INDEX];
	ReadBack.DestAddr = ((u64)(Cmd->Payload[XLOADER_CMD_READBACK_PDIADDR_LOW_INDEX]) |
		(ReadBack.DestAddr << 32U));
	ReadBack.MaxSize = Cmd->Payload[XLOADER_CMD_READBACK_MAXLEN_INDEX] &
		XLOADER_BUFFER_MAX_SIZE_MASK;
	ReadBack.ProcessedLen = 0U;

	Status = XPlmi_SetReadBackProps(&ReadBack);
	if (Status != XST_SUCCESS) {
		Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
		goto END;
	}
	Status = XLoader_LoadSubsystemPdi(Cmd);

	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	Status = XPlmi_GetReadBackPropsValue(&ReadBack);
	if (Status != XST_SUCCESS) {
		if (Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] == (u32)XST_SUCCESS) {
			Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
		}
		goto END;
	}
	Cmd->Response[XLOADER_RESP_CMD_READBACK_PROCESSED_LEN_INDEX] =
		ReadBack.ProcessedLen;
END:
	Status = XPlmi_SetReadBackProps(&DefaultReadBack);
	if (Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] == (u32)XST_SUCCESS) {
		Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	}
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides loading of ReadBack PDI overriding
 *  destination address of readback data.
 *  Command payload parameters are
 *	- PdiSrc - Boot Mode values, DDR
 *	- PdiAddr - 64bit PDI address located in the Source
 *	- ReadbackDdrDestAddr - 64bit DDR destination address
 *	- MaxSize - MaxSize of the buffer present at destination address
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides loading of ReadBack PDI overriding
destination address of readback data.

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function provides loading of ReadBack PDI overriding destination address of readback data . @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XLoader_LoadReadBackPdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	XPlmi_ReadBackProps ReadBack;
	XPlmi_ReadBackProps DefaultReadBack = {
		XPLMI_READBACK_DEF_DST_ADDR, 0U, 0U
	};
	ReadBack.DestAddr = (u64)Cmd->Payload[XLOADER_CMD_READBACK_PDIADDR_HIGH_INDEX];
	ReadBack.DestAddr = ((u64)(Cmd->Payload[XLOADER_CMD_READBACK_PDIADDR_LOW_INDEX]) |
		(ReadBack.DestAddr << 32U));
	ReadBack.MaxSize = Cmd->Payload[XLOADER_CMD_READBACK_MAXLEN_INDEX] &
		XLOADER_BUFFER_MAX_SIZE_MASK;
	ReadBack.ProcessedLen = 0U;
	Status = XPlmi_SetReadBackProps(&ReadBack);
	if (Status != XST_SUCCESS) {
		Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
		goto END;
	}
	Status = XLoader_LoadSubsystemPdi(Cmd);
	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	Status = XPlmi_GetReadBackPropsValue(&ReadBack);
	if (Status != XST_SUCCESS) {
		if (Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] == (u32)XST_SUCCESS) {
			Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
		}
		goto END;
	}
	Cmd->Response[XLOADER_RESP_CMD_READBACK_PROCESSED_LEN_INDEX] =
		ReadBack.ProcessedLen;
END:
	Status = XPlmi_SetReadBackProps(&DefaultReadBack);
	if (Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] == (u32)XST_SUCCESS) {
		Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	}
	return Status;
}
static int XLoader_LoadReadBackPdi ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; XPlmi_ReadBackProps ReadBack ; XPlmi_ReadBackProps DefaultReadBack = { XPLMI_READBACK_DEF_DST_ADDR , 0U , 0U } ; ReadBack . DestAddr = ( u64 ) Cmd -> Payload [ XLOADER_CMD_READBACK_PDIADDR_HIGH_INDEX ] ; ReadBack . DestAddr = ( ( u64 ) ( Cmd -> Payload [ XLOADER_CMD_READBACK_PDIADDR_LOW_INDEX ] ) | ( ReadBack . DestAddr << 32U ) ) ; ReadBack . MaxSize = Cmd -> Payload [ XLOADER_CMD_READBACK_MAXLEN_INDEX ] & XLOADER_BUFFER_MAX_SIZE_MASK ; ReadBack . ProcessedLen = 0U ; Status = XPlmi_SetReadBackProps ( & ReadBack ) ; if ( Status != XST_SUCCESS ) { Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; goto END ; } Status = XLoader_LoadSubsystemPdi ( Cmd ) ; Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; Status = XPlmi_GetReadBackPropsValue ( & ReadBack ) ; if ( Status != XST_SUCCESS ) { if ( Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] == ( u32 ) XST_SUCCESS ) { Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; } goto END ; } Cmd -> Response [ XLOADER_RESP_CMD_READBACK_PROCESSED_LEN_INDEX ] = ReadBack . ProcessedLen ; END : Status = XPlmi_SetReadBackProps ( & DefaultReadBack ) ; if ( Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] == ( u32 ) XST_SUCCESS ) { Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; } return Status ; }
@brief       This function provides loading of ReadBack PDI overriding
  destination address of readback data.
@brief This function provides loading of ReadBack PDI overriding destination address of readback data .