Hi, I'm trying to use the RPMsg functionality on the IMX8MP between the Cortex-A53 & M7. More specifically, right now I'm trying to use it with the example `imx_rpmsg_tty` driver to have a simple character device interface between them. I've read through some documents I found and used the example device tree `arch/arm64/boot/dts/freescale/imx8mp-evk-rpmsg.dts` as my base. But I've had a hard time finding documentation for the RPMsg node itself and I wanted to ask a list of questions. Also please forgive me because I'm still kind of new to BSP development.
First, here is the device tree I've created (it's a modified/trimmed version of the example DTS with rpmsg node added):
#include <dt-bindings/clock/imx8mp-clock.h>
#include <dt-bindings/gpio/gpio.h>
/*
* ATTENTION: M7 may use IPs/peripherals including:
* ECSPI0/ECSPI2, FLEXCAN, GPIO1/GPIO5, GPT1, I2C3, I2S3, UARTs,
* PWM4, SDMA1/SDMA2, and more. Any peripheral used by the cortex M7
* must be disabled in the device tree and must be added to domain 1
* in the U-Boot device tree.
*/
/ {
// This is for RPMsg. Specifically, at least for the imx_rpmsg_tty driver
rpmsg: rpmsg {
compatible = "fsl,imx8mq-rpmsg";
reg = <0x0 0x55000000 0x0 0x80000>;
memory-region = <&vdevbuffer>;
vdev-nums = <1>;
/* 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>;
status = "okay";
};
reserved-memory {
#address-cells = <2>;
#size-cells = <2>;
ranges;
// M7 TCM instruction memory
// Linux/Cortex-A physically can't access this area of memory
m7_itcm: m7@0x7E0000 {
no-map;
reg = <0 0x7E0000 0 0x20000>;
};
// M7 TCM data memory
// Linux/Cortex-A physically can't access this area of memory
m7_dtcm: m7@0x800000 {
no-map;
reg = <0 0x800000 0 0x20000>;
};
// M7 RAM
// This is used if the Cortex-M is booted from RAM
m7_reserved: m7@0x80000000 {
no-map;
reg = <0 0x80000000 0 0x1000000>;
};
// IMX Remote Proc; tx buffer 32KiB
vdev0vring0: vdev0vring0@55000000 {
compatible = "shared-dma-pool";
reg = <0 0x55000000 0 0x8000>;
no-map;
};
// IMX Remote Proc; rx buffer 32KiB
vdev0vring1: vdev0vring1@55008000 {
compatible = "shared-dma-pool";
reg = <0 0x55008000 0 0x8000>;
no-map;
};
rsc_table: rsc-table@550ff000 {
reg = <0 0x550ff000 0 0x1000>;
no-map;
};
/* RPMsg buffer; this is 64KiB which is 32KiB for the
* TX and RX buffers each. The start address is defined
* as the `VDEV0_VRING_BASE` define in the Cortex M7 code.
*/
vdevbuffer: vdevbuffer@55400000 {
compatible = "shared-dma-pool";
reg = <0 0x55400000 0 0x100000>;
no-map;
};
};
// IMX remote proc
imx8mp-cm7 {
compatible = "fsl,imx8mp-cm7";
rsc-da = <0x55000000>;
clocks = <&clk IMX8MP_CLK_M7_DIV>;
fsl,startup-delay-ms = <500>;
mbox-names = "tx", "rx", "rxdb";
mboxes = <&mu 0 1
&mu 1 1
&mu 3 1>;
memory-region = <&vdevbuffer>, <&vdev0vring0>, <&vdev0vring1>, <&rsc_table>;
status = "okay";
};
};
Oh, one more note; I'm booting the Cortex-M7 from TCM and am not using remote proc to start/stop/hotload it. Also, my kernel is v5.15.
So my questions about this are as follows:
- Is the `imx8mp-cm7` node needed if I'm using the imx_rpmsg_tty driver and am not using remote proc? From what I can tell, it doesn't seem needed
- Is there a good example provided somewhere for the `rpmsg` node? I found this node somewhere but I can't remember where but I don't think it was an official source (and there's no rpmsg node in the example DTS)
- Should the `vdevbuffer` reference be there in the `imx8mp-cm7`? From my understanding of how it works the answer is no, but it's like that in the example DTS.
- If it should stay, is the overlap with `rpmsg` also using `vdevbuffer` an issue? Same question with the reg value `55000000`
- I added memory reservations for the TCM memory but this isn't in the example either. Is it needed/good practice to include it? I know that the Cortex A53 (at least what I read) cannot access the TCM area of memory physically anyway.
- Is there anything blaringly wrong that you see?
Any help/comments are appreciated!