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.
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;
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.
[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.
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!
Refer to the following for details.