lib/sw_apps/zynqmp_pmufw/src/idle_hooks.c
static void XDpDmaStopChannels(void)
{
	u8 channel = 0;
	u32 regVal = 0, LocalTimeout;

	for (channel = 0; channel < XDPDMA_NUM_CHANNEL; channel++) {
		/* Pause the channel */
		XDpDma_ReadModifyWrite(XPAR_XDPDMA_0_BASEADDR, XDPDMA_CH0_CNTL
				       + XDPDMA_CH_OFFSET * channel,
				       XDPDMA_CH_CNTL_PAUSE,
				       XDPDMA_CH_CNTL_PAUSE_MASK);

		LocalTimeout = MAX_TIMEOUT;

		/* Wait until the outstanding transactions number to go to 0 */
		do {
			regVal = XDpDma_ReadReg(XPAR_XDPDMA_0_BASEADDR,
						XDPDMA_CH0_STATUS +
						XDPDMA_CH_OFFSET * channel);
		} while ((regVal & XDPDMA_CH_STATUS_OTRAN_CNT_MASK) &&
			  --LocalTimeout);
		if (!LocalTimeout) {
			PmWarn("DP DMA not ready to stop\r\n");
			continue;
		}

		/* Disable channels */
		XDpDma_ReadModifyWrite(XPAR_XDPDMA_0_BASEADDR, XDPDMA_CH0_CNTL
				       + XDPDMA_CH_OFFSET * channel,
				       ~XDPDMA_CH_CNTL_ENABLE,
				       XDPDMA_CH_CNTL_EN_MASK);
	}

	/* Disable all DPDMA interrupts */
	XDpDma_WriteReg(XPAR_XDPDMA_0_BASEADDR, XDPDMA_IDS, ~0);
}
/**
 * XDpDmaStopChannels - Stop DPDMA channels
 *
 * Stop the channel with the following sequence: 1. Pause, 2. Wait until the
 * number of outstanding transactions to go to 0, 3. Disable the channel.
 */
Stop DPDMA channels
Stop the channel with the following sequence: 1. Pause, 2. Wait until the
number of outstanding transactions to go to 0, 3. Disable the channel.
Stop DPDMA channels Stop the channel with the following sequence : 1 . Pause 2 . Wait until the number of outstanding transactions to go to 0 3 . Disable the channel .
static void XDpDmaStopChannels(void)
{
	u8 channel = 0;
	u32 regVal = 0, LocalTimeout;
	for (channel = 0; channel < XDPDMA_NUM_CHANNEL; channel++) {
		XDpDma_ReadModifyWrite(XPAR_XDPDMA_0_BASEADDR, XDPDMA_CH0_CNTL
				       + XDPDMA_CH_OFFSET * channel,
				       XDPDMA_CH_CNTL_PAUSE,
				       XDPDMA_CH_CNTL_PAUSE_MASK);
		LocalTimeout = MAX_TIMEOUT;
		do {
			regVal = XDpDma_ReadReg(XPAR_XDPDMA_0_BASEADDR,
						XDPDMA_CH0_STATUS +
						XDPDMA_CH_OFFSET * channel);
		} while ((regVal & XDPDMA_CH_STATUS_OTRAN_CNT_MASK) &&
			  --LocalTimeout);
		if (!LocalTimeout) {
			PmWarn("DP DMA not ready to stop\r\n");
			continue;
		}
		XDpDma_ReadModifyWrite(XPAR_XDPDMA_0_BASEADDR, XDPDMA_CH0_CNTL
				       + XDPDMA_CH_OFFSET * channel,
				       ~XDPDMA_CH_CNTL_ENABLE,
				       XDPDMA_CH_CNTL_EN_MASK);
	}
	XDpDma_WriteReg(XPAR_XDPDMA_0_BASEADDR, XDPDMA_IDS, ~0);
}
static void XDpDmaStopChannels ( void ) { u8 channel = 0 ; u32 regVal = 0 , LocalTimeout ; for ( channel = 0 ; channel < XDPDMA_NUM_CHANNEL ; channel ++ ) { XDpDma_ReadModifyWrite ( XPAR_XDPDMA_0_BASEADDR , XDPDMA_CH0_CNTL + XDPDMA_CH_OFFSET * channel , XDPDMA_CH_CNTL_PAUSE , XDPDMA_CH_CNTL_PAUSE_MASK ) ; LocalTimeout = MAX_TIMEOUT ; do { regVal = XDpDma_ReadReg ( XPAR_XDPDMA_0_BASEADDR , XDPDMA_CH0_STATUS + XDPDMA_CH_OFFSET * channel ) ; } while ( ( regVal & XDPDMA_CH_STATUS_OTRAN_CNT_MASK ) && -- LocalTimeout ) ; if ( ! LocalTimeout ) { PmWarn ( " \r \n " ) ; continue ; } XDpDma_ReadModifyWrite ( XPAR_XDPDMA_0_BASEADDR , XDPDMA_CH0_CNTL + XDPDMA_CH_OFFSET * channel , ~ XDPDMA_CH_CNTL_ENABLE , XDPDMA_CH_CNTL_EN_MASK ) ; } XDpDma_WriteReg ( XPAR_XDPDMA_0_BASEADDR , XDPDMA_IDS , ~ 0 ) ; }
XDpDmaStopChannels - Stop DPDMA channels
 Stop the channel with the following sequence: 1.
XDpDmaStopChannels - Stop DPDMA channels Stop the channel with the following sequence : 1 .
/* Pause the channel */ /* Wait until the outstanding transactions number to go to 0 */ /* Disable channels */ /* Disable all DPDMA interrupts */