This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] J722SXH01EVM:启动 IPC 并使用 Linux 运行

Guru**** 1812430 points
请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1430170/j722sxh01evm-getting-ipc-up-and-running-with-linux

器件型号:J722SXH01EVM

工具与软件:

您好!

我想了解 IPC 的具体工作方式、并让基本系统运行。 从我的视觉应用基本映像中、我的目标是使用 ipc_echo_test 映像替换所有子核映像、并确认所有子核映像都使用 rpmsg_char_simple 进行通信。

我已将所有固件链接到各自的图像:

root@j722s-evm:/lib/firmware# ls -l
lrwxrwxrwx 1 weston weston      65 Oct 25  2024 j722s-c71_0-fw -> /lib/firmware/ti-ipc/j722s/ipc_echo_test_c7x_1_release_strip.xe71
lrwxrwxrwx 1 weston weston      68 Mar  9  2018 j722s-c71_0-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_c7x_1.out.signed
lrwxrwxrwx 1 weston weston      65 Oct 25  2024 j722s-c71_1-fw -> /lib/firmware/ti-ipc/j722s/ipc_echo_test_c7x_2_release_strip.xe71
lrwxrwxrwx 1 weston weston      68 Mar  9  2018 j722s-c71_1-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_c7x_2.out.signed
lrwxrwxrwx 1 weston weston      67 Oct 24  2024 j722s-main-r5f0_0-fw -> /lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu3_0_release_strip.xer5f
lrwxrwxrwx 1 weston weston      69 Mar  9  2018 j722s-main-r5f0_0-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_mcu2_0.out.signed
lrwxrwxrwx 1 weston weston      71 Mar  9  2018 j722s-mcu-r5f0_0-fw -> /usr/lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu2_0_release_strip.xer5f
lrwxrwxrwx 1 weston weston      78 Mar  9  2018 j722s-mcu-r5f0_0-fw-sec -> /usr/lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu2_0_release_strip.xer5f.signed

我已经确认为这些映像保留了正确的存储器区域:

root@j722s-evm:/lib/firmware# dmesg | grep Reserved
[    0.000000] Reserved memory: created CMA memory pool at 0x00000009c8000000, size 896 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0000000, size 1 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a0100000, size 15 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1000000, size 1 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a1100000, size 15 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2000000, size 1 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a2100000, size 15 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3000000, size 1 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a3100000, size 15 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a4000000, size 1 MiB
[    0.000000] Reserved memory: created DMA memory pool at 0x00000000a4100000, size 15 MiB

但是、在启动期间、系统无法初始化 c7x 内核:

[   11.849083] k3-dsp-rproc 7e000000.dsp: assigned reserved memory node c7x-dma-memory@a3000000
[   11.858477] k3-dsp-rproc 7e000000.dsp: configured DSP for IPC-only mode
[   11.866588] remoteproc remoteproc0: 7e000000.dsp is available
[   11.877477] remoteproc remoteproc0: attaching to 7e000000.dsp
[   11.885134] videodev: Linux video capture interface: v2.00
[   11.887308] remoteproc remoteproc0: carveout rsc has non zero reserved bytes
[   11.890760] OF: graph: no port node found in /bus@f0000/dss@30220000/oldi-txes/oldi@1/ports
[   11.900706] remoteproc remoteproc0: Failed to process resources: -22
[   11.922267] k3-dsp-rproc 7e000000.dsp: error -EINVAL: failed to add register device with remoteproc core
[   11.933600] k3-dsp-rproc: probe of 7e000000.dsp failed with error -22
[   11.953474] remoteproc remoteproc0: releasing 7e000000.dsp
[   11.965282] k3-dsp-rproc 7e200000.dsp: assigned reserved memory node c7x-dma-memory@a4000000
[   11.978734] k3-dsp-rproc 7e200000.dsp: configured DSP for IPC-only mode
[   11.994471] remoteproc remoteproc0: 7e200000.dsp is available
[   11.995411] platform 79000000.r5f: configured R5F for IPC-only mode
[   12.001356] remoteproc remoteproc0: attaching to 7e200000.dsp
[   12.007604] platform 79000000.r5f: assigned reserved memory node mcu-r5fss-dma-memory-region@a1000000
[   12.018550] remoteproc remoteproc0: unsupported vendor resource 128
[   12.029075] remoteproc remoteproc0: rsc table is truncated
[   12.034968] remoteproc remoteproc0: Failed to process resources: -22
[   12.049025] OF: graph: no port node found in /bus@f0000/dss@30220000/oldi-txes/oldi@1/ports
[   12.073072] remoteproc remoteproc1: 79000000.r5f is available
[   12.081261] remoteproc remoteproc1: attaching to 79000000.r5f
[   12.105322] k3-dsp-rproc 7e200000.dsp: error -EINVAL: failed to add register device with remoteproc core
[   12.115149] OF: graph: no port node found in /bus@f0000/dss@30220000/oldi-txes/oldi@1/ports
[   12.123763] k3-dsp-rproc: probe of 7e200000.dsp failed with error -22
[   12.136672] remoteproc remoteproc0: releasing 7e200000.dsp

随后无法通过 IPC 进行通信。

我肯定是误解了一些简单的东西,但文件是相当少. 请使用任何指针。

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    对于 J722S 上的 IPC 通信、需要 从 MCU+SDK 运行 ipc_rpmsg_echo_linux。  IPC_Echo_TEST 是 PDK 的一部分、J722S 中没有。 分享您构建示例的步骤、您修改软链接的方式。

    此致

    Tarun Mukesh

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    尊敬的 Tarun:

    我使用 ipc_rpmsg_echo_linux 进行了相同的测试、但遗憾的是、结果相同。 我的方法可能有问题、希望您能提供帮助。

    我按照文档中所述构建了 Linux SDK 和 RTOS SDK。 我们基本上只需为 RTOS 1制作全部内容、为 Linux 1制作 setup.sh 文件即可。 我使用 tftp 引导和 nfs 设置 Linux 以简化开发。

    然后我进入 RTOS 构建过程、找到 ipc_rpmsg_echo_linux.c75ss0-0.release.strip.out、并将其移至 NFS 中的一个文件夹。 然后、使用`ln -sf /lib/firmware/mine/ipc_rpmsg_echo_linux.c75ss0-0.release.strip.out j722s-C71_0-FW`在 NFS 中进行对称链接

    引导 Linux 时、我遇到了与之前相同的问题、其中 remoteproc 会拒绝 c7x 内核

    [   11.803989] remoteproc remoteproc0: 7e000000.dsp is available
    [   11.822192] remoteproc remoteproc0: attaching to 7e000000.dsp
    [   11.828834] remoteproc remoteproc0: carveout rsc has non zero reserved bytes
    [   11.836701] remoteproc remoteproc0: Failed to process resources: -22
    [   11.888749] remoteproc remoteproc1: 79000000.r5f is available
    [   11.895719] remoteproc remoteproc1: attaching to 79000000.r5f
    [   11.901313] k3-dsp-rproc 7e000000.dsp: error -EINVAL: failed to add register device with remoteproc core
    [   11.988673] remoteproc remoteproc0: releasing 7e000000.dsp
    [   12.055787] remoteproc remoteproc0: 7e200000.dsp is available
    [   12.072371] remoteproc remoteproc0: attaching to 7e200000.dsp
    [   12.086104] remoteproc remoteproc0: unsupported resource 33554432
    [   12.093808] remoteproc remoteproc0: rsc table is truncated
    [   12.104511] remoteproc remoteproc0: Failed to process resources: -22
    [   12.117432] k3-dsp-rproc 7e200000.dsp: error -EINVAL: failed to add register device with remoteproc core



    我检查了引导的 Linux 中的符号链接、并使用 objdump 确认它们确实链接到了我预期的文件:

    lrwxrwxrwx 1 weston weston      66 Oct 29  2024 j722s-c71_0-fw -> /lib/firmware/mine/ipc_rpmsg_echo_linux.c75ss0-0.release.strip.out
    lrwxrwxrwx 1 weston weston      68 Mar  9  2018 j722s-c71_0-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_c7x_1.out.signed
    lrwxrwxrwx 1 weston weston      66 Oct 29  2024 j722s-c71_1-fw -> /lib/firmware/mine/ipc_rpmsg_echo_linux.c75ss1-0.release.strip.out
    lrwxrwxrwx 1 weston weston      68 Mar  9  2018 j722s-c71_1-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_c7x_2.out.signed
    lrwxrwxrwx 1 weston weston      67 Oct 24  2024 j722s-main-r5f0_0-fw -> /lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu3_0_release_strip.xer5f
    lrwxrwxrwx 1 weston weston      69 Mar  9  2018 j722s-main-r5f0_0-fw-sec -> /usr/lib/firmware/vision_apps_evm/vx_app_rtos_linux_mcu2_0.out.signed
    lrwxrwxrwx 1 weston weston      71 Mar  9  2018 j722s-mcu-r5f0_0-fw -> /usr/lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu2_0_release_strip.xer5f
    lrwxrwxrwx 1 weston weston      78 Mar  9  2018 j722s-mcu-r5f0_0-fw-sec -> /usr/lib/firmware/ti-ipc/j722s/ipc_echo_test_mcu2_0_release_strip.xer5f.signed

    我不知道什么是"SEC"固件,我已经留下他们单独

    此固件映像中的资源表与地址0xA3100000处的器件树匹配、但我真不知道还需要检查哪些内容

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    经过进一步调查、我发现 uboot 内发生的固件加载大小不正确:

    50228 bytes read in 103 ms (475.6 KiB/s)
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Load Remote Processor 0 with data@addr=0x82000000 50228 bytes: Success!
    45492 bytes read in 103 ms (430.7 KiB/s)
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Load Remote Processor 2 with data@addr=0x82000000 45492 bytes: Success!
    11821224 bytes read in 588 ms (19.2 MiB/s)
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Load Remote Processor 3 with data@addr=0x82000000 11821224 bytes: Success!
    11821224 bytes read in 589 ms (19.1 MiB/s)
    Warning: Did not detect image signing certificate. Skipping authentication to prevent boot failure. This will fail on Security Enforcing(HS-SE) devices
    Load Remote Processor 4 with data@addr=0x82000000 11821224 bytes: Success!

    我怀疑固件是从 SD 卡的映像加载的。 显然、我更希望它从 NFS 加载、因此 uboot 使用的文件与 Linux 使用的文件之间存在不希望的差异。

    通过从 u-boot 脚本中删除` run boot_rprocs `命令、Linux 现在初始化内核而不是 uboot、这种做法更可取。 我不知道为什么有人会想 u-boot 这样做。

    我现在能够通过 rpmsg_char_simple 与内核通信、因此我的问题目前似乎可以得到解决

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好!

    uboot 通常会加载所有固件、因为启动 Linux 需要更多时间、  

    通过从 u-boot 脚本中删除`run boot_rprocs`命令、Linux 现在将初始化内核而不是 uboot、

    如果您不想在 u boot 中加载其他内核,您可以按照修改的方式进行更改, Linux 将加载和初始化内核。

    '现在可以使用 rpmsg_char_simple 与内核通信、所以我的问题现在似乎已经解决了

    很好听到。

    此致

    Tarun Mukesh