UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
5,831 Views
Registered: ‎02-12-2015

Linux AXI DMA UIO

Hello,

 

I've read lots on this subject but am not confident enough to be able to start my design. I'm far from a Linux expert.

 

I have a PL design with a dma module transferring data to the PS. One way transfer, no scatter gather. In bare metal, this works well. I wrote my bare metal code using the S2MM registers etc, basically bit bashing, no dma wrappers. I was hoping to do similar in petaLinux.

 

I've spent a bit of time working with UIO components, and have a design that can write to AXI registers of peripherals using mmap, and respond to interrupts using read() and write() and this seemed the ideal way to get the PL data. I thought I'd just be able to make a new UIO component, mmap the dma registers and then using the control and status registers like I did in bare metal.

 

I'm a bit confused about how to create this new UIO component though. Before, I added the my uio component to system-top.dts, but now I have a dma component described in pl.dtsi:

 

amba_pl: amba_pl {
#address-cells = <1>;
#size-cells = <1>;
compatible = "simple-bus";
ranges ;
axi_dma_0: dma@40400000 {
#dma-cells = <1>;
compatible = "xlnx,axi-dma-1.00.a";
interrupt-parent = <&intc>;
interrupts = <0 29 4>;
reg = <0x40400000 0x10000>;
dma-channel@40400030 {
compatible = "xlnx,axi-dma-s2mm-channel";
dma-channels = <0x1>;
interrupts = <0 29 4>;
xlnx,datawidth = <0x20>;
xlnx,device-id = <0x0>;
};
};
};

 

Should I create a new UIO component in system-top.dts , or can I add uio_pdrv.of_id=generic-uio to the dma component definition in pl.dtsi ?

 

Or am I being a bit silly and should I use kernel drivers ?

 

A bit of background... I'm wanting to transfer a "line" of camera data (2048 bytes) from the PL at a rate of up to 70KHz (143MB/s) and write them to an SSD. For now I'd like to create 2 buffers of 2048 bytes in Linux, and just keep updating these 2 buffers to verify things are working ok.

 

Any advice would be gratefully received!

 

Thanks,

 

Marc 

 

 

0 Kudos
2 Replies
Adventurer
Adventurer
5,508 Views
Registered: ‎10-21-2013

Re: Linux AXI DMA UIO

You've described AXI-DMA device, not UIO.

 

UIO device description is like this:

 

my_uio_0: my_uio@43C10000 {
compatible = "generic-uio","uio";
reg = <0x43C10000 0x1000>;
interrupt-parent = <&intc>;
interrupts = <0 29 4>;
};

 

After Linux boot you will see /sys/class/uio/uio<N> catalog and /dev/uio<N> node (<N> is device number).

 

Also you should add the string to bootargs:

uio_pdrv_genirq.of_id=generic-uio

 

0 Kudos
Scholar vanmierlo
Scholar
5,318 Views
Registered: ‎06-10-2008

Re: Linux AXI DMA UIO

To disable the automatically generated dma entry in the device tree add this to system-top.dts:

 

@axi_dma_0 {
    status = "disabled";
};

 

0 Kudos