XilinxProcessorIPLib/drivers/axidma/src/xaxidma_bd.c
u32 XAxiDma_BdSetBufAddr(XAxiDma_Bd* BdPtr, UINTPTR Addr)
{
	u32 HasDRE;
	u8 WordLen;

	HasDRE = XAxiDma_BdRead(BdPtr, XAXIDMA_BD_HAS_DRE_OFFSET);
	WordLen = HasDRE & XAXIDMA_BD_WORDLEN_MASK;

	if (Addr & (WordLen - 1)) {
		if ((HasDRE & XAXIDMA_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__)
	XAxiDma_BdWrite64(BdPtr, XAXIDMA_BD_BUFA_OFFSET, Addr);
#else
	XAxiDma_BdWrite(BdPtr, XAXIDMA_BD_BUFA_OFFSET, Addr);
#endif

	return XST_SUCCESS;
}
/*****************************************************************************/
/**
 * Set the BD's buffer address.
 *
 * @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
 *
 * @note	This function can be used only when DMA is in SG mode
 *
 *****************************************************************************/
Set the BD's buffer address.
@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

@note        This function can be used only when DMA is in SG mode
Set the BD ' s buffer address . @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 @note This function can be used only when DMA is in SG mode
u32 XAxiDma_BdSetBufAddr(XAxiDma_Bd* BdPtr, UINTPTR Addr)
{
	u32 HasDRE;
	u8 WordLen;
	HasDRE = XAxiDma_BdRead(BdPtr, XAXIDMA_BD_HAS_DRE_OFFSET);
	WordLen = HasDRE & XAXIDMA_BD_WORDLEN_MASK;
	if (Addr & (WordLen - 1)) {
		if ((HasDRE & XAXIDMA_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__)
	XAxiDma_BdWrite64(BdPtr, XAXIDMA_BD_BUFA_OFFSET, Addr);
#else
	XAxiDma_BdWrite(BdPtr, XAXIDMA_BD_BUFA_OFFSET, Addr);
#endif
	return XST_SUCCESS;
}
u32 XAxiDma_BdSetBufAddr ( XAxiDma_Bd * BdPtr , UINTPTR Addr ) { u32 HasDRE ; u8 WordLen ; HasDRE = XAxiDma_BdRead ( BdPtr , XAXIDMA_BD_HAS_DRE_OFFSET ) ; WordLen = HasDRE & XAXIDMA_BD_WORDLEN_MASK ; if ( Addr & ( WordLen - 1 ) ) { if ( ( HasDRE & XAXIDMA_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__ ) XAxiDma_BdWrite64 ( BdPtr , XAXIDMA_BD_BUFA_OFFSET , Addr ) ; #else XAxiDma_BdWrite ( BdPtr , XAXIDMA_BD_BUFA_OFFSET , Addr ) ; #endif return XST_SUCCESS ; }
Set the BD's buffer address.
Set the BD ' s buffer address .