DMA in T4240QDS

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

DMA in T4240QDS

2,333件の閲覧回数
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 件の賞賛
返信
5 返答(返信)

2,254件の閲覧回数
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 件の賞賛
返信

2,245件の閲覧回数
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 件の賞賛
返信

2,217件の閲覧回数
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 件の賞賛
返信

2,214件の閲覧回数
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 件の賞賛
返信

2,197件の閲覧回数
yipingwang
NXP TechSupport
NXP TechSupport
0 件の賞賛
返信