IMX8M+ imx_rpmsg_tty and remoteproc linux m7 load at same time

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

IMX8M+ imx_rpmsg_tty and remoteproc linux m7 load at same time

1,189 次查看
mobrembski
Contributor II

Hi!

We have a custom board based on iMX8M+ running latest yocto scarthgap 6.6.52. This board also have a firmware running on M7 core, which is a modified version of examples and imx_rpmsg_tty module on linux side.

The problem which we're currently facing is that everything works great when we boot M7 from u-boot before linux (M7 is a our custom module based on imx_rpmsg_tty):

[    0.041082] imx rpmsg driver is registered.
[    2.096825] imx-rpmsg 55000000.rpmsg: assigned reserved memory node vdevbuffer@55400000
[    2.105347] virtio_rpmsg_bus virtio0: rpmsg host is online
[    4.230530] M7 : M7 character device initialized.
[    4.236998] M7 : M7 Binary character device initialized.
[    4.243012] M7 : register_rpmsg_driver init result = 0
[    8.107437] virtio_rpmsg_bus virtio0: creating channel rpmsg-wasp addr 0x1e
[    8.115886] M7 : New channel: 0x400 -> 0x1e!

 But due to some design changes, we need to be able to stop and start M7 from linux.

And here comes the problem. If we disable starting M7 at u-boot, and try to load FW from linux:

root@imx8mplts:/sys/class/remoteproc/remoteproc0# echo start > state
[   71.267332] remoteproc remoteproc0: powering up imx-rproc
[   71.286009] remoteproc remoteproc0: Booting fw image m7.elf, size 962828
[   71.806026] remoteproc remoteproc0: remote processor imx-rproc is now up

 M7 boots just great, we can see it running and see messages on M7 UART, but there is no RPMSG channel created, and we dont have a connection between M7 and our linux M7 module.
Even if i rmmod and modprobe rpmsg_ctrl, rpmsg_char and our module, there is nothing on dmesg other than:

[  907.839256] M7 : M7 character device initialized.
[  907.848731] M7 : M7 Binary character device initialized.
[  907.854692] M7 : register_rpmsg_driver init result = 0

And nothing from rpmsg. And channel isnt created.

May i ask for help how to run M7 from linux WITH rpmsg tty?

 

Here's a rpmsg config from our device tree which we're using and it works if M7 is started from u-boot:

rpmsg: rpmsg{
		compatible = "fsl,imx8mq-rpmsg";
		/* up to now, the following channels are used in imx rpmsg
		 * - tx1/rx1: messages channel.
		 * - general interrupt1: remote proc finish re-init rpmsg stack
		 *   when A core is partition reset.
		 */
		mbox-names = "tx", "rx", "rxdb";
		mboxes = <&mu 0 1
			  &mu 1 1
			  &mu 3 1>;
		/*
		 * 64K for one rpmsg instance:
		 * --0x55000000~0xb800ffff: pingpong
		 */
		vdev-nums = <1>;
		reg = <0x0 0x55000000 0x0 0x10000>;
		memory-region = <&vdevbuffer>;
		status = "okay";
	};

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

 

0 项奖励
回复
3 回复数

1,113 次查看
mobrembski
Contributor II

I've also saw this old thread:
https://community.nxp.com/t5/i-MX-Processors/Reset-virtio-rpmsg-bus/td-p/842863

But in current release it's not possible to build virtio-rpmsg or imx_rpmsg as a loadable module, so it's not really helpful

0 项奖励
回复

1,153 次查看
JosephAtNXP
NXP TechSupport
NXP TechSupport

Hi,

Thank you for your interest in NXP Semiconductor products,

I will attach an application note about loading firmware to Cortex-M, U-boot code load and Linux reload are ok, so just confirm that you have your DTS aligned to the one in the doc.

So, the chapter 9.1.1.3 Booting firmware early using U-Boot and controlling firmware using SysFS interface would comprise your application, please double check.

Regards

0 项奖励
回复

1,150 次查看
mobrembski
Contributor II

Thank you for your reply. 
I've already read this document, but it doesnt solve my issue.

Indeed, controlling M7 core from linux works pretty well. The problem is that when i stop and start again M7 core, M7 firmware runs OK but neither M7 nor Linux detect the link with RPMSG, so there is no communication between those.

0 项奖励
回复