RPMSG-lite

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

RPMSG-lite

Jump to solution
3,745 Views
xiaokaoy
Contributor I

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?

 

0 Kudos
1 Solution
7 Replies
3,722 Views
xiaokaoy
Contributor I

Thanks very much. That helps a lot. 

"FreeRTOS: middleware/multicore/open-amp/porting/imx7d_m4/platform_info.c (RPMSG_NUM_BUFS, VRING0/1_BASE) and middleware/multicore/open-amp/rpmsg/rpmsg_core.h (RPMSG_BUFFER_SIZE)" on https://developer.toradex.com/knowledge-base/freertos-on-the-cortex-m4-of-a-colibri-imx7#Change_RPms...

is about imx7, though. I can't find RPMSG_NUM_BUFS or RPMSG_BUFFER_SIZE in SDK_2.8.0_MIMX8UX5xxxDZ.

0 Kudos
3,719 Views
igorpadykov
NXP Employee
NXP Employee

one can look at folder ../middleware/multicore/rpmsg_lite/lib/rpmsg_lite,

rpmsg_default_config.h :

//! Number of the buffers, it must be power of two (2, 4, ...).
//! The default value is 2U.
#ifndef RL_BUFFER_COUNT
#define RL_BUFFER_COUNT (2U)

 

Best regards
igor

0 Kudos
3,708 Views
xiaokaoy
Contributor I

Thanks again. 

In SDK_2.8.0_MIMX8UX5xxxDZ\boards\mekmimx8qx\multicore_examples\rpmsg_lite_pingpong_rtos\linux_remote\rpmsg_config.h

#define RL_BUFFER_COUNT (256U)

However, as I said, the Linux kernel source file drivers/rpmsg/imx_rpmsg.c defines

#define RPMSG_NUM_BUFS (512)
The two definitions are not contradictory, are they? I guess that RL_BUFFER_COUNT refers to the number of buffers for each direction (tx or rx) while RPMSG_NUM_BUFS refers to the total number for both tx and rx.
0 Kudos
3,705 Views
igorpadykov
NXP Employee
NXP Employee

>However, as I said, the Linux kernel source file drivers/rpmsg/imx_rpmsg.c defines

 

colibri board was developed by third party toradex, nxp does not support 

its board and software. Please post issue on toradex forum.

 

Best regards
igor

0 Kudos
3,693 Views
xiaokaoy
Contributor I

OK, thanks.

In SDK_2.8.0_MIMX8UX5xxxDZ\boards\mekmimx8qx\multicore_examples\rpmsg_lite_pingpong_rtos\linux_remote\board.h

#define VDEV0_VRING_BASE (0x90000000U)
#define VDEV1_VRING_BASE (0x90010000U)

Does this mean two rpmsg devices? That means the same as 'vdev-nums' ("The number of the remote virtual devices") in the device tree, doesn't? But what exactly does a remote virtual device mean? Does it depend on the number of M4 cores? The imx8dual I'm using has only one M4 core (not considering SCU/SECO). So can I use just one rpmsg device?

0 Kudos
3,689 Views
igorpadykov
NXP Employee
NXP Employee

>..Does it depend on the number of M4 cores? The imx8dual I'm using has only one M4 core..

 

I believe yes.

 

Best regards
igor

 

0 Kudos