Forum Discussion
Altera_Forum
Honored Contributor
17 years agoAltera PCI Express Development Kit: Linux DMA Driver
Hi,
I am a newbie to FPGA design and implementation. While installing the PCI express board on LINUX machine, I don't see Demo application driver for DMA read and write for LINUX (Manual talks about windows installation). I want to generate DMA read and write in Linux box. Does anyone have pointer to a sample application, driver or sof file for the same. Let me know if I am wrong in understanding. Thanks in advance. -Vineet64 Replies
- Altera_Forum
Honored Contributor
I'm stumped. The driver is working better in 32 bit at least, because your transfers complete themselves in time. Something isn't really writing, or else something isn't really reading, because all you are getting are 0's back from the DMA engine. And this still works with the Jungo driver demos in Windows? I wish I could help you more, but the problem is beyond me.
- Altera_Forum
Honored Contributor
Robb, It worked for both 32-bit and 64-bit (I have tested single DMA read and DMA write). I actually was using legacy sof file instead of AvalonST. My bad. Thanks for all the help.
- Altera_Forum
Honored Contributor
Hello,
sorry to not have responded earlier. I have queued up some fixes for the driver that you guys ran into. I will try to commit them in the next week or so. Regards, Leon. -- http://www.sidebranch.com/ - Altera_Forum
Honored Contributor
Hi Leon (and others),
I have been playing with your driver and tinkering with my own modifications. I have a questions - do we really need to have cache coherent memory for "DESCRIPTOR TABLE". I am trying to export descriptor table and bar at userspace. Have you tried mmap'ing a pci_alloc_consistent memory into User space. For me mmap is successful (for Table descriptor) but my writes are not visible to me. I don't see any change in memory after writes ( e.g. after writing 0x0000FADE, it is not visible). I am able to do similar thing with kmalloc allocation. It seems that write is not working correctly. Any help will be appreciated. -VIneet Thanks in advance - Altera_Forum
Honored Contributor
hi all,
i'm trying to write a custom driver based on the altpciechdma example. i saw the following lines of code: /* soft-reset DMA write engine */ iowrite32(0x0000ffffUL, &write_header->w0); /* soft-reset DMA read engine */ iowrite32(0x0000ffffUL, &read_header->w0); my driver works when i perform these actions and it doesn't work if i don't. i'm wondering how you figured this out as i didn't find such a reset command in the documentation of the chaining dma design example. thanks in advance, carlos - Altera_Forum
Honored Contributor
Hi ,
Is there a limitation in size of DMA block for altera reference design ? I am not able to DMA more than 32KB buffer when buffer (to be DMA'ed) is filled with random data. Thanks in advance. Regards, Vineet --- Quote Start --- Hello, sorry to not have responded earlier. I have queued up some fixes for the driver that you guys ran into. I will try to commit them in the next week or so. Regards, Leon. -- http://www.sidebranch.com/ --- Quote End --- - Altera_Forum
Honored Contributor
--- Quote Start --- Hi , Is there a limitation in size of DMA block for altera reference design ? I am not able to DMA more than 32KB buffer when buffer (to be DMA'ed) is filled with random data. Thanks in advance. Regards, Vineet --- Quote End --- I think so, the Compiler User Manual (9.0) says bar 1:0 32kB, 3:2 at least 256 byte andbar 5:4 32kB. See Table 7-4. Or did you used the provided .sof file instead? In this case bar 0 should be 16 MB. - Altera_Forum
Honored Contributor
--- Quote Start --- Alright: I downloaded the application note and tried out all 4 of the .sof files provided for Arria GX... x1 Legacy: no device in lspci x4 Legacy: device shows, driver hangs with EPLAST=44 on the 1st memory transfer. x1 ST: no device in lspci x4 ST: no device in lspci --- Quote End --- The only problem I had running the chainging_dma example created by the core was the following. If I used the Avalon Interface the generated exampled tied the rx_st_ready0 signal to 0 which causes windows to hang on boot. Maybe its the same reason here, but I guess you used a .sof file by altera? - Altera_Forum
Honored Contributor
Hi
Is this driver for Altera Arria GX Development Kit, or it's for enother device? Thank's - Altera_Forum
Honored Contributor
As far as I know it should run on various (Altera) PCIe Boards.
You have to set the correct values for the BARs (either in driver or in your design) and make sure the board is capable of dma transfer as described in the PCIe Compiler handbook.