XilinxProcessorIPLib/drivers/mcdma/src/xmcdma.c
void XMcDma_Reset(XMcdma *InstancePtr)
{
	u32 RegBase;
	int Chan_id;

	/* Verify arguments */
	Xil_AssertVoid(InstancePtr != NULL);

	if (InstancePtr->Config.HasMM2S)
		RegBase = InstancePtr->Config.BaseAddress;
	else
		RegBase = InstancePtr->Config.BaseAddress + XMCDMA_RX_OFFSET;

	/* Reset the device - In MCDMA Resetting TX or RX will reset the
	 * Entire MCDMA Engine
	 */
	XMcdma_WriteReg(RegBase, XMCDMA_CCR_OFFSET, XMCDMA_CCR_RESET_MASK);

	if (InstancePtr->Config.HasMM2S) {
		for (Chan_id = 1; Chan_id <= InstancePtr->Config.TxNumChannels;
		     Chan_id++) {
			InstancePtr->Tx_Chan[Chan_id].ChanState = XMCDMA_CHAN_IDLE;
		}
	}

	if (InstancePtr->Config.HasS2MM) {
		for (Chan_id = 1; Chan_id <= InstancePtr->Config.RxNumChannels;
		     Chan_id++) {
			InstancePtr->Rx_Chan[Chan_id].ChanState = XMCDMA_CHAN_IDLE;
		}
	}
}
/*****************************************************************************/
/**
*
* This function resets the MCDMA core.
*
* @param	InstancePtr is a pointer to the XMcdma instance.
*
* @return	None.
*
* @note		This function resets all the configurations made previously.
*
*****************************************************************************/
This function resets the MCDMA core.
This function resets the MCDMA core .
void XMcDma_Reset(XMcdma *InstancePtr)
{
	u32 RegBase;
	int Chan_id;
	Xil_AssertVoid(InstancePtr != NULL);
	if (InstancePtr->Config.HasMM2S)
		RegBase = InstancePtr->Config.BaseAddress;
	else
		RegBase = InstancePtr->Config.BaseAddress + XMCDMA_RX_OFFSET;
	XMcdma_WriteReg(RegBase, XMCDMA_CCR_OFFSET, XMCDMA_CCR_RESET_MASK);
	if (InstancePtr->Config.HasMM2S) {
		for (Chan_id = 1; Chan_id <= InstancePtr->Config.TxNumChannels;
		     Chan_id++) {
			InstancePtr->Tx_Chan[Chan_id].ChanState = XMCDMA_CHAN_IDLE;
		}
	}
	if (InstancePtr->Config.HasS2MM) {
		for (Chan_id = 1; Chan_id <= InstancePtr->Config.RxNumChannels;
		     Chan_id++) {
			InstancePtr->Rx_Chan[Chan_id].ChanState = XMCDMA_CHAN_IDLE;
		}
	}
}
void XMcDma_Reset ( XMcdma * InstancePtr ) { u32 RegBase ; int Chan_id ; Xil_AssertVoid ( InstancePtr != NULL ) ; if ( InstancePtr -> Config . HasMM2S ) RegBase = InstancePtr -> Config . BaseAddress ; else RegBase = InstancePtr -> Config . BaseAddress + XMCDMA_RX_OFFSET ; XMcdma_WriteReg ( RegBase , XMCDMA_CCR_OFFSET , XMCDMA_CCR_RESET_MASK ) ; if ( InstancePtr -> Config . HasMM2S ) { for ( Chan_id = 1 ; Chan_id <= InstancePtr -> Config . TxNumChannels ; Chan_id ++ ) { InstancePtr -> Tx_Chan [ Chan_id ] . ChanState = XMCDMA_CHAN_IDLE ; } } if ( InstancePtr -> Config . HasS2MM ) { for ( Chan_id = 1 ; Chan_id <= InstancePtr -> Config . RxNumChannels ; Chan_id ++ ) { InstancePtr -> Rx_Chan [ Chan_id ] . ChanState = XMCDMA_CHAN_IDLE ; } } }
This function resets the MCDMA core.
This function resets the MCDMA core .
/* Verify arguments */ /* Reset the device - In MCDMA Resetting TX or RX will reset the
	 * Entire MCDMA Engine
	 */