@gustavo.tx
Verdin iMX8MP Q 2 QB V1.0B
Verdin Development Board V1.1A
I think we can discard the carrier though, because it shows the same effect on our own boards.
@gustavo.tx
Verdin iMX8MP Q 2 QB V1.0B
Verdin Development Board V1.1A
I think we can discard the carrier though, because it shows the same effect on our own boards.
Hi @dpenning!
Iāve extracted the rootfs and the bootfs from my working image and put them into the Toradex Easy Installer package uploaded here. Please give it a try and let me know your results.
Hi @gustavo.tx
I installed your image using the Toradex Easy Installer. The overlay was already enabled, so I just performed these steps on uboot
setenv fdt_high 0xffffffffffffff
tftp 0x48000000 rpmsg_demo_compiled_by_gustavo.bin; cp.b 0x48000000 0x7e0000 20000; bootaux 0x7e0000
boot
Same Problem as always.
virtio_rpmsg_bus: probe of virtio0 failed with error -12
Same result even with the same image.
@alvaro.tx What revision are you using for test?
Model: Toradex Verdin iMX8M Plus Quad 4GB Wi-Fi / BT IT V1.0B, Serial# 06849022
Iām questioning my sanity with this issue.
Hi everyone, Iām going down the rabbit hole and trying to debug the driver (virtio_rpmsg_bus.c
) through dev_dbg
and try to find out what exactly is failing/returning.
@dpenning @deepimpact Can you confirm that before the
virtio_rpmsg_bus: probe of virtio0 failed with error -12
you are getting the following trace error from ioremap.c
?
[ 1.899196] ------------[ cut here ]------------
[ 1.903837] WARNING: CPU: 1 PID: 33 at arch/arm64/mm/ioremap.c:47 __ioremap_c aller+0xbc/0xe0
[ 1.912281] Modules linked in:
[ 1.915343] CPU: 1 PID: 33 Comm: kworker/1:1 Not tainted 5.4.129-37363-g9f63f e809c88-dirty #1
[ 1.923874] Hardware name: Toradex Verdin iMX8M Plus WB on Verdin Development Board (DT)
[ 1.931976] Workqueue: events deferred_probe_work_func
[ 1.937121] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 1.941919] pc : __ioremap_caller+0xbc/0xe0
[ 1.946104] lr : __ioremap_caller+0x50/0xe0
[ 1.950289] sp : ffff800011c7b750
[ 1.953605] x29: ffff800011c7b750 x28: ffff0000f847c000
[ 1.958923] x27: 0000000000000000 x26: ffff0000f93f9700
[ 1.964240] x25: 0000000000000000 x24: ffff0000f8f82f28
[ 1.969557] x23: 0068000000000707 x22: ffff800010be805c
[ 1.974873] x21: 0000000000000000 x20: 0000000055000000
[ 1.980190] x19: 0000000000003000 x18: 0000000000000020
[ 1.985507] x17: 00000000a5d1b7d5 x16: 0000000037edec3a
[ 1.990824] x15: ffffffffffffffff x14: ffff0000f926b91c
[ 1.996141] x13: ffffffffffffffff x12: 0000000000000030
[ 2.001456] x11: ffff800011c7b840 x10: ffff800011c7b840
[ 2.006773] x9 : ffff800011c7b840 x8 : 0000000015800000
[ 2.012089] x7 : 0000000000000018 x6 : ffff8000119906d8
[ 2.017404] x5 : ffff8000119906d8 x4 : 0000000000000001
[ 2.022721] x3 : 0000000000000001 x2 : 0000000055800000
[ 2.028037] x1 : 0000000000000000 x0 : 0000000000000001
[ 2.033356] Call trace:
[ 2.035808] __ioremap_caller+0xbc/0xe0
[ 2.039648] __ioremap+0x14/0x20
[ 2.042881] imx_rpmsg_find_vqs+0xd8/0x2ec
[ 2.046983] rpmsg_probe+0x108/0x3a4
[ 2.050563] virtio_dev_probe+0x15c/0x210
[ 2.054574] really_probe+0xdc/0x48c
[ 2.058153] driver_probe_device+0xe0/0x130
[ 2.062338] __device_attach_driver+0x88/0x10c
[ 2.066787] bus_for_each_drv+0x74/0xcc
[ 2.070624] __device_attach+0xd0/0x1a4
[ 2.074461] device_initial_probe+0x10/0x20
[ 2.078646] bus_probe_device+0x90/0xa0
[ 2.082488] device_add+0x39c/0x690
[ 2.085979] register_virtio_device+0xb0/0x110
[ 2.090425] imx_rpmsg_probe+0x230/0x530
[ 2.094351] platform_drv_probe+0x50/0xa0
[ 2.098362] really_probe+0xdc/0x48c
[ 2.101938] driver_probe_device+0xe0/0x130
[ 2.106123] __device_attach_driver+0x88/0x10c
[ 2.110571] bus_for_each_drv+0x74/0xcc
[ 2.114409] __device_attach+0xd0/0x1a4
[ 2.118248] device_initial_probe+0x10/0x20
[ 2.122432] bus_probe_device+0x90/0xa0
[ 2.126271] deferred_probe_work_func+0x80/0xd0
[ 2.130809] process_one_work+0x1c8/0x340
[ 2.134821] worker_thread+0x208/0x460
[ 2.138575] kthread+0x14c/0x150
[ 2.141807] ret_from_fork+0x10/0x24
[ 2.145386] ---[ end trace fe78f6e2a25f5db3 ]---
[ 2.150053] virtio_rpmsg_bus: probe of virtio0 failed with error -12
@gustavo.tx Please double check on the memory mapping including (but not limited to) the DTS. Iām 99% sure the issue is coming from the memory map since the error comes from ioremap.c
. Maybe you made some extra changes to U-Boot or the Kernel to allocate some memory for the M7?
IIRC the latest DTS we have is the one from here: RPMSG does not work on IMX8M-Plus - #72 by gustavo.tx
EDIT: It seems that this trace is not an error, but a warning. @gustavo.tx do you also get the same trace complaining?
EDIT 2: When compiling the DTBO I get a bunch of warnings as well. Do you also get this @gustavo.tx?
make -C /home/toradex/Toradex/rpmsg_imx8mplus/linux-toradex M=/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays
make[1]: Entering directory '/home/toradex/Toradex/rpmsg_imx8mplus/linux-toradex'
DTC /home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dtbo
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:89.2-37: Warning (reg_format): /fragment@4/__overlay__:reg: property has invalid length (16 bytes) (#address-cells == 2, #size-cells == 1)
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:16.3-10: Warning (ranges_format): /reserved-memory:ranges: empty "ranges" property but its #size-cells (2) differs from / (1)
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dtbo: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dtbo: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dtbo: Warning (spi_bus_reg): Failed prerequisite 'reg_format'
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:13.18-47.4: Warning (avoid_default_addr_size): /reserved-memory: Relying on default #address-cells value
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:13.18-47.4: Warning (avoid_default_addr_size): /reserved-memory: Relying on default #size-cells value
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:83.8-92.3: Warning (avoid_default_addr_size): /fragment@4/__overlay__: Relying on default #address-cells value
/home/toradex/Toradex/rpmsg_imx8mplus/device-tree-overlays/overlays/verdin-imx8mp_rpmsg_overlay.dts:83.8-92.3: Warning (avoid_default_addr_size): /fragment@4/__overlay__: Relying on default #size-cells value
Building modules, stage 2.
MODPOST 0 modules
make[1]: Leaving directory '/home/toradex/Toradex/rpmsg_imx8mplus/linux-toradex'
EDIT 3: I was checking our main DTS and there is a reference to rpmsg reserved memory that is not on NXPās device tree: imx8mp-verdin.dtsi Ā« freescale Ā« dts Ā« boot Ā« arm64 Ā« arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules
Maybe you deleted this and recompiled the whole device tree without this?
@alvaro.tx I can confirm the trace error. Following log is from the setup by Easy Installer @gustavo.tx provided.
[ 1.701370] ------------[ cut here ]------------
[ 1.706013] WARNING: CPU: 0 PID: 34 at arch/arm64/mm/ioremap.c:47 __ioremap_caller+0xc4/0xe8
[ 1.714462] Modules linked in:
[ 1.717524] CPU: 0 PID: 34 Comm: kworker/0:1 Not tainted 5.4.129-37347-g511c08dfa42b-dirty #20
[ 1.726143] Hardware name: Toradex Verdin iMX8M Plus on Verdin Development Board (DT)
[ 1.733986] Workqueue: events deferred_probe_work_func
[ 1.739131] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 1.743925] pc : __ioremap_caller+0xc4/0xe8
[ 1.748112] lr : __ioremap_caller+0x54/0xe8
[ 1.752298] sp : ffff800011b13740
[ 1.755614] x29: ffff800011b13740 x28: ffff00007affd180
[ 1.760932] x27: ffff8000113e8000 x26: 0000000000000000
[ 1.766250] x25: ffff00007aa8b000 x24: ffff00007ae61280
[ 1.771568] x23: 0068000000000707 x22: ffff800010be2f90
[ 1.776885] x21: 0000000000000000 x20: 0000000055000000
[ 1.782204] x19: 0000000000003000 x18: ffffffffffffffff
[ 1.787521] x17: 00000000f145db35 x16: 0000000013cb89e8
[ 1.792839] x15: ffff8000117488c8 x14: ffff00007ae5c91c
[ 1.798157] x13: ffff00007ae5c197 x12: 0000000000000030
[ 1.803473] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 1.808791] x9 : 0000000000000000 x8 : 0000000015800000
[ 1.814109] x7 : 0000000000000018 x6 : ffff800011873a18
[ 1.819425] x5 : ffff800011873a18 x4 : 0000000000000001
[ 1.824742] x3 : 0000000000000001 x2 : 0000000055800000
[ 1.830060] x1 : 0000000000000000 x0 : 0000000000000001
[ 1.835379] Call trace:
[ 1.837831] __ioremap_caller+0xc4/0xe8
[ 1.841670] __ioremap+0x10/0x18
[ 1.844905] imx_rpmsg_find_vqs+0xe0/0x270
[ 1.849007] rpmsg_probe+0xe0/0x350
[ 1.852501] virtio_dev_probe+0x16c/0x218
[ 1.856515] really_probe+0x108/0x360
[ 1.860182] driver_probe_device+0x58/0x100
[ 1.864371] __device_attach_driver+0x90/0xb0
[ 1.868732] bus_for_each_drv+0x64/0xc8
[ 1.872571] __device_attach+0xe4/0x140
[ 1.876412] device_initial_probe+0x10/0x18
[ 1.880602] bus_probe_device+0x90/0x98
[ 1.884443] device_add+0x4ec/0x690
[ 1.887935] register_virtio_device+0xe4/0x100
[ 1.892383] imx_rpmsg_probe+0x1f4/0x440
[ 1.896310] platform_drv_probe+0x50/0xa0
[ 1.900322] really_probe+0x108/0x360
[ 1.903990] driver_probe_device+0x58/0x100
[ 1.908178] __device_attach_driver+0x90/0xb0
[ 1.912538] bus_for_each_drv+0x64/0xc8
[ 1.916379] __device_attach+0xe4/0x140
[ 1.920219] device_initial_probe+0x10/0x18
[ 1.924406] bus_probe_device+0x90/0x98
[ 1.928244] deferred_probe_work_func+0x6c/0xa8
[ 1.932783] process_one_work+0x1e0/0x358
[ 1.936797] worker_thread+0x208/0x488
[ 1.940552] kthread+0x14c/0x150
[ 1.943785] ret_from_fork+0x10/0x1c
[ 1.947364] ---[ end trace 3fad8c41edcb8cf7 ]---
[ 1.952062] virtio_rpmsg_bus: probe of virtio0 failed with error -12
Hi, @alvaro.tx san.
Can you confirm that before the
virtio_rpmsg_bus: probe of virtio0 failed with error -12
Yes, I can confirm the trace error.
[ 0.276540] 000: ------------[ cut here ]------------
[ 0.276548] 000: WARNING: CPU: 0 PID: 32 at arch/arm64/mm/ioremap.c:47 __ioremap_caller+0xbc/0xe0
[ 0.276565] 000: Modules linked in:
[ 0.276571] 000: CPU: 0 PID: 32 Comm: kworker/0:1 Not tainted 5.4.115-rt57-5.3.0-devel+git.64dbf17bb33e #1
[ 0.276576] 000: Hardware name: Toradex Verdin iMX8M Plus WB on Verdin Development Board (DT)
[ 0.276587] 000: Workqueue: events deferred_probe_work_func
[ 0.276589] 000: pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 0.276593] 000: pc : __ioremap_caller+0xbc/0xe0
[ 0.276597] 000: lr : __ioremap_caller+0x50/0xe0
[ 0.276601] 000: sp : ffff800011abb760
[ 0.276604] 000: x29: ffff800011abb760 x28: ffff800010b96028
[ 0.276609] 000: x27: ffff800011312d80 x26: 0000000000000000
[ 0.276614] 000: x25: 0000000000000000 x24: 0000000000000000
[ 0.276618] 000: x23: 0068000000000707 x22: ffff800010b96b84
[ 0.276623] 000: x21: 0000000000000000 x20: 0000000055000000
[ 0.276628] 000: x19: 0000000000003000 x18: 0000000000000000
[ 0.276633] 000: x17: 000000001591b30d x16: 00000000c02b58f7
[ 0.276637] 000: x15: ffff0000f816bc70 x14: ffffffffffffffff
[ 0.276644] 000: x13: ffff0000f8cbf91c x12: 0000000000000030
[ 0.276650] 000: x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 0.276656] 000: x9 : 0000000000000000 x8 : 0000000015800000
[ 0.276662] 000: x7 : 0000000000000018 x6 : ffff8000117f2298
[ 0.276668] 000: x5 : ffff8000117f2298 x4 : 0000000000000001
[ 0.276674] 000: x3 : 0000000000000001 x2 : 0000000055800000
[ 0.276679] 000: x1 : 0000000000000000 x0 : 0000000000000001
[ 0.276685] 000: Call trace:
[ 0.276687] 000: __ioremap_caller+0xbc/0xe0
[ 0.276691] 000: __ioremap+0x10/0x18
[ 0.276695] 000: imx_rpmsg_find_vqs+0xd4/0x268
[ 0.276701] 000: rpmsg_probe+0xdc/0x338
[ 0.276705] 000: virtio_dev_probe+0x15c/0x208
[ 0.276712] 000: really_probe+0xd4/0x318
[ 0.276715] 000: driver_probe_device+0x54/0xe8
[ 0.276718] 000: __device_attach_driver+0x80/0xb8
[ 0.276722] 000: bus_for_each_drv+0x74/0xc0
[ 0.276725] 000: __device_attach+0xe8/0x148
[ 0.276728] 000: device_initial_probe+0x10/0x18
[ 0.276732] 000: bus_probe_device+0x90/0x98
[ 0.276736] 000: device_add+0x378/0x648
[ 0.276742] 000: register_virtio_device+0xb0/0x108
[ 0.276746] 000: imx_rpmsg_probe+0x1f4/0x430
[ 0.276749] 000: platform_drv_probe+0x50/0xa0
[ 0.276753] 000: really_probe+0xd4/0x318
[ 0.276758] 000: driver_probe_device+0x54/0xe8
[ 0.276764] 000: __device_attach_driver+0x80/0xb8
[ 0.276769] 000: bus_for_each_drv+0x74/0xc0
[ 0.276773] 000: __device_attach+0xe8/0x148
[ 0.276777] 000: device_initial_probe+0x10/0x18
[ 0.276782] 000: bus_probe_device+0x90/0x98
[ 0.276787] 000: deferred_probe_work_func+0x64/0x98
[ 0.276791] 000: process_one_work+0x1b4/0x328
[ 0.276796] 000: worker_thread+0x1f0/0x418
[ 0.276801] 000: kthread+0x130/0x150
[ 0.276806] 000: ret_from_fork+0x10/0x1c
[ 0.276811] 000: ---[ end trace 9232d9da6544d013 ]---
[ 0.276825] 000: virtio_rpmsg_bus: probe of virtio0 failed with error -12
@dpenning @deepimpact Thank you both for the quick confirmation.
@deepimpact Iām checking the device tree from NXP (imx8mp-evk-rpmsg.dts) and I see some differences to Gustavoās device tree.
This is the related device tree: imx8mp-evk-rpmsg.dts (3.3 KB)
Did you have to make any further changes to this or other device tree? Iām particularly curious on this part:
&rpmsg{
/*
* 64K for one rpmsg instance:
* --0x55000000~0x5500ffff: pingpong
*/
vdev-nums = <1>;
reg = <0x0 0x55000000 0x0 0x10000>;
memory-region = <&vdevbuffer>;
status = "disabled";
};
As you can see, by default, the rpmsg
node is disabled. I tried this change and I donāt get the virtio error but I also donāt get any response when launching modprobe imx-rpmsg-tty
.
Kindly let me know how you managed to get the IMX8MP EVK RPMSG working.
Hi, @alvaro.tx san
Kindly let me know how you managed to get the IMX8MP EVK RPMSG working.
Do you mean this ?
This is the comment at that time(Aug 4).
[Additional Information]
In u-boot, I configured the āfdtfileā variable like following.
uboot> setenv fdtfile āimx8mp-evk-rpmsg.dtbā
uboot> saveenv
uboot> boot
Best regards, Takeo.
Thanks, I was checking exactly that info but I meant if there was anything more to that.
So simply enabling the device tree in U-Bootā¦ Okay
Letās wait for Gustavoās feedback on my previous question.
@gustavo.tx I found something interesting:
The RPMsg region is already defined in the main dts: imx8mp-verdin.dtsi Ā« freescale Ā« dts Ā« boot Ā« arm64 Ā« arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules
However, this region is already used with PCIe: imx8mp-verdin.dtsi Ā« freescale Ā« dts Ā« boot Ā« arm64 Ā« arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules
I tried using this region directly for DTS in my DTBO:
&rpmsg {
/*
* 64K for one rpmsg instance:
* --0x55000000~0x5500ffff: pingpong
*/
vdev-nums = <1>;
memory-region = <&rpmsg_reserved>;
status = "okay";
};
And the error changed a bit and no trace warning:
root@verdin-imx8mp:~# dmesg | grep rpmsg
[ 0.081093] imx rpmsg driver is registered.
[ 1.925907] imx-rpmsg rpmsg: No vring buffer.
[ 1.930316] imx-rpmsg: probe of rpmsg failed with error -12
I think that something has changed/is missing in the device tree (imx8mp-verdin.dtsi) or in the DTBO you shared with us
Thanks for investigating this, guys.
I also asked more colleagues to try this out. One of them said Linux boots with no kernel panic but ttyRPMSG30 doesnāt show up. Iāll try to reproduce here.
Good news @gustavo.tx @alvaro.tx @deepimpact
After carefully checking the original RPMSG DT from the NXP EVK, I got everything working.
I have a very minimal example now. Will try to reproduce with a more realistic DT and share my results here later today.
Looking forward to your update @dpenning. I also gave it a try but couldnāt manage to make it work. I will check your changes in the morning if you publish this.
Here is my update. Happy to share the results that worked for me on imx8MP Q 2GB.
My approach
First, I sourced the device tree of the NXP Version @deepimpact quoted above. He mentioned that for EVK the RPMSG is working there out of the box. So I thought this as a good starting point.
The EVK files are also included in the toradex release, however they are not the same version.
And there it is getting interesting. Gustavos DTO seems to be based on the EVK that is shipped with linux-toradex in 5.4-2.3.
The sources in NXP (LF_v5.10_1.0.0_images_IMX8MPEVK) differ in some ways. I did not dig into the driver, but tried to apply these differences back to 5.4-2.3.
Patches and build
I tested on toradex manifest 1687afae4359efc5ced34e6ceb701527462ff7c1 (5.3.0).
I do not use any overlay but changed the DT directly. This should also simplify reproduction for everybody.
Test
In uboot
setenv m4addr 0x7e0000
fatload mmc 2 0x48000000 imx8mp_m7_TCM_rpmsg_lite_str_echo_rtos.bin && cp.b 0x48000000 ${m4addr} 20000 && bootaux ${m4addr}
The M7 UART will immediately display RPMSG String Echo FreeRTOS RTOS API Demo...
Boot linux
boot
The M7 UART will during boot display Nameservice sent, ready for incoming messages...
When linux is ready:
modprobe imx_rpmsg_tty
The M7 UART will display Get Message From Master Side : "hello world!" [len : 12]
The device /dev/ttyRPMSG30 can be used
Notes:
Hi @dpenning and @alvaro.tx!
I also found a solution based on the initial work I did on this.
In my initial tests, I had compiled a full, rpmsg-specific device tree for the Dahlia just like NXP does for their EVK. Using that device tree (attached here), RPMsg works.
I just compiled the equivalent device tree for the dev board, tested it and it also works, considering that the CAAM patch is applied and fdt_high
is set to 0xffffffffffffffff
on U-Boot.
For this to work, copy, for instance, imx8mp-verdin-nonwifi-dev-rpmsg.dtb
to /boot and set fdt_board
to dev-rpmsg
on U-Boot. It should load this device tree.
imx8mp-verdin-nonwifi-dahlia-rpmsg.dtb (84.2 KB)
imx8mp-verdin-nonwifi-dev-rpmsg.dtb (84.7 KB)
Hi everyone, I have some good news.
Thanks to @dpenning 's suggestion, I tried the similar approach for the WiFi version, and it worked flawlessly, even patching this outside Yocto by simply editing the related device trees (imx8mp-verdin.dtsi
, imx8mp-verdin-rpmsg.dtsi
and, in my case, imx8mp-verdin-wifi-dev.dts
). The previous changes (caam.patch and the fdt_high) were already there, so I cannot confirm its effect.
The bad news is that I tried a bunch of different options with overlays but didnāt manage to make it work, so for now, please use the NXPās direct approach.
@gustavo.tx , kindly let the BSP / PMS team know our findings and see how we can proceed moving forward. I think we ideally want to have this as an overlay, but for now, there is this alternative for customers.
Thank you to @dpenning @deepimpact for your help and your patience on this matter. Please, feel free to contact us again for any further issue.
Hi, everyone.
It worked in my board(iMX8M Plus Quad 4GB + Development board), too.
Itās almost like this.
Youāve really helped me out on this one. I really appreciate that!
Hey guys!
As @alvaro.tx said, we agreed to advise you to work around the issue by changing the complete device tree instead of the usually preferred method of using device tree overlays.
Itās an easy and viable solution that will allow you to resume your development.
Weāll continue investigating the overlays issues when we have the time, which Iāll sync with PM and BSP.
Thank you guys for all the work and help. Do not hesitate to contact us again if you face any other issues.