Altera_Forum
Honored Contributor
16 years agoHow to get Physical Address in uClinux with MMU
Hi~
I am using uClinux with mmu right now. and I want to write a driver for SGDMA(Stream to Memory). I need physical address to set up SGDMA. Is there anyone know about it? Right Now, my design is I use mmap to alloc a space which kernel and user can share this memory. My plan is pass this memory address to sgdma, than sgdma can direct write to it. My program in user mode can direct get from there. Is my idea possible? However I need this physical address, and I try to use virt_to_phys to get physical address, but it return a wrong address. Cound anyone tell me how to get the address? Or, is there anyone have this kind of design before. Could you share with me how you design. My virtual address is 0x2adfb0000, and I use (virt_to_phys) to transfer to physical address, 0x6adfb0000. I don't think this is real physical address. Thanks for your help