IMX8MP Remote core share memory driver

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

IMX8MP Remote core share memory driver

869 Views
Stan88
Contributor I

Good day.
I’m trying to implement inter-core data exchange using a DDR buffer for a large amount of data. I am using a Verdin devkit on IMX8MP. Kernel version 5.15. I have already implemented communication via RPMSG using “/dev/rpmsg_ctrl0”.

Now I want to allocate memory in DDR from CMA space and send the address to the CortexM via the RPMSG message. To do this, I deal with an NXP example for “Low Power Audio Application - AN12195SW”. I took the “rmtcore_shm” driver code from the patches and compiled it in the kernel environment via devshell.

Then I installed the module on the system “rmtcore-shm.ko”

root@verdin-imx8mp-14762892:~# insmod ./rmtcore-shm.ko
[ 235.945223] RMTCORE module started!
root@verdin-imx8mp-14762892:~#

But the new device “/dev/rmtcore_shm” did not appear in the system. And when I try to open it I get an error:

rmtcore_shm_fd = open(RMTCORE_SHM_DEV, O_RDWR);
*******************
"Unable to open device /dev/rmtcore_shm"
*******************

I may need to make changes to the device files. Right now my overlay for RPMSG looks like this:

/dts-v1/;
/plugin/;

#include <dt-bindings/clock/imx8mp-clock.h>

/ {
	compatible = "toradex,verdin-imx8mp";

	rmtcore_shm {
		compatible = "fsl,rmtcore-shm";
		status = "ok";
	};
};

&{/} {
	imx8mp-cm7 {
		compatible = "fsl,imx8mp-cm7";
		clocks = <&clk IMX8MP_CLK_M7_DIV>;
		mbox-names = "tx", "rx", "rxdb";
		mboxes = <&mu 0 1
			  &mu 1 1
			  &mu 3 1>;
		memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>, <&m7_reserved>;
		rsc-da = <0x55000000>;
		syscon = <&src>;
		fsl,startup-delay-ms = <500>;
	};
};

&i2c3 {
	status = "disabled";
};

&pwm4 {
	status = "disabled";
};

&resmem {
	#address-cells = <2>;
	#size-cells = <2>;

	m7_reserved: m7@0x80000000 {
		no-map;
		reg = <0 0x80000000 0 0x1000000>;
	};

	vdev0vring0: vdev0vring0@55000000 {
		no-map;
		reg = <0 0x55000000 0 0x8000>;
	};

	vdev0vring1: vdev0vring1@55008000 {
		no-map;
		reg = <0 0x55008000 0 0x8000>;
	};

	vdevbuffer: vdevbuffer@55400000 {
		compatible = "shared-dma-pool";
		no-map;
		reg = <0 0x55400000 0 0x100000>;
	};

	rsc_table: rsc_table@550ff000 {
		no-map;
		reg = <0 0x550ff000 0 0x1000>;
	};
};

&sai3 {
	status = "disabled";
};

&sdma3 {
	status = "disabled";
};

&mu {
	status = "okay";
};

&uart4 {
	status = "disabled";
};

Can you please tell me what changes need to be made so that /dev/rmtcore_shm appears in the system and I can get access to memory allocation in DDR? If someone has already come across this solution and an example.

Thanks in advance for any help.

0 Kudos
Reply
2 Replies

811 Views
Bio_TICFSL
NXP TechSupport
NXP TechSupport

Hello,

If you build the module, you have to compile the kernel itself to make it works and see in dmseg output.

Regards

0 Kudos
Reply

803 Views
Stan88
Contributor I

Yes, I've tried it also - I compiled it inside kernel, I saw it in the kernel menuconfig - "Remote Core Share Memory Driver", and activated it. Compiled and deployed the kernel, built the image and installed it on the board.

lsmod won't show me this driver because it was not loaded dynamically but is a buildin module.

dmseg also does not contain any information about this driver. An attempt to unload a module gives an error indicating that such a module exists in the system:

root@verdin-imx8mp-14762892:~# modprobe -r rmtcore-shm
modprobe: FATAL: Module rmtcore_shm is builtin.
0 Kudos
Reply