RPMSG does not work on IMX8M-Plus

Hi, @gustavo.tx san, @alvaro.tx san

It slipped my mind.
Could you send me the device tree file (*.dts) for the following files ?
・imx8mp-verdin-nonwifi-dahlia-rpmsg.dts
・imx8mp-verdin-nonwifi-dahlia-rpmsg.dts

Best regards, Takeo.

Hi Takeo san, I didn’t use the Dahlia so I only have the general device trees (that apply to all CBs) and the one for the dev board. The only change you would need for the Dahlia is adding the related RPMSG dtsi:

#include "imx8mp-verdin-rpmsg.dtsi"

imx8mp-verdin-wifi-dev.dts (439 Bytes)
imx8mp-verdin-rpmsg.dtsi (1.6 KB)
imx8mp-verdin.dtsi (33.4 KB)

Kind regards,
Alvaro.

Hi, Alvaro san, Thank you for your prompt reply.

・imx8mp-verdin-nonwifi-dahlia-rpmsg.dts
・imx8mp-verdin-nonwifi-dahlia-rpmsg.dts

Sorry, I make a mistake.

  • imx8mp-verdin-nonwifi-dev-rpmsg.dts

Kind regards, Takeo.

For imx8mp-verdin-nonwifi-dev-rpmsg.dts the change should be identical:

Simply add the #include "imx8mp-verdin-rpmsg.dtsi" to the DTS.

KR, Alvaro.

Hi, Alvaro san, The RPMSG work on my CB.
Thank you for helping me many times.

Kind regard, Takeo.

Good afternoon.
In order not to produce new topics on the current issue - I decided to continue here. I’m new to Embedded Linux drivers and trying to figure out the same problem using RPMSG.

I am using the following configuration:
Verdin iMX8M Plus Quad 4GB WB IT V1.1A
Verdin Development Board V1.1D
Reference Multimedia Image:

  • Version 6.2.0, linux-toradex 5.15.77
  • MACHINE = “verdin-imx8mp”
  • fdt_board = dev
  • fdtfile = imx8mp-verdin-wifi-dev.dtb

I compiled an example project with RPMSG from NXP SDK - “rpmsg_lite_str_echo_rtos”, and loaded it during bootloader:

setenv load_cmd “ext4load mmc 2:2”
setenv m7image “/home/CortexMTest.bin”
setenv m7image_size 21000
setenv loadm7image “${load_cmd} ${loadaddr} ${m7image}”
setenv m7boot “${loadm7image}; cp.b ${loadaddr} 0x7e0000 ${m7image_size}; dcache flush; bootaux 0x7e0000”
saveenv
run m7boot
boot

In the CortexM console, I saw the start message:
“RPMSG String Echo FreeRTOS RTOS API Demo…”

After downloading the kernel, I loaded the module into the system:

root@verdin-imx8mp-14762892:~# modprobe imx_rpmsg_tty && dmesg | grep rpmsg
[ 0.287236] imx rpmsg driver is registered.

There is no installation of the driver and channel configuration.
The necessary changes to work with the RPMSG are in https://github.com/toradex/device-trees/blob/toradex_5.4-2.1.x-imx/dts-arm64/imx8mp-verdin.dtsi :

reserved-memory {
       #address-cells = <2>;
       #size-cells = <2>;
       ranges;

       rpmsg_reserved: rpmsg@0x55800000 {
            no-map;
            reg = <0 0x55800000 0 0x800000>;
     };
};

However, in the reference image for IMX8MP, the kernel version is 5.15, respectively, the device-trees version is the same and there are no such changes yet:

reserved-memory {
         #address-cells = <2>;
         #size-cells = <2>;
         ranges;

         linux cma {
                size = <0 0x20000000>;
                /delete-node/ alloc-ranges;
         };
};

I also found an overlay to work with RemoteProc driver, RPMsg, allocates necessary memory regions and disables necessary peripherals to prevent kernel panics for 5.15 version - verdin-imx8mp_hmp_overlay.dts:
https://git.toradex.com/cgit/device-tree-overlays.git/diff/overlays/verdin-imx8mp_hmp_overlay.dts?h=toradex_5.15-2.1.x-imx&id=760aa56ac4cd3a706d19581787caf1af8f773df5

But this overlay only works with the version of the module without WiFi/Bluetooth. The same applies to most of the messages and files in the thread - everything was tested on non-WiFi modules. @alvaro.tx post indicated that @dpenning version worked with the caam driver patch on the wifi module. I tried this option, also tried the verdin-imx8mp_rpmsg_overlay, tried manually modifying imx8mp-verdin.dtsi, imx8mp-verdin-rpmsg.dtsi and imx8mp-verdin-wifi-dev.dts. In all cases I get the error fdt_overlay_apply(): FDT_ERR_NOTFOUND. Also fdt_high was set to 0xffffffffffffff before manipulations.

Maybe I’m doing something wrong? Maybe there is already an overlay for the WiFi module for version 5.15? Or what else should be checked?

Hi @Stan88 , thanks for the detailed info! I think you are doing everything right but you are missing a step:

Starting with Verdin iMX8MP V1.1A, the Bluetooth interface uses the same UART used for the M7 core debugging, so one should disable Bluetooth & make proper changes in the device tree to avoid conflicts.

We are actually looking to update our documentation to reflect this because currently this is not clear unless someone digs in the SoM datasheet.

Kind regards,
Alvaro.

Hi @alvaro.tx
this conflict has been discussed in other topics.
I’ve already posted my suggestion, but I re-post here for your convenience:

  • I know the the Cortex-M SDK and the samples from NXP use/reserve UART4 for Cortex-M device
  • U-Boot and device trees from NXP reflect this choice (UART4 to Cortex-M)
  • Toradex decided to use UART4 for the Bluetooth interface. Maybe UART2 would have been a better choice, but the decision has been made, and it can’t be changed anymore
  • using Cortex-M and Bluetooth is a valid usage scenario, and a working solution should be available

I’m aware that my proposal has some disadvantages, but I don’t see any “easy” solution for the customer:

  • I think that the best approach is that Toradex configures its U-Boot porting, Linux, TorizonCore so that UART4 is reseved to Cortex-A (for Bluetooth, or available) and UART2 is reserved to Cortex-M
  • in this way, the solution from Toradex is working (Bluetooth + Cortex-M)
  • Toradex should document this, so that the customer knows that the Cortex-M examples from NXP SDK should be changed accordingly, and they can’t be run out-of-the box. This is the only “effort” for the customer

I would not recommend Toradex to invest time and resources documenting that Bluetooth and Cortex-M device tree cannnot be used together.
I would recommend changing U-Boot porting and device trees so that UART2 is reserved to Cortex-M

I would appreciate if this suggestion could be considered.

Thank you for your help. I don’t need to use Bluetooth or WiFi in project - can I disable it into verdin-imx8mp_rpmsg_overlay.dts ? And how to do it - disable wake up pin MX8MP_IOMUXC_SD1_DATA6__GPIO2_IO08?

In imx8mp-verdin.dtsi there are to points for config bluetooth:

/* Verdin UART_4, used for Bluetooth on Wi-Fi/Bluetooth SKUs */
&uart4 {
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_uart4>;
};
-------------------------------
pinctrl_bluetooth_ctrl: bluetoothctrlgrp {
		fsl,pins =
			<MX8MP_IOMUXC_SD1_DATA6__GPIO2_IO08		0x1c4>;	/* WIFI_WKUP_BT */
};

Or is there a some other option?

Thank you for the help. I’ve disable all WiFi/BT configurations in device tree and it started to work.

1 Like

Thanks for the confirmation @Stan88 !

Thanks for the suggestion @vix. Indeed, this has been a fairly hot topic almost since V1.1A was released.

The reasoning why we decided to go for UART4 is mostly because we wanted to keep 3 general use UARTs available as per Verdin family design. So it is very unlikely that we will make any further changes down the line regarding this, unless we change the family specification (even more unlikely).

Please note that UART4 is really reserved as Cortex-M debug (not as a general interface), so really one should be using this mostly during development, while in production one may use another interface, specially if you are using BT. Additionally, users at development can use the non-WB module for the Cortex-M debug and avoid any extra development.

In any case, no solution is perfect, but unfortunately we are limited by the amount of UARTs available in the i.MX8MP SoC.

I agree on the following:

Toradex should document this, so that the customer knows that the Cortex-M examples from NXP SDK should be changed accordingly, and they can’t be run out-of-the box. This is the only “effort” for the customer