On the Colibri iMX7D we are using both, Linux as main OS and the M4-Core running with FreeRTOS.
- The M4 is programmed in u-boot during boot.
- For communication we use a the imx_rpmsg_tty.ko kernel modul.
Everything works as expected on Kernel toradex_5.4-2.3.x-imx
https://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_5.4-2.3.x-imx
In our devicetree the only modifications required were adding:
...
&rpmsg {
status = "okay";
};
&uart2 {
status = "disabled"; // for m4
};
...
Now I’m trying to update our Linux Kernel to a more recent version. I’would prefer going mainline but if I’m correctly informed the RPMsg from NXP is not supported.
Therefore I started some test with newer Kernel versions from Toradex and NXP:
https://git.toradex.com/cgit/linux-toradex.git/log/?h=toradex_ti-linux-6.1.y
Unfortunately I’m not able to bring it up.
What I did so far:
- Extended the Devicetree with the missing parts
- Enabled debug level in involved kernel drivers
Devicetree modifications (not sure yet if I need all the ocram parts)
diff --git a/arch/arm/boot/dts/nxp/imx/imx7s.dtsi b/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
index fe220d3d225c..3cdcf7731232 100644
--- a/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
+++ b/arch/arm/boot/dts/nxp/imx/imx7s.dtsi
@@ -143,6 +143,40 @@ soc: soc {
interrupt-parent = <&gpc>;
ranges;
+ ocrams_ddr: sram@900000 {
+ compatible = "fsl,ddr-lpm-sram";
+ reg = <0x900000 0x1000>;
+ clocks = <&clks IMX7D_OCRAM_CLK>;
+ };
+
+ ocram: sram@901000 {
+ compatible = "mmio-sram";
+ reg = <0x901000 0x1f000>;
+ clocks = <&clks IMX7D_OCRAM_CLK>;
+ };
+
+ ocrams: sram@180000 {
+ compatible = "fsl,lpm-sram";
+ reg = <0x180000 0x8000>;
+ clocks = <&clks IMX7D_OCRAM_S_CLK>;
+ status = "disabled";
+ };
+
+ ocrams_mf: sram-mf@900000 {
+ compatible = "fsl,mega-fast-sram";
+ reg = <0x900000 0x20000>;
+ clocks = <&clks IMX7D_OCRAM_CLK>;
+ };
+
+ ocram_optee {
+ compatible = "fsl,optee-lpm-sram";
+ reg = <0x180000 0x8000>;
+ overw_reg = <&ocrams_ddr 0x904000 0x1000>,
+ <&ocram 0x905000 0x1b000>,
+ <&ocrams 0x900000 0x4000>;
+ overw_clock = <&ocrams &clks IMX7D_OCRAM_CLK>;
+ };
+
funnel@30041000 {
compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
reg = <0x30041000 0x1000>;
@@ -1153,6 +1187,15 @@ uart7: serial@30a90000 {
status = "disabled";
};
+ mu: mu@30aa0000 {
+ compatible = "fsl,imx7d-mu";
+ reg = <0x30aa0000 0x10000>;
+ interrupts = <GIC_SPI 88 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clks IMX7D_MU_ROOT_CLK>;
+ clock-names = "mu";
+ #mbox-cells = <2>;
+ };
+
mu0a: mailbox@30aa0000 {
compatible = "fsl,imx7s-mu", "fsl,imx6sx-mu";
reg = <0x30aa0000 0x10000>;
@@ -1294,6 +1337,20 @@ fec1: ethernet@30be0000 {
fsl,stop-mode = <&gpr 0x10 3>;
status = "disabled";
};
+
+ rpmsg: rpmsg{
+ compatible = "fsl,imx7d-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>;
+ status = "disabled";
+ };
};
dma_apbh: dma-controller@33000000 {
Our top level devicetree
/ {
...
memory {
linux,usable-memory = <0x80000000 0x1ff00000>;
};
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
m4_reserved: m4@9fe00000 {
no-map;
reg = <0x9fe00000 0x1fffff>;
};
rpmsg_vrings: vrings0@8ff00000 {
compatible = "shared-dma-pool";
no-map;
reg = <0x8ff00000 0x100000>;
};
};
m4_tcm: tcml@7f8000 {
compatible = "fsl, m4_tcml";
reg = <0x007f8000 0x8000>;
};
};
&ocram {
reg = <0x00901000 0xf000>;
};
&mu {
status = "okay";
};
&rpmsg {
vdev-nums = <1>;
reg = <0x8fff0000 0x10000>;
memory-region = <&rpmsg_vrings>;
status = "okay";
};
&uart2 {
status = "disabled"; // used by M4
};
...
kernel boot log (dmesg | grep ‘rpmsg|mu’)
[ 0.036894] imx mu driver is registered.
[ 0.036935] imx rpmsg driver is registered.
[ 0.060903] imx-rpmsg 8fff0000.rpmsg: assigned reserved memory node vrings0@8ff00000
[ 0.060923] imx-rpmsg 8fff0000.rpmsg: imx_rpmsg_probe rpdev vdev1: vring0 0x8fff0000, vring1 0x8fff8000
[ 0.060958] virtio virtio0: imx_rpmsg_set_status new status: 1
[ 0.067363] MU is ready for cross core communication!
[ 0.095430] virtio_rpmsg_bus virtio0: imx_rpmsg_set_status new status: 2
[ 0.095489] imx-rpmsg 8fff0000.rpmsg: vring0: phys 0x8fff0000, virt 0x(ptrval)
[ 0.095540] imx-rpmsg 8fff0000.rpmsg: vring1: phys 0x8fff8000, virt 0x(ptrval)
[ 0.095673] virtio_rpmsg_bus virtio0: buffers: va (ptrval), dma 0x8ff00000
[ 0.096191] virtio_rpmsg_bus virtio0: imx_rpmsg_set_status new status: 4
[ 0.120184] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 0.120198] virtio_rpmsg_bus virtio0: imx_rpmsg_set_status new status: 4
cat /sys/firmware/devicetree/base/soc/aips-bus@30800000/rpmsg/status
okay
kernel boot log (dmesg | grep ‘rpmsg|mu’) from a system with Kernel version toradex_5.4-2.3.x-imx
[ 0.051690] imx mu driver is registered.
[ 0.052410] imx rpmsg driver is registered.
[ 0.053600] MU is ready for cross core communication!
[ 0.089199] virtio_rpmsg_bus virtio0: rpmsg host is online
[ 0.089238] virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x0
What I’m missing in the log is the following output line:
...
[ 0.089238] virtio_rpmsg_bus virtio0: creating channel rpmsg-openamp-demo-channel addr 0x0
...
I’ve also seen that the interrupt is not starting to count but I think this is a consecutive fault
cat /proc/interrupts | grep imx_mu
30: 0 0 GPCV2 88 Edge imx_mu_chan[0-1], imx_mu_chan[1-1], imx_mu_chan[3-1], imx-mu-lp
from a system with Kernel version toradex_5.4-2.3.x-imx
cat /proc/interrupts | grep imx_mu
53: 3 0 GPCV2 88 Edge imx_mu_chan[0-1], imx_mu_chan[1-1], mx_mu_chan[3-1], imx-mu-lp
Can someone point me to the right direction what part I’m missing to bring it up.
Thanks in advice