DMA in T4240QDS

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMA in T4240QDS

1,587 Views
appalanaidug
Contributor II

Hello,

1. what should be the DMA controller destination address for read from pci to ddr?

2. how to obtain physical address of ddr to initialize DMA destination register in T4240qds board

Thanks in advance.

0 Kudos
Reply
5 Replies

1,508 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please describe how you allocated the memory region to which the "dest" pointer points and double check whether the application has permission to access this region.

The following are the steps followed,

src=0xc01000000;// address of pci bus from cat /proc/iomem

dest=0x8000000;//address in ddr memory

cPtr = mmap(NULL, MEM_MAP_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0xffe100000);//mapping dma controller
*(unsigned int*)(cPtr+DMA1_SATR1)=0x00040000 |(src >>32);
*(unsigned int*)(cPtr+DMA1_DATR1)=0x00040000;
*(unsigned int*)(cPtr+DMA1_BCR1)=256;
*(unsigned int*)(temp1+DMA1_SAR1)=src&0xFFFFFFFF;
*(unsigned int*)(temp1+DMA1_DAR1)=dest;
*(unsigned int *)(temp1+DMA2_MR1)=0xF<<24|0x4;
*(unsigned int *)(temp1+DMA2_MR1)^=1<<0;
*(unsigned int *)(temp1+DMA2_MR1)|=1;

0 Kudos
Reply

1,499 Views
appalanaidug
Contributor II

hello yipingwang

Thankyou for the response.

In teraterm log the following data was seen:

DMA [mem 0x0000000000000000-0x000000007fffffff]
DMA32 empty
Normal [mem 0x0000000080000000-0x00000005ffffffff]

I assumed that any address within this range can be used as destination address for dma .

Also, from the cat /proc/iomem:

root@t4240qds:~# cat /proc/iomem
00000000-5ffffffff : System RAM

I assumed that this is the physical address of the DDR memory and any location within this range can be used.

Please help on the following points:

1. does cat /proc/iomem displays the physical address of the memory

2. can I perform a DMA transfer from pci to any local variable in user space.

3. how to check if user space has permission to access a location in memory

 

Thankyou in advance.

 

 

0 Kudos
Reply

1,471 Views
yipingwang
NXP TechSupport
NXP TechSupport
  1. does cat /proc/iomem displays the physical address of the memory [NXP] This file contains the mappings of physical addresses to devices' memory.

 

  1. can I perform a DMA transfer from pci to any local variable in user space.

[NXP] The address of a local variable in user space is actually the virtual address in the process address space and each process has its own virtual address space. DMA operation needs bus addresses used between peripheral buses and memory.

 

  1. how to check if user space has permission to access a location in memory [NXP] Please refer to Linux's process and memory management.
0 Kudos
Reply

1,468 Views
appalanaidug
Contributor II

hello yipingwang

Thankyou for the response.

Please help on the following points

1. How to find the bus address of a peripheral ? Is there any command to obtain the same from teraterm

2. Does dts file provide some information about the bus address of the peripheral.

Thanks in advance!

0 Kudos
Reply

1,451 Views
yipingwang
NXP TechSupport
NXP TechSupport
0 Kudos
Reply