lib/sw_services/xilfpga/src/interface/zynqmp/xilfpga_ipi_pcap.c
static u32 XFpga_IPI_WriteToPl(XFpga *InstancePtr)
{
	volatile u32 Status = XFPGA_FAILURE;
	u32 ReqBuffer[FPGA_MSG_LEN] = {0};
	UINTPTR BitstreamAddr = InstancePtr->WriteInfo.BitstreamAddr;

	ReqBuffer[0U] = PM_FPGA_LOAD;
	ReqBuffer[1U] = UPPER_32_BITS(BitstreamAddr);
	ReqBuffer[2U] = (u32)BitstreamAddr;

	if ((InstancePtr->WriteInfo.Flags & XFPGA_ENCRYPTION_USERKEY_EN) != 0U)
	{
		ReqBuffer[3U] = InstancePtr->WriteInfo.KeyAddr;
	} else {
		ReqBuffer[3U] = InstancePtr->WriteInfo.Size;
	}

	ReqBuffer[4U] = InstancePtr->WriteInfo.Flags;

	/* Send an IPI Req Message */
	Status = XMailbox_SendData(&XMboxInstance, XMAILBOX_IPI3, ReqBuffer,
				   FPGA_MSG_LEN, XILMBOX_MSG_TYPE_REQ,
				   FPGA_IPI_TYPE_BLOCKING);
	if (Status != (u32)XST_SUCCESS) {
		goto END;
	}

	Status = XFPGA_FAILURE;
	Status = XMailbox_Recv(&XMboxInstance, XMAILBOX_IPI3, ReqBuffer,
			       FPGA_IPI_RESP1, XILMBOX_MSG_TYPE_RESP);
	if (Status != (u32)XST_SUCCESS) {
		goto END;
	}

	Status =  ReqBuffer[0U];

END:
	return Status;
}
/*****************************************************************************/
/**
 * This function writes bitstream data into the PL.
 *
 * @param InstancePtr Pointer to the XFpga structure.
 *
 * @return	Returns Status
 *		- XFPGA_SUCCESS on success
 *		- Error code on failure
 *
 *****************************************************************************/
This function writes bitstream data into the PL.
@param InstancePtr Pointer to the XFpga structure.

@return      Returns Status
- XFPGA_SUCCESS on success
- Error code on failure
This function writes bitstream data into the PL . @param InstancePtr Pointer to the XFpga structure . @return Returns Status - XFPGA_SUCCESS on success - Error code on failure
static u32 XFpga_IPI_WriteToPl(XFpga *InstancePtr)
{
	volatile u32 Status = XFPGA_FAILURE;
	u32 ReqBuffer[FPGA_MSG_LEN] = {0};
	UINTPTR BitstreamAddr = InstancePtr->WriteInfo.BitstreamAddr;
	ReqBuffer[0U] = PM_FPGA_LOAD;
	ReqBuffer[1U] = UPPER_32_BITS(BitstreamAddr);
	ReqBuffer[2U] = (u32)BitstreamAddr;
	if ((InstancePtr->WriteInfo.Flags & XFPGA_ENCRYPTION_USERKEY_EN) != 0U)
	{
		ReqBuffer[3U] = InstancePtr->WriteInfo.KeyAddr;
	} else {
		ReqBuffer[3U] = InstancePtr->WriteInfo.Size;
	}
	ReqBuffer[4U] = InstancePtr->WriteInfo.Flags;
	Status = XMailbox_SendData(&XMboxInstance, XMAILBOX_IPI3, ReqBuffer,
				   FPGA_MSG_LEN, XILMBOX_MSG_TYPE_REQ,
				   FPGA_IPI_TYPE_BLOCKING);
	if (Status != (u32)XST_SUCCESS) {
		goto END;
	}
	Status = XFPGA_FAILURE;
	Status = XMailbox_Recv(&XMboxInstance, XMAILBOX_IPI3, ReqBuffer,
			       FPGA_IPI_RESP1, XILMBOX_MSG_TYPE_RESP);
	if (Status != (u32)XST_SUCCESS) {
		goto END;
	}
	Status =  ReqBuffer[0U];
END:
	return Status;
}
static u32 XFpga_IPI_WriteToPl ( XFpga * InstancePtr ) { volatile u32 Status = XFPGA_FAILURE ; u32 ReqBuffer [ FPGA_MSG_LEN ] = { 0 } ; UINTPTR BitstreamAddr = InstancePtr -> WriteInfo . BitstreamAddr ; ReqBuffer [ 0U ] = PM_FPGA_LOAD ; ReqBuffer [ 1U ] = UPPER_32_BITS ( BitstreamAddr ) ; ReqBuffer [ 2U ] = ( u32 ) BitstreamAddr ; if ( ( InstancePtr -> WriteInfo . Flags & XFPGA_ENCRYPTION_USERKEY_EN ) != 0U ) { ReqBuffer [ 3U ] = InstancePtr -> WriteInfo . KeyAddr ; } else { ReqBuffer [ 3U ] = InstancePtr -> WriteInfo . Size ; } ReqBuffer [ 4U ] = InstancePtr -> WriteInfo . Flags ; Status = XMailbox_SendData ( & XMboxInstance , XMAILBOX_IPI3 , ReqBuffer , FPGA_MSG_LEN , XILMBOX_MSG_TYPE_REQ , FPGA_IPI_TYPE_BLOCKING ) ; if ( Status != ( u32 ) XST_SUCCESS ) { goto END ; } Status = XFPGA_FAILURE ; Status = XMailbox_Recv ( & XMboxInstance , XMAILBOX_IPI3 , ReqBuffer , FPGA_IPI_RESP1 , XILMBOX_MSG_TYPE_RESP ) ; if ( Status != ( u32 ) XST_SUCCESS ) { goto END ; } Status = ReqBuffer [ 0U ] ; END : return Status ; }
This function writes bitstream data into the PL.
This function writes bitstream data into the PL .
/* Send an IPI Req Message */