lib/sw_services/xilloader/src/xloader_cmd.c
static int XLoader_LoadSubsystemPdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	PdiSrc_t PdiSrc;
	u64 PdiAddr;
	XilPdi* PdiPtr = &SubsystemPdiIns;

	XPlmi_Printf(DEBUG_DETAILED, "%s \n\r", __func__);

	/* Store the command fields in resume data */
	PdiSrc = (PdiSrc_t)(Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDISRC_INDEX]);
	PdiAddr = (u64)Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDIADDR_HIGH_INDEX];
	PdiAddr = ((u64)(Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDIADDR_LOW_INDEX]) |
			(PdiAddr << 32U));

	/* Input parameter validation */
	if (!((PdiSrc == XLOADER_PDI_SRC_QSPI24) ||
		(PdiSrc == XLOADER_PDI_SRC_QSPI32) ||
		(PdiSrc == XLOADER_PDI_SRC_OSPI) ||
		(PdiSrc == XLOADER_PDI_SRC_DDR))) {
		Status = XPlmi_UpdateStatus(
			XLOADER_ERR_UNSUPPORTED_SUBSYSTEM_PDISRC, (int)PdiSrc);
		goto END;
	}

	XPlmi_Printf(DEBUG_INFO, "Subsystem PDI Load: Started\n\r");

	PdiPtr->PdiType = XLOADER_PDI_TYPE_PARTIAL;
	PdiPtr->IpiMask = Cmd->IpiMask;
	Status = XLoader_LoadPdi(PdiPtr, PdiSrc, PdiAddr);
	if (Status != XST_SUCCESS) {
		/* Update the error code */
		XPlmi_ErrMgr(Status);
		goto END;
	}

	XPlmi_Printf(DEBUG_GENERAL, "Subsystem PDI Load: Done\n\r");

END:
	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function provides PDI execution from DDR.
 *  Command payload parameters are
 *	- PdiSrc - Boot Mode values, DDR, PCIe
 *	- PdiAddr - 64bit PDI address located in the Source
 *
 * @param	Cmd is pointer to the command structure
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function provides PDI execution from DDR.
Command payload parameters are
- PdiSrc - Boot Mode values, DDR, PCIe
- PdiAddr - 64bit PDI address located in the Source

@param       Cmd is pointer to the command structure

@return      XST_SUCCESS on success and error code on failure
@brief This function provides PDI execution from DDR . Command payload parameters are - PdiSrc - Boot Mode values DDR PCIe - PdiAddr - 64bit PDI address located in the Source @param Cmd is pointer to the command structure @return XST_SUCCESS on success and error code on failure
static int XLoader_LoadSubsystemPdi(XPlmi_Cmd *Cmd)
{
	int Status = XST_FAILURE;
	PdiSrc_t PdiSrc;
	u64 PdiAddr;
	XilPdi* PdiPtr = &SubsystemPdiIns;
	XPlmi_Printf(DEBUG_DETAILED, "%s \n\r", __func__);
	PdiSrc = (PdiSrc_t)(Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDISRC_INDEX]);
	PdiAddr = (u64)Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDIADDR_HIGH_INDEX];
	PdiAddr = ((u64)(Cmd->Payload[XLOADER_CMD_LOAD_PDI_PDIADDR_LOW_INDEX]) |
			(PdiAddr << 32U));
	if (!((PdiSrc == XLOADER_PDI_SRC_QSPI24) ||
		(PdiSrc == XLOADER_PDI_SRC_QSPI32) ||
		(PdiSrc == XLOADER_PDI_SRC_OSPI) ||
		(PdiSrc == XLOADER_PDI_SRC_DDR))) {
		Status = XPlmi_UpdateStatus(
			XLOADER_ERR_UNSUPPORTED_SUBSYSTEM_PDISRC, (int)PdiSrc);
		goto END;
	}
	XPlmi_Printf(DEBUG_INFO, "Subsystem PDI Load: Started\n\r");
	PdiPtr->PdiType = XLOADER_PDI_TYPE_PARTIAL;
	PdiPtr->IpiMask = Cmd->IpiMask;
	Status = XLoader_LoadPdi(PdiPtr, PdiSrc, PdiAddr);
	if (Status != XST_SUCCESS) {
		XPlmi_ErrMgr(Status);
		goto END;
	}
	XPlmi_Printf(DEBUG_GENERAL, "Subsystem PDI Load: Done\n\r");
END:
	Cmd->Response[XLOADER_RESP_CMD_EXEC_STATUS_INDEX] = (u32)Status;
	return Status;
}
static int XLoader_LoadSubsystemPdi ( XPlmi_Cmd * Cmd ) { int Status = XST_FAILURE ; PdiSrc_t PdiSrc ; u64 PdiAddr ; XilPdi * PdiPtr = & SubsystemPdiIns ; XPlmi_Printf ( DEBUG_DETAILED , " \n \r " , __func__ ) ; PdiSrc = ( PdiSrc_t ) ( Cmd -> Payload [ XLOADER_CMD_LOAD_PDI_PDISRC_INDEX ] ) ; PdiAddr = ( u64 ) Cmd -> Payload [ XLOADER_CMD_LOAD_PDI_PDIADDR_HIGH_INDEX ] ; PdiAddr = ( ( u64 ) ( Cmd -> Payload [ XLOADER_CMD_LOAD_PDI_PDIADDR_LOW_INDEX ] ) | ( PdiAddr << 32U ) ) ; if ( ! ( ( PdiSrc == XLOADER_PDI_SRC_QSPI24 ) || ( PdiSrc == XLOADER_PDI_SRC_QSPI32 ) || ( PdiSrc == XLOADER_PDI_SRC_OSPI ) || ( PdiSrc == XLOADER_PDI_SRC_DDR ) ) ) { Status = XPlmi_UpdateStatus ( XLOADER_ERR_UNSUPPORTED_SUBSYSTEM_PDISRC , ( int ) PdiSrc ) ; goto END ; } XPlmi_Printf ( DEBUG_INFO , " \n \r " ) ; PdiPtr -> PdiType = XLOADER_PDI_TYPE_PARTIAL ; PdiPtr -> IpiMask = Cmd -> IpiMask ; Status = XLoader_LoadPdi ( PdiPtr , PdiSrc , PdiAddr ) ; if ( Status != XST_SUCCESS ) { XPlmi_ErrMgr ( Status ) ; goto END ; } XPlmi_Printf ( DEBUG_GENERAL , " \n \r " ) ; END : Cmd -> Response [ XLOADER_RESP_CMD_EXEC_STATUS_INDEX ] = ( u32 ) Status ; return Status ; }
@brief       This function provides PDI execution from DDR.
@brief This function provides PDI execution from DDR .
/* Store the command fields in resume data */ /* Input parameter validation */ /* Update the error code */