Hello.
I'm trying to run the Pingpong example application of rpmsg on my imx8dual.
I read https://github.com/toradex/device-trees/blob/toradex_5.4-2.1.x-imx/dts-arm64/imx8qxp-colibri.dtsi, so I think that I need to add the following into my device tree file
vdevbuffer: vdevbuffer {
compatible = "shared-dma-pool";
reg = <0 0x90400000 0 0x100000>;
no-map;
};
&rpmsg{
/*
* 64K for one rpmsg instance:
*/
vdev-nums = <2>;
reg = <0x0 0x90000000 0x0 0x20000>;
memory-region = <&vdevbuffer>;
status = "okay";
};
I noticed that the SDK_2.8.0_MIMX8UX5xxxDZ\boards\mekmimx8qx\multicore_examples\rpmsg_lite_pingpong_rtos\linux_remote\board.h file has these two macro definitions:
#define VDEV0_VRING_BASE (0x90000000U)
#define VDEV1_VRING_BASE (0x90010000U)
They match the above-mentioned
vdev-nums = <2>;
reg = <0x0 0x90000000 0x0 0x20000>;
I think that the 128K of memory is not used for the rpmsg buffers themselves, but for something like the descriptors of the buffers. Instead, the vdevbuffer above-mentioned in the device tree is used for the buffers themselves. Is that right?
Do I need to specify the address and size of the buffers in the M4 code? If so, how? If not, why?
The Linux kernel source file drivers/rpmsg/imx_rpmsg.c defines
#define RPMSG_NUM_BUFS (512)
#define RPMSG_BUF_SIZE (512)
so the buffer size should be 256KB. Why does the vdevbuffer node in the device tree specify 1MB for the size? Is it because there are 2 rpmsg devices and each has both rx and tx directions?