cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
abhishekkunal
Contributor
Contributor
410 Views
Registered: ‎02-10-2019

how to use dmaproxy module in petalinux

Hi,

i am trying to figure out how to use dmaproxy module for data transfer in petalinux.

Module is present in /dev directory but dont know how to use it.

Also i wanted to know how reserve physical memory to use it from userspace in petalinux.

As de/mem is not allowing me to access ddr memory.

0 Kudos
4 Replies
jrhtech
Voyager
Voyager
319 Views
Registered: ‎10-04-2017

I haven't looked at the dma-proxy code for a while but you will have to drive the device via ioctls in userspace.

You can reserve memory in the devicetree like this:

reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
mojo_dispcal_reserved: mdcal@40000000 {
no-map;
reg = <0x0 0x40000000 0x0 0x1000000>;
};
};

and then you just mmap that region.   

Are you saying the command devmem is not working or you can mmap /dev/mem ?  Are you running as root?  I've never seen devmem not work but I'm always root.

 

jeff

 

0 Kudos
abhishekkunal
Contributor
Contributor
261 Views
Registered: ‎02-10-2019

HI,

Thanks for suggestion i tried to reserve memory as you suggested and tried mmap @0x40000000 but it failed. "Operation not permitted"

int m=open("dev/mem",o_RDWR);

unsigned int* vir_add = mmap(NULL,65535, PROT_READ | PROT_WRITE , MAP_SHARED, m,0x40000000);

0 Kudos
jrhtech
Voyager
Voyager
240 Views
Registered: ‎10-04-2017

It’s /dev/mem 

are you root ?

and you should just try the devmem or peel/poke tools since they do the same thing

 

jeff

0 Kudos
abhishekkunal
Contributor
Contributor
214 Views
Registered: ‎02-10-2019

HI,

Sorry for the typo, i am using as "/dev/mem" only.

Yes i am running as root and also tried from terminal ( devmem 0xmemadd ) it says mmap not permitted. Same for /dev/mem

I cant find peel/poke in my linux build. Would you let me know the settings i need to do for this.

I have "filter to dev/mem access" disabled in petalinux kernel settings. Still its not allowing me to access physical memory from user space in petalinux.

0 Kudos