Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
437 Views

Alternate driver for Avalon-MM DMA for PCIe

Hi All,

 

If anyone is interested in a Linux device driver for Avalon-MM DMA for PCIe? The existing reference design code is quite difficult to maintain, while the alternate solution basically boils down to these APIs:

 

typedef void (*avalon_dma_xfer_callback)(void *dma_async_param);   int avalon_dma_submit_xfer( struct avalon_dma *avalon_dma, enum dma_data_direction direction, dma_addr_t dev_addr, dma_addr_t host_addr, unsigned int size, avalon_dma_xfer_callback callback, void *callback_param);   int avalon_dma_submit_xfer_sg(struct avalon_dma *avalon_dma, enum dma_data_direction direction, dma_addr_t dev_addr, struct sg_table *sg_table, avalon_dma_xfer_callback callback, void *callback_param);   int avalon_dma_issue_pending(struct avalon_dma *avalon_dma);

 

 

The callbacks are called from the tasklet context - much like standard Linux dmaengine framework does.

 

If the idea gathers enough interest I can think of posting it upstream or coming up with implementation that conforms to the Kernel dmaengine model.

 

Please, let me know if the use of suggested API is not clear and needs clarification.

 

Thanks!

0 Kudos
5 Replies
Highlighted
Moderator
31 Views

@AlexGo​ Thank you very much for the sharing.

0 Kudos
Highlighted
New Contributor I
31 Views

Hello @AlexGo,

 

Where can I found that you mentioned " The existing reference design Linux device driver code for Avalon-MM DMA for PCIe ", is it ok for A10 SoC design ?

 

Also <where can we find your updated "Alternate driver for PCie" ? Thanks

0 Kudos
Highlighted
Beginner
31 Views

Hello!

 

I remember downloading the reference design from wiki, but the link does not appear available anymore. This one looks the same:

https://www.intel.com/content/www/us/en/programmable/support/support-resources/software/download/ref...

 

You could find the recent version of "avalon-dma" and "avalon-drv" drivers here:

git@github.com:a-gordeev/linux.git avalon-dma-engine

git@github.com:a-gordeev/avalon-drv-tool.git master

 

Here is some explanation:

avalon-dma - DMA engine driver that provides generic interface to the Avalon DMA engine;

avalon-drv - sample driver on top of a custom A10 design (see Alaric board link below) that uses avalon-dma engine;

avalon-drv-tool - user-level sample utility that uses avalon-drv interface to execute DMAs;

 

I used Arria® 10 SoC FMC IDK for development:

https://www.reflexces.com/intel-fpga/arria-10-intel-fpga/alaric-instant-devkit-arria-10-soc-fmc-idk

 

It would be interesting if you give it a go.

 

Thanks!

0 Kudos
Highlighted
New Contributor I
31 Views

Thanks Alex.Go for your head up,

I saw your github commit are :

https://github.com/a-gordeev/linux/commits/avalon-dma-engine

  1. Commits on Sep 11, 2019 staging: avalon-drv: Avalon DMA driver

a-gordeev committed on Jul 17

Signed-off-by: Alexander Gordeev <a.gordeev.box@gmail.com>

IS THIS YOUR CODE CHANGES FOR "Avalon-MM DMA for PCIe DRiver" ? Please confirm, and what's the linux kernel version, as well ? thanjks

0 Kudos
Highlighted
Beginner
31 Views

I am not quite sure what is your question, but here is some explanation (I updated my previous message as well):

 

avalon-dma - DMA engine driver that provides generic interface to the Avalon DMA engine;

avalon-drv - sample driver that uses avalon-dma engine interface;

avalon-drv-tool - sample user-level utility that uses avalon-drv interface to execute DMAs;

 

The Linux version used is upstream v5.3-rc8.

It is not big deal to backport it to any earlier version.

 

HTH

 

Thanks!

0 Kudos