Forum Discussion
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...
Altera_Forum
Honored Contributor
16 years agoHi,
--- Quote Start --- 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. ... 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. --- Quote End --- Maybe, the next site will be helpful for you. http://www.scs.ch/~frey/linux/memorymap.html (http://www.scs.ch/%7efrey/linux/memorymap.html) The macro 'virt_to_phys' can be used only for 'kernel virtual address', not for user space virtual address. Kazu