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.

[FAQ] [参考译文] [常见问题解答] AM62x/AM62Ax/AM62Px:如果 Linux 无法使用 DM R5F 初始化 Remoteproc、该怎么办?

Guru**** 2552330 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1427871/faq-am62x-am62ax-am62px-what-to-do-if-linux-fails-to-initialize-remoteproc-with-dm-r5f

我正在使用具有 DM R5F 的处理器(AM62x、AM62Ax、AM62Px)。 我使用 SDK 9.2.1或 SDK 10.0。 设备管理器(RM) R5F 内核列在 Linux devicetree 中、因此 Linux 应使用 remoteproc 驱动程序在 Linux 引导期间连接到 DM R5F、并初始化与 DM R5F 的 RPMSG 通信[1][2]。 但是、Linux remoteproc 驱动程序出现故障、并显示错误-19。 发生什么事了?

下面是一个连接到 DM R5F 内核的"工作"示例:

[    6.569096] platform 78000000.r5f: R5F core may have been powered on by a different host, programmed state (0) != actual state (1)
[    6.572660] platform 78000000.r5f: configured R5F for IPC-only mode
[    6.573291] platform 78000000.r5f: assigned reserved memory node r5f-dma-memory@9da00000
[    6.573941] remoteproc remoteproc3: 78000000.r5f is available
[    6.574088] remoteproc remoteproc3: attaching to 78000000.r5f
[    6.589108] platform 78000000.r5f: R5F core initialized in IPC-only mode
[    6.589191] rproc-virtio rproc-virtio.5.auto: assigned reserved memory node r5f-dma-memory@9da00000
[    6.589483] rproc-virtio rproc-virtio.5.auto: registered virtio1 (type 7)
[    6.589504] remoteproc remoteproc3: remote processor 78000000.r5f is now attached

以下是失败情况的示例:

[    6.670963] platform 78000000.r5f: ti-sci processor request failed: -19
[    6.671050] platform 78000000.r5f: ti_sci_proc_request failed, ret = -19
[    6.674274] k3_r5_rproc bus@f0000:bus@b00000:r5fss@78000000: k3_r5_core_of_init failed, ret = -19
[    6.674301] k3_r5_rproc bus@f0000:bus@b00000:r5fss@78000000: k3_r5_cluster_of_init failed, ret = -19

--------------------------------------------------------

其他 说明:

[1] DM R5F 内核比 Linux 更早开始在引导过程中运行。 对于大多数远程内核(即非 Linux 内核)、Linux remoteproc 驱动程序会初始化内核并设置基础设施以启用与远程内核的 RPMsg 通信。 但是、由于 DM R5F 内核已在运行、Linux Remoteproc 驱动程序只需"连接"到已运行的 DM R5F、并初始化 RPMsg 基础设施。 有关启动和禁用处理器内核的更多信息、请参阅相关处理器学院的多核模块:
AM62x: https://dev.ti.com/tirex/explore/node?node=A__AdnCtmyMLBJQE.U38-Dw4w__AM62-ACADEMY__uiYMDcq__LATEST
AM62Ax
: https://dev.ti.com/tirex/explore/node?node=A__Ada-WjvmUg3JmB109NavGA__AM62A-ACADEMY__WeZ9SsL__LATEST
AM62Px: https://dev.ti.com/tirex/explore/node?node=A__AYnQdcxcEc8wt-WsqMumsA__AM62P-ACADEMY__fp5YxRM__LATEST 

[2]如果 RPMsg 通信不与 DM R5F 一起使用,并且 Linux 在运行时不与 DM R5F 代码交互,那么 Remoteproc 驱动程序就不需要连接到 DM R5F。 但是、请记住、应始终在 Linux devicetree 文件中保留 DM R5F 的 DDR 内存分配、以防止 Linux 覆盖 DM R5F 的数据。 有关更多信息、请参阅相关处理器学院的多核模块:
AM62x: https://dev.ti.com/tirex/explore/node?node=A__ASVmm1hNWx7CjUJCy91Aig__AM62-ACADEMY__uiYMDcq__LATEST 
AM62Ax: https://dev.ti.com/tirex/explore/node?node=A__Ab1lHTiDEw5GmFW034IFNw__AM62A-ACADEMY__WeZ9SsL__LATEST
AM62Px: https://dev.ti.com/tirex/explore/node?node=A__AUiUIYaptWENZHufiXw.FQ__AM62P-ACADEMY__fp5YxRM__LATEST 

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

    首先介绍一下此处所发生的事情的背景  

    在处理器内核可以查询另一个内核的状态之前、它需要从 TIFS 申请该内核的所有权(即、您需要内核的所有权、不仅要向 TISCI 代码发送"set"命令、还要发送"get"命令来查询信息)。  Remoteproc 驱动程序尝试初始化内核、甚至连接到当前正在运行的内核之前、Remoteproc 驱动程序需要查看该远程内核的状态。 因此、Remoteproc 驱动程序通过 ti_sci_proc_request 消息请求另一个内核的所有权。

    在 SDK 9.2.0和 SDK 9.2.1之间、我们更新了 DM R5F 和 TIFS 软件之间的通信代码。 这就是该行为开始出现的时候。 这种行为的原因是 TIFS 正在拒绝 Remoteproc 驱动程序的所有权请求。

    DM R5F 代码在 DM R5F 初始化期间请求自身的所有权。 故障情况是由于 DM R5F 和 TIFS 软件之间的通信代码在初始化后未能释放 DM R5F 的所有权而导致的。 在这些情况下、TIFS 代码认为 DM R5F 仍保留自己的所有权、因此 TIFS 代码拒绝 remoteproc 驱动程序对 DM R5F 的所有权请求。

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

    如何修复该行为?  

    此行为将在 SDK 10.1中修复。

    使用 SDK 9.2.1或 SDK 10.0的客户可以在此处下载最新版本的 ti-sysfw:
    https://git.ti.com/cgit/processor-firmware/ti-linux-firmware/commit/?h=ti-linux-firmware&id=ddc544aaff0f289ad9cfc07d619f686c203a38e7

    此问题已在新的 SYSFW 代码中修复。 如果您要对 DM R5F 进行编程、则可以继续使用基于 SDK 9.2.1或 SDK 10.0 MCU+ SDK 的 DM R5F 代码。