I have a typical V4L2 driver that I use configured for memory mapped IO method. This driver hands off a virtual address to my user space app. All of this is working fine.
I have another driver that expects as input a kernel physical address. I want to connect the output of the V4L2 driver to the input of this driver but it needs a physical address (this driver controls FPGA functionality).
My understanding is that the kernel routine: virt_to_phys() routine will NOT work with DMA allocated memory mapped addresses. Is this true? If so, how do I get the physical address from the DMA memory mapped V4L2 virtual address that was passed into user space?
I am just hacking up a proof of concept thing here so hard coding some addresses is not an issue. This is the sole application running on a dedicated embedded platform.
Thanks, -Andres
lspci
would show you). Technically, you can also chase down the page table entries assigned to the user process' mapping and read back the address stored there but that would be the more difficult way to get it. – Gil Hamilton