XilinxProcessorIPLib/drivers/aienginev2/src/dma/xaie_dma_aieml.c
AieRC _XAieMl_DmaWaitForDone(XAie_DevInst *DevInst, XAie_LocType Loc,
		const XAie_DmaMod *DmaMod, u8 ChNum, XAie_DmaDirection Dir,
		u32 TimeOutUs)
{
	u64 Addr;
	u32 Mask, Value;

	Addr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) +
		DmaMod->ChStatusBase + ChNum * XAIEML_DMA_STATUS_CHNUM_OFFSET +
		Dir * DmaMod->ChStatusOffset;

	Mask = DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.Status.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.TaskQSize.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledLockAcq.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledLockRel.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledStreamStarve.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledTCT.Mask;

	/* This will check the stalled and start queue size bits to be zero */
	Value = XAIEML_DMA_STATUS_IDLE <<
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.Status.Lsb;

	if(XAie_MaskPoll(DevInst, Addr, Mask, Value, TimeOutUs) !=
			XAIE_OK) {
		XAIE_DBG("Wait for done timed out\n");
		return XAIE_ERR;
	}

	return XAIE_OK;
}
/*****************************************************************************/
/**
*
* This API is used to wait on Shim DMA channel to be completed.
*
* @param	DevInst: Device Instance
* @param	Loc: Location of AIE Tile
* @param	DmaMod: Dma module pointer
* @param	ChNum: Channel number of the DMA.
* @param	Dir: Direction of the DMA Channel. (MM2S or S2MM)
* @param        TimeOutUs - Minimum timeout value in micro seconds.
*
* @return	XAIE_OK on success, Error code on failure.
*
* @note		Internal only. For AIEML Tiles only.
*
******************************************************************************/
This API is used to wait on Shim DMA channel to be completed.
This API is used to wait on Shim DMA channel to be completed .
AieRC _XAieMl_DmaWaitForDone(XAie_DevInst *DevInst, XAie_LocType Loc,
		const XAie_DmaMod *DmaMod, u8 ChNum, XAie_DmaDirection Dir,
		u32 TimeOutUs)
{
	u64 Addr;
	u32 Mask, Value;
	Addr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) +
		DmaMod->ChStatusBase + ChNum * XAIEML_DMA_STATUS_CHNUM_OFFSET +
		Dir * DmaMod->ChStatusOffset;
	Mask = DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.Status.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.TaskQSize.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledLockAcq.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledLockRel.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledStreamStarve.Mask |
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.StalledTCT.Mask;
	Value = XAIEML_DMA_STATUS_IDLE <<
		DmaMod->ChProp->DmaChStatus->AieMlDmaChStatus.Status.Lsb;
	if(XAie_MaskPoll(DevInst, Addr, Mask, Value, TimeOutUs) !=
			XAIE_OK) {
		XAIE_DBG("Wait for done timed out\n");
		return XAIE_ERR;
	}
	return XAIE_OK;
}
AieRC _XAieMl_DmaWaitForDone ( XAie_DevInst * DevInst , XAie_LocType Loc , const XAie_DmaMod * DmaMod , u8 ChNum , XAie_DmaDirection Dir , u32 TimeOutUs ) { u64 Addr ; u32 Mask , Value ; Addr = _XAie_GetTileAddr ( DevInst , Loc . Row , Loc . Col ) + DmaMod -> ChStatusBase + ChNum * XAIEML_DMA_STATUS_CHNUM_OFFSET + Dir * DmaMod -> ChStatusOffset ; Mask = DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . Status . Mask | DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . TaskQSize . Mask | DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . StalledLockAcq . Mask | DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . StalledLockRel . Mask | DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . StalledStreamStarve . Mask | DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . StalledTCT . Mask ; Value = XAIEML_DMA_STATUS_IDLE << DmaMod -> ChProp -> DmaChStatus -> AieMlDmaChStatus . Status . Lsb ; if ( XAie_MaskPoll ( DevInst , Addr , Mask , Value , TimeOutUs ) != XAIE_OK ) { XAIE_DBG ( " \n " ) ; return XAIE_ERR ; } return XAIE_OK ; }
This API is used to wait on Shim DMA channel to be completed.
This API is used to wait on Shim DMA channel to be completed .
/* This will check the stalled and start queue size bits to be zero */