RPMSG FOR IMX8MP

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

RPMSG FOR IMX8MP

2,863 Views
Majidbahmani
Contributor II
Hope you are well.
 
I am trying to run rpmsg in "real-time edge Linux". According to "REALTIMEEDGEUG.pdf" Page 82. I should apply "imx8mp-evk-rpmsg-8m-buf.dts" in U-Boot. However, this device tree is not exist and I created a device tree based on "imx8mm-evk-rpmsg-8m-buf.dts".
 
Then I did:
  1. Load the CM7 with rpmsg_lite_str_echo_rtos (This code is in MCUPresso SDK) and it started working properly.
  2. Set the device tree imx8mp-evk-rpmsg-8m-buf.dtb  
However, the Linux is not booted properly.
 
I attached:
      The CM7 Code which is related to rpmsg.
      The device tree for imx8mp
      Boot Log.
 
Thank you in advance for your help.
0 Kudos
Reply
6 Replies

2,843 Views
joanxie
NXP TechSupport
NXP TechSupport

pls share your REALTIMEEDGEUG.pdf, let me double check it

0 Kudos
Reply

2,836 Views
Majidbahmani
Contributor II

Thank you for your reply.

https://www.nxp.com/docs/en/user-guide/REALTIMEEDGEUG.pdf

3.8.2 RPMSG data communication (Page 81)

0 Kudos
Reply

2,823 Views
joanxie
NXP TechSupport
NXP TechSupport

what your request is using PRMSG on imx8mp, right? if yes, pls refer to the steps as below

Replace [test].elf with the elf that you wanna to test.

You could check the elf file list: =>fatls mmc ${mmcdev}:1

In U-Boot Stage:

=>fatload mmc ${mmcdev}:1 ${loadaddr} [test].bin

=>cp.b ${loadaddr} 0x7e0000 ${filesize}

=>bootaux 0x7e0000 0

=>run prepare_mcore

=> setenv fdtfile [imx8mn-evk]-rpmsg.dtb

=> boot

In Kernel Stage:

If you already booted Mcore in U-Boot stage, you need first stop the m4 using remoteproc, before you start the new firwmare.

echo stop > /sys/devices/platform/[imx8mp-cm7]/remoteproc/remoteproc0/state; #if you not start Mcore in U-Boot stage, no need execute this in the begining.

echo imx8mp_m7_TCM_rpmsg_lite_str_echo_rtos.elf > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/firmware

echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state

After start, you could execute stop again, and assign a new elf firmware.

You could not assign a new firwmare when state is in start.

The i.MX8MN/P, the elf file list:

imx8mp_m7_TCM_hello_world.elf
imx8mp_m7_TCM_rpmsg_lite_pingpong_rtos_linux_remote.elf
imx8mp_m7_TCM_rpmsg_lite_str_echo_rtos.elf
imx8mp_m7_TCM_sai_low_power_audio.elf

The path for remoteproc on i.MX8MP:

/sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/

 

Remoteprc: hello world demo not have resource table:

-          For i.MX8MP LPDDR4-EVK: #mw 0x550ff000  0 4 to clear garbage resource table area

2,812 Views
Majidbahmani
Contributor II

Thank you for your complete reply.

I learned lots of things from your advice.

You are right. Everything works fine with "imx8mp-evk-rpmsg.dtb" device tree.

Just one note, ".elf" files are in /lib/firmware directory.

I tried a lot of way to create a device tree to support 8M buffer but non of them worked. When I flash CM7 with U-Boot, Linux stopped during booting and when I load the CM7 in Linux I received the following error.

root@imx8mp-lpddr4-evk:~# echo stop > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
-sh: echo: write error: Invalid argument
root@imx8mp-lpddr4-evk:~# echo imx8mp_m7_TCM_rpmsg_lite_str_echo_rtos.elf > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/firmware
root@imx8mp-lpddr4-evk:~# echo start > /sys/devices/platform/imx8mp-cm7/remoteproc/remoteproc0/state
[ 50.778577] remoteproc remoteproc0: powering up imx-rproc
[ 50.781306] remoteproc remoteproc0: Booting fw image imx8mp_m7_TCM_rpmsg_lite_str_echo_rtos.elf, size 164408
[ 50.781911] remoteproc remoteproc0: Registered carveout doesn't fit da request
[ 50.781924] rproc-virtio: probe of rproc-virtio.2.auto failed with error -12
root@imx8mp-lpddr4-evk:~# [ 51.295572] remoteproc remoteproc0: remote processor imx-rproc is now up

Based on imx8mm-evk-rpmsg-8m-buf.dts, What I have modified in imx8mp-evk-rpmsg.dts was 

vdev0vring0: vdev0vring0@55000000 {
reg = <0 0x55000000 0 0x100000>;
no-map;
};
 
vdev0vring1: vdev0vring1@55100000 {
reg = <0 0x55100000 0 0x100000>;
no-map;
};
 
vdevbuffer: vdevbuffer@55200000 {
compatible = "shared-dma-pool";
reg = <0 0x55200000 0 0x800000>;
no-map;
};
 
rsc_table: rsc-table@55a00000 {
reg = <0 0x55a00000 0 0x1000>;
no-map;
};

 

Again Thank you very much for your help.

0 Kudos
Reply

2,728 Views
joanxie
NXP TechSupport
NXP TechSupport

did you want to run on the DDR? pls refer to the patch as below

"https://www.spinics.net/lists/arm-kernel/msg1045628.html"

0 Kudos
Reply

2,638 Views
Majidbahmani
Contributor II

Thank you for your response.

I did not have any problem in running on the DDR. I wanted to know how it is possible to increase rpmsg buffer. I found that It should be enabled in menuconfig. Device Drivers -> Rpmsg drivers.

0 Kudos
Reply