Forum Discussion
Altera_Forum
Honored Contributor
13 years agoI'd steal the PCI code, but write a character driver.
You can then use preadv() and pwritev() in the application, and a 'first cut' driver just does copy_to/from_user() directly from the user buffer to the io_remmap()ed pcie addresses. If you remember to update the file offset, you can use hexdump as a test program (might do lots of 16 byte reads). Getting dma working involves finding the correct dma engine! Given that a 1k transfer probably doesn't take significantly longer than a single word you probably want to spin waiting for 'dma done', not an interrupt terminated dma. You also want a dma that is cheap to setup. For the ppc we use linux doesn't have a driver at all for the pcie dma block - so I could write a very simple one.