cancel
Showing results for 
Search instead for 
Did you mean: 
Visitor
Visitor
8,676 Views
Registered: ‎07-05-2016

How to use VDMA on a running linux?

Hello,

 

I'm a newbie so take it easy on me.

I've used the https://github.com/analogdevicesinc/hdl to build a design with hdmi monitor and I added an IP for image processing that I generated with vivado HLS and a VDMA to transfer data between my ip and the ddr.

I've tested the design on sdk with a standalone application and it is working fine. Now I want to run my application on a running linux on my zc702( I'm using an sd card with 2 partitions: Linaro FS and one for booting files).

I've seen that people are using <sys/mman.h> to communicate with the PL blocs like :

void configureVDMA(unsigned long vdma_physical_base)
{
	unsigned long int PhysicalAddress = vdma_physical_base ;
	int map_len = 0x20;
	int fd = open( "/dev/mem", O_RDWR);
	unsigned char* vdma_base_address;
	vdma_base_address = (unsigned char*)mmap(NULL, map_len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, (off_t)PhysicalAddress);
	if(vdma_base_address == MAP_FAILED)
	{
		perror("VDMA Mapping memory for absolute memory access failed.\n");
		return;
	}
	DEBUG_Printf ("VDMA mapping 0x%x to 0x%x, size = %d\n ", (int )PhysicalAddress, (int)vdma_base_address, map_len );

        .....
munmap((void *)vdma_base_address, map_len); close(fd); }

But I got the failed message.

I don't know but should I add drivers to the kernel image "uImage" for PL blocs? and if yes, should I add drivers for both the HLS IP and VDMA?

I need your help plz

Tags (3)
0 Kudos
13 Replies
Highlighted
Mentor
Mentor
8,666 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

Could you make sure whether device tree blob file is correct or not ?

 

Also, could you show me device tree source file ?

 

Thank you.

Best regards

 

Highlighted
Visitor
Visitor
8,662 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

Here it is watari

0 Kudos
Highlighted
Mentor
Mentor
8,657 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

Could you execute the following commands on your linux and show me the result ?

 

% ls /proc/device-tree/amba

% ls -l /proc/device-tree/amba_pl

% ls /boot/

 

Thank you

Best regards,

0 Kudos
Highlighted
Visitor
Visitor
8,652 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

I tried the commands and here are the results:

% ls /proc/device-tree/amba

capture.PNG

% ls -l /proc/device-tree/amba_pl

there was no "amba_pl" in the device-tree directory

% ls /boot/

was empty

0 Kudos
Highlighted
Mentor
Mentor
8,620 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

I confirmed your uploaded information.

According to them, the description of device tree source file and the result of "ls /proc/device-tree/amba" and "ls /proc/device-tree/amba_pl" are different.

It's very strange.

 

Could you explain how to generate device tree blob file to me ?

or

Could you make sure device tree blob file ?

 

I'm probably sure that the route cause is wrong device tree blob file.

 

Thank you.

Best regards,

0 Kudos
Highlighted
Explorer
Explorer
8,539 Views
Registered: ‎11-22-2015

Re: How to use VDMA on a running linux?

You don't have to add drivers to the kernel if you are going to write userspace drivers using mmap.   If you don't have anything in the amba_pl directory it means you device tree is not correct.  Are you sure the system.dts is including your dtsi file?

 

jeff

 

0 Kudos
Highlighted
Visitor
Visitor
8,439 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

Thank you both jeffdaq and watari, you are correct the problem was in the devicetree I've been using the https://github.com/analogdevicesinc/linux.git devicetree (sorry I feel stupid now).

However, now I'm having another problem. I'm using SDK to build my devicetree and when I tested it the hdmi monitor isn't working, I'm able to access the filesystem through uart but the hdmi isnt working.

Could the problem be the audio because when booting, I used to get:

 

ALSA device list:

  #0: HDMI monitor

  ...

However now I'm getting

 

ALSA device list:

  No soundcards found.

  ...

0 Kudos
Highlighted
Mentor
Mentor
8,425 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

Could you show me your block diagram for HDMI ?

Also, how do you generate output clock frequency at HDMI ?

 

Thank you.

Best regards,

 

0 Kudos
Highlighted
Visitor
Visitor
8,385 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

Hello watari,

 

Thank you for responding.

I couldn't attatch my block design so here it is https://drive.google.com/open?id=0BzR7agsHdJabbGxpUGpodVMzVkE.

However, can you please check if I am building the devicetree correctly?

I'm using this repository : https://github.com/Xilinx/device-tree-xlnx

and the default settings :

settings.PNG

 

execpt for bootargs I'm using: console=ttyPS0,115200 root=/dev/mmcblk0p2 rw earlyprintk rootfstype=ext4 rootwait

 

Am I doing something wrong?

 

0 Kudos
Highlighted
Mentor
Mentor
6,497 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

I can't access https://drive.google.com/open?id=0BzR7agsHdJabbGxpUGpodVMzVkE.

Could you show me block diagram ?

Also could you show me device tree source file, what you want to build and result by "ls" command, if you want that I confirm it ?

 

Thank you.

Best regards,

 

0 Kudos
Highlighted
Visitor
Visitor
6,199 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

Hello watari,

 

Here is he design and the files generated by SDK to form the device tree.

0 Kudos
Highlighted
Mentor
Mentor
5,957 Views
Registered: ‎06-16-2013

Re: How to use VDMA on a running linux?

Hi jackolus

 

I mention to you.

 

1) HDMI issue

I guess you connect HDMI monitor via HDMA calue with AUX/Audio.

Hence you find this message.

 

> ALSA device list:

>   #0: HDMI monitor

>   ...

> However now I'm getting

 

2) device-tree issue

I already confirmed your uploaded files.

You define axi_vdma_0 in pl.dtsi file.

However, I can't find this definition in your posted picutre which is generated by "ls /proc/device-tree/amba" and "ls /proc/device-tree/amba_pl" to make sure recognition of device tree.

Hence I suspect you have mistake to generate device tree blob file.

 

Could you execute the following command to make sure the definition of device tree ?

 

% dtc -I dtb -O dts -o <output dts file name> <input dtb file name>

 

After that, you get "<output dts file name>" file as device tree source file and you can confirm it.

Could you confirm it, too ?

 

 

 

Thank you.

Best regards,

 

0 Kudos
Highlighted
Visitor
Visitor
5,910 Views
Registered: ‎07-05-2016

Re: How to use VDMA on a running linux?

Hello watari,

 

Thank you for responding.

The pictures I've posted where when I was using the analogdevicesinc from github. Now I'm generating my own devicetree using SDK and here are the results:

 

Capture.PNG

0 Kudos