XilinxProcessorIPLib/drivers/mcdma/src/xmcdma_bd.c
u32 XMcdma_BdSetBufAddr(XMcdma_Bd *BdPtr, UINTPTR Addr)
{
	u32 HasDRE;
	u8 WordLen;

	HasDRE = XMcdma_BdRead(BdPtr, XMCDMA_BD_HAS_DRE_OFFSET);
	WordLen = HasDRE & XMCDMA_BD_WORDLEN_MASK;

	if (Addr & (WordLen - 1)) {
		if ((HasDRE & XMCDMA_BD_HAS_DRE_MASK) == 0) {
			xil_printf("Error set buf addr %x with %x and %x,"
			" %x\r\n",Addr, HasDRE, (WordLen - 1),
			Addr & (WordLen - 1));

			return XST_INVALID_PARAM;
		}
	}

#if defined(__aarch64__) || defined(__arch64__)
	XMcdma_BdWrite64(BdPtr, XMCDMA_BD_BUFA_OFFSET, Addr);
#else
	XMcdma_BdWrite(BdPtr, XMCDMA_BD_BUFA_OFFSET, Addr);
#endif

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
* Set the Buffer descriptor buffer address field.
*
* @param	BdPtr is the BD to operate on
* @param	Addr is the address to set
*
* @return
*		- XST_SUCCESS if buffer address set successfully
*		- XST_INVALID_PARAM if hardware has no DRE and address is not
*		aligned
*
*****************************************************************************/
Set the Buffer descriptor buffer address field.
Set the Buffer descriptor buffer address field .
u32 XMcdma_BdSetBufAddr(XMcdma_Bd *BdPtr, UINTPTR Addr)
{
	u32 HasDRE;
	u8 WordLen;
	HasDRE = XMcdma_BdRead(BdPtr, XMCDMA_BD_HAS_DRE_OFFSET);
	WordLen = HasDRE & XMCDMA_BD_WORDLEN_MASK;
	if (Addr & (WordLen - 1)) {
		if ((HasDRE & XMCDMA_BD_HAS_DRE_MASK) == 0) {
			xil_printf("Error set buf addr %x with %x and %x,"
			" %x\r\n",Addr, HasDRE, (WordLen - 1),
			Addr & (WordLen - 1));
			return XST_INVALID_PARAM;
		}
	}
#if defined(__aarch64__) || defined(__arch64__)
	XMcdma_BdWrite64(BdPtr, XMCDMA_BD_BUFA_OFFSET, Addr);
#else
	XMcdma_BdWrite(BdPtr, XMCDMA_BD_BUFA_OFFSET, Addr);
#endif
	return XST_SUCCESS;
}
u32 XMcdma_BdSetBufAddr ( XMcdma_Bd * BdPtr , UINTPTR Addr ) { u32 HasDRE ; u8 WordLen ; HasDRE = XMcdma_BdRead ( BdPtr , XMCDMA_BD_HAS_DRE_OFFSET ) ; WordLen = HasDRE & XMCDMA_BD_WORDLEN_MASK ; if ( Addr & ( WordLen - 1 ) ) { if ( ( HasDRE & XMCDMA_BD_HAS_DRE_MASK ) == 0 ) { xil_printf ( " " " \r \n " , Addr , HasDRE , ( WordLen - 1 ) , Addr & ( WordLen - 1 ) ) ; return XST_INVALID_PARAM ; } } #if defined ( __aarch64__ ) || defined ( __arch64__ ) XMcdma_BdWrite64 ( BdPtr , XMCDMA_BD_BUFA_OFFSET , Addr ) ; #else XMcdma_BdWrite ( BdPtr , XMCDMA_BD_BUFA_OFFSET , Addr ) ; #endif return XST_SUCCESS ; }
Set the Buffer descriptor buffer address field.
Set the Buffer descriptor buffer address field .