Hi @cillex !
We did some investigation and seems like we found the culprit
After adding some printk
to remoteproc
stuff in kernel/drivers, we found out that remoteproc
is failing due to lack of resource table in the binary built for M4. You can see it here:
https://git.toradex.com/cgit/linux-toradex.git/tree/drivers/remoteproc/remoteproc_elf_loader.c?h=toradex_ti-linux-6.1.y#n338
Indeed checking the binary for the hello-world from the TI SDK, there is no resource table.
This thread in TI forum is related to the issue: https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1114668/am6252-load-m4-firmware-generate-from-mcu-rtos-sdk
We tried to manually “inject” a resource table into the linker script of the hello-world, but it didn’t work: the -22
error occurred.
After, we compiled some IPC demo from TI SDK(according to the TI thread thread referenced above, it will have a resource table) and ran it. The -22
didn’t happen, which is a win (but it failed differently).
We specifically compiled the examples/drivers/ipc/ipc_rpmsg_echo_linux/am62x-sk/m4fss0-0_freertos
. Here is the output (the rbeims
stuff was added by @rafael.tx: it prints the function and the line in the source code):
root@verdin-am62-15133532:~# echo start > /sys/class/remoteproc/remoteproc0/state
[ 832.694530] remoteproc remoteproc0: powering up 5000000.m4fss
[ 832.701236] remoteproc remoteproc0: Booting fw image am62-mcu-m4f0_0-fw, size 54860
[ 832.709141] rbeims: rproc_fw_boot:1393
[ 832.713102] rbeims: rproc_fw_boot:1399 0
[ 832.717451] rbeims: rproc_fw_boot:1407 0
[ 832.721686] rbeims: rproc_fw_boot:1417 0
[ 832.728117] rbeims: rproc_fw_boot:1429 0
[ 832.732220] rbeims: rproc_fw_boot:1437 0
[ 832.736362] rbeims: rproc_start:1271
[ 832.745347] rbeims: rproc_start:1279
[ 832.749578] rbeims: rproc_start:1295
[ 832.754771] rbeims: k3_m4_rproc_request_mbox:111 ret: 0
[ 832.760212] rbeims: k3_m4_rproc_start:254 ret: 0
[ 832.765329] rbeims: k3_rproc_release:95 ret: 0
[ 832.769848] rbeims: k3_m4_rproc_start:259 ret: 0
[ 832.774597] rbeims: rproc_start:1304
[ 832.778338] rproc-virtio rproc-virtio.6.auto: assigned reserved memory node m4f-dma-memory@90
[ 832.789448] virtio_rpmsg_bus virtio1: rpmsg host is online
[ 832.795309] virtio_rpmsg_bus virtio1: creating channel ti.ipc4.ping-pong addr 0xd
[ 832.803240] rproc-virtio rproc-virtio.6.auto: registered virtio1 (type 7)
[ 832.817340] virtio_rpmsg_bus virtio1: creating channel rpmsg_chrdev addr 0xe
[ 832.828598] rbeims: rproc_start:1312
[ 832.834959] rbeims: rproc_start:1321
[ 832.840045] remoteproc remoteproc0: remote processor 5000000.m4fss is now up
[ 832.848086] rbeims: rproc_fw_boot:1445 0
This is the part that it fails:
[ 850.280024] ti-sci 44043000.system-controller: Mbox timedout in)
[ 850.290150] ti-sci 44043000.system-controller: Mbox send fail -110
[ 850.296379] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 850.307179] cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22
[ 850.314200] cpufreq: __target_index: Failed to change cpu frequency: -22
[ 851.336010] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 851.346133] ti-sci 44043000.system-controller: Mbox send fail -110
[ 851.352362] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 852.392006] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 852.402140] ti-sci 44043000.system-controller: Mbox send fail -110
[ 852.408372] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 853.448006] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 853.458138] ti-sci 44043000.system-controller: Mbox send fail -110
[ 853.464373] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 853.475169] cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22
[ 853.482188] cpufreq: __target_index: Failed to change cpu frequency: -22
[ 854.503999] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 854.514115] ti-sci 44043000.system-controller: Mbox send fail -110
[ 854.520341] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 855.559997] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 855.570122] ti-sci 44043000.system-controller: Mbox send fail -110
[ 855.576370] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 856.616004] ti-sci 44043000.system-controller: Mbox timedout in resp(caller: sci_clk_determi)
[ 856.626131] ti-sci 44043000.system-controller: Mbox send fail -110
[ 856.632366] ti-sci-clk 44043000.system-controller:clock-controller: determine-rate failed fo0
[ 856.643160] cpu cpu0: _opp_config_clk_single: failed to set clock rate: -22
[ 856.650176] cpufreq: __target_index: Failed to change cpu frequency: -22
As you can see from the logs above, it is a progress at least
We intend to continue investigating this latter this week.
Hopefully, this helps you and you can try something in parallel.
Have a nice day!
Best regards,