-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing devicetree entry #1
Comments
Hi, Apologies, I need to update the README documentation on the main page. In order to use the driver, you need to have at least two device tree entries. The first device tree entry is for the driver itself. This identifies which DMA channels the driver owns and is allowed to use. The other device tree entries are for the AXI DMA channels themselves, which describe the properties of the channel. I'm going to update the README soon to describe these entries. For now, below is the example device tree nodes you'll need. This corresponds to a single AXI DMA IP on the fabric, with a receive and transmit channel.
|
Excellent, works perfectly. Thank you! Some small comments though. For the mentioned kernel branch from xilinx, xilinx-v2015.4, I had to modify your version_portability.h file to include the xilinx_dma.h file from the path linux/amba, instead of linux/dma. Even though it is a 4.0 kernel version, the path in this branch is the old one. With the next branch xilinx-v2016.1 the path linux/dma is correct and the kernel version is 4.4. I use the xilinx SDK for the generation of the devicetree for my project and the SDK generates for both channels the same entry for xlnx,device-id, so I had to manually change this, so they differ.
I have no other comments, tried it now with a loopback, mm2s connected to s2mm and the benchmark and transfer examples worked like a charm. Thank you! |
Interesting, it's a shame Xilinx wasn't consistent with their 3.x to 4.x version upgrade. Unfortunately, I guess there's no good way to deal with this in general. I'll probably stick with the current version, because the master branch has the newer path. The only requirement for the "xlnx,device-id" property is that it is unique among all of the DMA channels; it is how the driver differentiates between them. I couldn't ever get device tree generation to work. Is there a guide that you followed that you could point me to? I last tried it with 2015.2. Glad it worked out for you. Let me know if you have any other questions. |
Hi, sorry for the late reply. Well basically I follow this guide from Xilinx: http://www.wiki.xilinx.com/Build+Device+Tree+Blob Sadly there are sometimes some errors in the SDK log but the files are mostly generated ok. For example in the latest SDK 2016.1 using the 2016.1 branches I get errors, when generating my project containing a PCIe IP core, but the device-tree entry gets generated ok. Using the previous branch 2015.4 I get no errors, but the entry for the PCIe core is not functional. So to sum up, the automated generation does not work. You always need to manually adjust the entries. At least that is the case for the mini-itx board, I am working on. |
Hello, |
Hi, I am working with two DMA cores, both only for transmitting data from memory mapped interface to stream interface.
The corresponding working entry for the axidma driver is:
Here the relevant part is the line "dmas = <&axi_dma_0 0 &axi_dma_1 0>;". If I would have in my two DMA IP cores also the receiving channel, then the axidma devicetree entry could look like this:
Hope this helps you to get it working. Let me know, if you have any other questions. |
@AndrejHsk is right in his description. 0 is used for a transmit (CPU -> FPGA) channel, and 1 is used for a receive channel (FPGA -> CPU). I unfortunately still haven't gotten around to updating the docs; I'll do that soon. If you're hanging, then the typical cause of this is that you've incorrectly specified an interrupt in the device tree. The interrupt is specified in the AXI DMA core device tree entry, with the interrupts property. Don't worry about the first and third number, those will always be the same. The relevant number is the middle number, which specified the interrupt ID for that core. There's a little bit more to the interrupt ID's, but basically the FPGA's interrupts start at 30 and continue upward. The interrupts aren't completely sequential, there's a skip after a certain number that I can't remember off the top of my head. When you hook up the interrupt lines in your block design the LSB maps to the lowest interrupt number. So, in @AndrejHsk's device tree his first DMA channel is interrupt 30, and the second is 31. See the documentation (under Documentation/devicetree/bindings/interrupt-controller/interrupts.txt) in the kernel source tree for interrupts in device trees for more information. Could you post your device tree? That would help me see what the exact issue is. |
@AndrejHsk I try two DMA IP cores also the receiving channel , the axidma devicetree entry like this
My devicetree entry for these DMA cores is the following:
but , when I insmod axidma.ko I find an error
|
Right, so the device-id property for each channel must be unique. So, under |
@AndrejHsk , Now I get it working 。 I made a mistake 。I revised the following parameters
Thank you for your help very much! Another question , |
The driver doesn't currently have multi-channel support unfortunately. I'm not sure how difficult that would be to add, but I don't think it should be too difficult. Also note that multi-channel support is only present in Xilinx version 4.x kernels. |
I've updated the README to have all the instructions for running the driver. Take a look over it if you can, see if it makes sense and looks OK. |
Hello,
I'm working on an Xilinx Zynq device and would like to use your driver for the AXI DMA, in order to be able to interface from a linux application to the logic in the FPGA. I'm currently running the kernel version 4.0 maintained by xilinx under the branch xilinx-v2015.4. The compile process of your driver worked flawlessly. But when trying to insert the module into the running kernel, nothing happens. After some debugging I realised, that the driver is looking for a devicetree entry with the compatible string xlnx,axidma-chrdev. However I cannot find the devicetree entry. Am I missing something? Please help.
Thank you in advance, I'm looking forward to your answer.
The text was updated successfully, but these errors were encountered: