04-28-2011 02:03 AM
Hi all, I'm using 13.1 targeting a Virtex 6.
Just wanted to share a problem I found when I created an EDK AXI microblaze project with AXI Ethernet and multiple DMA controllers.
As you all know, when you create the project with system builder and add AXI Ethernet, it also adds and connects a dma controller named "dma_ETHERNET". I also needed extra dma channels so I added two more axi_dma IP cores, which by default get named "axi_dma_0" and "axi_dma_1".
So far so good. You export the design to SDK, and when you create a BSP (in my case a xilkernel based with lwip130 and xilmfs) you will see in "xparamters.h" that your DMA devices have their device IDs assigned according to alphabetical order. Thus, unless you re-name your DMA IP cores in EDK, given the default names, "axi_dma_0" will get assigned device ID 0.
This should not be a problem, BUT: when you include lwip130 (I'm using version 3.00.a), you will run into a problem which got me busy for a while to find out. Your ethernet will not work because the lwip library will be trying to use the wrong DMA controller.
If you look into "lwip130_v3_00_a/src/contrib/ports/xilinx/netif/xaxiemacif_dma.c", in function "init_axi_dma" at line 631 you will see: DMAConfig = XAxiDma_LookupConfig(XPAR_AXIDMA_0_DEVICE_ID);
So it always tries to use whatever DMA core is assigned to device ID 0.
Solution: if you need to use ethernet and additional DMA engines, make sure you re-name your ethernet DMA core so that it is first in alphabetical order (this is how I got it to work).
Suggestion to Xilinx: I think a better solution would be if the information of which DMA device is associated with your ethernet core was exported to SDK so that some other define in xparameters would hold that information in a more generic way, and lwip would use that define instead of hardcodedly use XPAR_AXIDMA_0_DEVICE_ID.
06-06-2012 07:27 AM
I have the same issue with Kintex7 on the KC705 board with 13.4 and lwip140.
It took me over a day to find what is the problem, you saved me the other half of the work - finding a solution.
for Xilinx a faster solution would be to just export the dma selection to the top level were you can choose which dma to use instead of the hard coded option.
And offcorse to add a note on the function call: "please make sure you use the correct dma channel".
another solution would be to use the defalut name of the ethernet dma channel ie XPAR_ETHERNET_DMA_DEVICE_ID instead of general XPAR_AXIDMA_0_DEVICE_ID.
12-27-2012 02:44 AM
02-06-2015 04:53 PM
this problem remains in Vivado 2014.4. The DMA's DEVICE_ID is fixed to 0 in the lwip code.
xaxiemacif_dma.c: DMAConfig = XAxiDma_LookupConfig(XPAR_AXIDMA_0_DEVICE_ID);
As soon as a second dma device is used it may get DEVICE_ID=0 leading to software malfunction as soon as network is initialized.
Is the DEVICE_ID assigned through alphabetical ordering? At least it worked for me to assign the other dma component a name behind axi_ethernet in alphabetical order.
10-25-2017 09:27 PM
a change request has been filed against LWIP. The CR ID is CR-988210