cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Lordlothard
Observer
Observer
381 Views
Registered: ‎03-12-2021

How to add Driver library to existing rootfs for VITIS development in OSL flow

Jump to solution

Hi, 

I am working with an UltraScale + MPSoC  on an ultra96V2 avnet dev board. 

I Built a custom Kernel and device-tree using the tutorial "Linux OSL flow " , but i use an existing system file rootfs from the avnet's 2019.2 BSP.

The difference is that i have an AXI DMA IP in the PL for Hardware Acceleration. My device tree is good and I detect the axi_dma when i boot linux : 

[    4.330334] xilinx-vdma a0000000.dma: Xilinx AXI DMA Engine Driver Probed!!
(...)
root@ultra96v2-oob-2019-2:/sys/class/dma# ls -l
total 0
(...)

lrwxrwxrwx 1 root root 0 Jan  1  1970 dma1chan0 -> ../../devices/platform/amba_pl@0/a0000000.dma/dma/dma1chan0

 

Now I'd like to develop my application on VITIS. The Driver pages advice to use the Driver APIs but the xilinx_dma library and dmaengine.h  is missing in my filesystem, and i don't really understand how to use it. Here are my interogations : 

- What is the good way to have the libraries available when developing the app ? 

- Do I need to add the library in the system file rootfs  ?

Also, for some reasons related to the company i work with i can't use petalinux or yocto to build the file system (for now). 

 

I hope it can also help users developping their environment from scratch. 

Have a good day ! 

Gautier

0 Kudos
1 Solution

Accepted Solutions
Lordlothard
Observer
Observer
245 Views
Registered: ‎03-12-2021

Hi Shabbir,

Thank you for your reply !

Actually after some research I found that xilinx_dma library is a Linux Kernel Module and cannot be used "as is " from the kernel user space ! 

So it makes no sense to add it to the Root system File rootfs ... 

What I think I need is a client like the DMA Proxy Design : Linux DMA From User Space - Xilinx Wiki - Confluence (atlassian.net) 

And then following your advice I just need to include it like a library in VITIS , build the binary and paste it in the rootfs or executing it via the TCF agent debugger in VITIS ! 

However  this is the node to add in the Device-Tree :

 

  dma_proxy {
     compatible ="xlnx,dma_proxy";
     dmas = <&axi_dma_0 0
             &axi_dma_0 1>;
     dma-names = "dma_proxy_tx", "dma_proxy_rx";
  }

 

 Where does the small dma client node go in the device tree ?

 

Thank you for your time,

Gautier

View solution in original post

0 Kudos
4 Replies
shabbirk
Moderator
Moderator
288 Views
Registered: ‎12-04-2016

Hi Gautier,

One way is to build the application outside the tool flow and get the binary into the rootfs.

 

Regards

Shabbir

 

0 Kudos
Lordlothard
Observer
Observer
246 Views
Registered: ‎03-12-2021

Hi Shabbir,

Thank you for your reply !

Actually after some research I found that xilinx_dma library is a Linux Kernel Module and cannot be used "as is " from the kernel user space ! 

So it makes no sense to add it to the Root system File rootfs ... 

What I think I need is a client like the DMA Proxy Design : Linux DMA From User Space - Xilinx Wiki - Confluence (atlassian.net) 

And then following your advice I just need to include it like a library in VITIS , build the binary and paste it in the rootfs or executing it via the TCF agent debugger in VITIS ! 

However  this is the node to add in the Device-Tree :

 

  dma_proxy {
     compatible ="xlnx,dma_proxy";
     dmas = <&axi_dma_0 0
             &axi_dma_0 1>;
     dma-names = "dma_proxy_tx", "dma_proxy_rx";
  }

 

 Where does the small dma client node go in the device tree ?

 

Thank you for your time,

Gautier

View solution in original post

0 Kudos
zebill
Visitor
Visitor
234 Views
Registered: ‎02-04-2020

Hi Gautier, As I am trying to use the same piece of code, I can reply to this question!

I put this piece of code in the "system-user.dtsi" file located in the "meta-user/recipes-bsp/device-tree/files" directory, by the way, as this node is new, it has to be inserted in the heading section. The snippet below is extracted from my file:

 

/include/ "system-conf.dtsi"
/ {
	chosen {
		bootargs = "earlycon clk_ignore_unused uio_pdrv_genirq.of_id=generic-uio";
		stdout-path = "serial0:115200n8";
	};

	/* Test to use AXI DMA ...*/
	dma_proxy {
		compatible ="xlnx,dma_proxy";
		dmas = <&axi_dma 0  &axi_dma 1>;
		dma-names = "dma_proxy_tx", "dma_proxy_rx";  
	};
};

Hope this helps!

 

Guilhem

Lordlothard
Observer
Observer
193 Views
Registered: ‎03-12-2021

Thank you Guilhem for your answer !

I added  another dma in my design along with the one in loopback for the axi_dma test module. 

I started my linux with the new Device -Tree and it seems to work :

root@ultra96v2-2020-1:~# cd /sys/class/dma
root@ultra96v2-2020-1:/sys/class/dma# ls -l
(...)
lrwxrwxrwx 1 root root 0 Jan  1  1970 dma1chan0 -> ../../devices/platform/amba_pl@0/a0000000.dma/dma/dma1chan0
lrwxrwxrwx 1 root root 0 Jan  1  1970 dma1chan1 -> ../../devices/platform/amba_pl@0/a0000000.dma/dma/dma1chan1
lrwxrwxrwx 1 root root 0 Jan  1  1970 dma2chan0 -> ../../devices/platform/amba_pl@0/a0010000.dma/dma/dma2chan0
lrwxrwxrwx 1 root root 0 Jan  1  1970 dma2chan1 -> ../../devices/platform/amba_pl@0/a0010000.dma/dma/dma2chan1

root@ultra96v2-2020-1:/sys/devices/platform# ls -l
total 0
(...)
drwxr-xr-x  5 root root    0 Jan  1  1970 amba_pl@0
drwxr-xr-x  3 root root    0 Jan  1  1970 axidmatest@1
drwxr-xr-x  3 root root    0 Jan  1  1970 dma_proxy

 I did not took the time to test it, but it's another subject. 

Yours faithfully,

Gautier. 

0 Kudos