XilinxProcessorIPLib/drivers/mcdma/src/xmcdma.c
s32 XMcDma_CfgInitialize(XMcdma *InstancePtr, XMcdma_Config *CfgPtr)
{
	u32 TimeOut;

	/* Verify arguments. */
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);

	XMcDma_Initialize(InstancePtr, CfgPtr);

	XMcDma_Reset(InstancePtr);

	/* At the initialization time, hardware should finish reset quickly */
	TimeOut = XMCDMA_LOOP_COUNT;

	while (TimeOut) {

		if(XMcdma_ResetIsDone(InstancePtr)) {
			break;
		}

		TimeOut -= 1;

	}

	if (!TimeOut) {
		xil_printf("Failed reset in initialize\r\n");

		/* Need system hard reset to recover */
		InstancePtr->IsReady = 0;
		return XST_DMA_ERROR;
	}

	if (InstancePtr->Config.IsTxCacheCoherent)
		XMcdma_SetARCache(InstancePtr, XMCDMA_AXCACHE);
	if (InstancePtr->Config.IsRxCacheCoherent)
		XMcdma_SetAWCache(InstancePtr, XMCDMA_AXCACHE);

	InstancePtr->IsReady = 1;

	return (XST_SUCCESS);
}
/*****************************************************************************/
/**
*
* This function initializes an MCDMA core. This function must be called
* prior to using an MCDMA core. Initialization of an MCDMA includes setting
* up the instance data and ensuring the hardware is in a quiescent state and
* resets all the hardware configurations.
*
* @param	InstancePtr is a pointer to the XMcdma instance.
* @param	CfgPtr is a reference to a structure containing information
*		about a specific XMcdma instance.
*
* @return
*		- XST_SUCCESS if initialization was successful.
*
* @note		None.
*
******************************************************************************/
This function initializes an MCDMA core. This function must be called
prior to using an MCDMA core. Initialization of an MCDMA includes setting
up the instance data and ensuring the hardware is in a quiescent state and
resets all the hardware configurations.
This function initializes an MCDMA core . This function must be called prior to using an MCDMA core . Initialization of an MCDMA includes setting up the instance data and ensuring the hardware is in a quiescent state and resets all the hardware configurations .
s32 XMcDma_CfgInitialize(XMcdma *InstancePtr, XMcdma_Config *CfgPtr)
{
	u32 TimeOut;
	Xil_AssertNonvoid(InstancePtr != NULL);
	Xil_AssertNonvoid(CfgPtr != NULL);
	XMcDma_Initialize(InstancePtr, CfgPtr);
	XMcDma_Reset(InstancePtr);
	TimeOut = XMCDMA_LOOP_COUNT;
	while (TimeOut) {
		if(XMcdma_ResetIsDone(InstancePtr)) {
			break;
		}
		TimeOut -= 1;
	}
	if (!TimeOut) {
		xil_printf("Failed reset in initialize\r\n");
		InstancePtr->IsReady = 0;
		return XST_DMA_ERROR;
	}
	if (InstancePtr->Config.IsTxCacheCoherent)
		XMcdma_SetARCache(InstancePtr, XMCDMA_AXCACHE);
	if (InstancePtr->Config.IsRxCacheCoherent)
		XMcdma_SetAWCache(InstancePtr, XMCDMA_AXCACHE);
	InstancePtr->IsReady = 1;
	return (XST_SUCCESS);
}
s32 XMcDma_CfgInitialize ( XMcdma * InstancePtr , XMcdma_Config * CfgPtr ) { u32 TimeOut ; Xil_AssertNonvoid ( InstancePtr != NULL ) ; Xil_AssertNonvoid ( CfgPtr != NULL ) ; XMcDma_Initialize ( InstancePtr , CfgPtr ) ; XMcDma_Reset ( InstancePtr ) ; TimeOut = XMCDMA_LOOP_COUNT ; while ( TimeOut ) { if ( XMcdma_ResetIsDone ( InstancePtr ) ) { break ; } TimeOut -= 1 ; } if ( ! TimeOut ) { xil_printf ( " \r \n " ) ; InstancePtr -> IsReady = 0 ; return XST_DMA_ERROR ; } if ( InstancePtr -> Config . IsTxCacheCoherent ) XMcdma_SetARCache ( InstancePtr , XMCDMA_AXCACHE ) ; if ( InstancePtr -> Config . IsRxCacheCoherent ) XMcdma_SetAWCache ( InstancePtr , XMCDMA_AXCACHE ) ; InstancePtr -> IsReady = 1 ; return ( XST_SUCCESS ) ; }
This function initializes an MCDMA core.
This function initializes an MCDMA core .
/* Verify arguments. */ /* At the initialization time, hardware should finish reset quickly */ /* Need system hard reset to recover */