AnsweredAssumed Answered

RPMSG, Increasing number of buffer (RPMSG_NUM_BUFS)

Question asked by niranjanbc on Jun 14, 2017
Latest reply on Jun 26, 2018 by D. RY

below are the changes i have made in imx_rpmsg.c file

 

#define RPMSG_NUM_BUFS (1024)
+#define RPMSG_BUF_SIZE (512)
+#define RPMSG_BUFS_SPACE (RPMSG_NUM_BUFS * RPMSG_BUF_SIZE)
+
+/*
+ * The alignment between the consumer and producer parts of the vring.
+ * Note: this is part of the "wire" protocol. If you change this, you need
+ * to update your BIOS image as well
+ */
+#define RPMSG_VRING_ALIGN (4096)
+.

.

.

.

.

struct imx_rpmsg_vproc *rpdev = &imx_rpmsg_vprocs[i];
+
+ if (!strcmp(rpdev->rproc_name, "m4")) {
+ ret = of_device_is_compatible(np, "fsl,imx7d-rpmsg");
+ ret |= of_device_is_compatible(np, "fsl,imx6sx-rpmsg");
+ if (ret) {
+ /* hardcodes here now. */
+ rpdev->vring[0] = 0xBF800000;//0xBFFF0000;
+ rpdev->vring[1] = 0xBF880000;//0xBFFF8000;
+ }
+ } else {
+ break;
+ }

 

i want to increase the number of buffers, what other changes i have to make that work.

if change the buffer number back to 512, i see rpmsg driver works fine.with above memory allocation.

i have allocated now last 8MB of shared DDR  memory for RPMSG.

do i need to change "RPMSG_VRING_ALIGN", what is the value and how to calculate it.

if i change RPMSG_VRING_ALIGN, what other files are affected, what other changes i have to make.

Outcomes