Keyword: PLB TEMAC, SgCheck (), SG, DMA, BD, Error
I am working on a design based on PLB TEMAC managed by interrupts with DMA (NO DRE). The utilized driver is "temac v2_00_a"; in particular, the SGDMA APIs. After TEMAC initialization, the function XTemac_SgCheck fails with returned value XST_DMA_BD_ERROR.
This problem will be fixed in EDK 9.2i SP2. For EDK 9.1i or before, you can safely ignore this error.
The error is related to the following condition in the SgCheck function.
If (XDmaV3_mReadBd(BdPtr, XDMAV3_DMACR_OFFSET) & XDMAV3_DMACR_DIR_RX_MASK)
This condition will read the BD's control register first and AND it with the RX Mask. The RX mask is defined as bit 1 of the register. However, according to the SG DMA data sheet, this bit in the DMACR is reserved and is read as zero. So in the transmit logic, this condition will always return zero and thus not return an error. But in the receive logic, it will be NOT'ed to 1 and thus always return the BD ERROR. In fact, there is no direction bit defined in any of the DMA channel registers.