问题
I am working with the Zynq 7 of Xilinx. On the Zynq there is a FPGA, an ARM processor and 512 MiB of DDR RAM. When the board is powered on, the ARM processor starts Ubuntu, which initializes the DDR RAM and claims it as its own. On the FPGA, I am developping another processor and I want to give it a piece of DDR memory. Since I am still developing, I would like to somehow allocate a piece of 64 MiB of continous DDR RAM from linux userspace (the device has a MMU). I would then get the start address of this piece of RAM, pass it on to the FPGA processor and it would work with it. While it works on it, I could check if everything is fine from the same program, in Ubuntu.
The question is about the Linux side of this, what would be a good way?
Here is what I gathered myself: I read a bit about cma, and I noticed that the Ubuntu instance already allocates 128 MiB of cma RAM on boot. So, I think the best way would be to find or develop a driver that takes some of that RAM and "locks" it so that the OS will not give it out to other programs. Then I would still need a way to access it from userspace. Is this the right track of thinking?
来源:https://stackoverflow.com/questions/46645953/use-linux-to-share-continous-ram-between-processors