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.

[参考译文] AM6442:Am64x:使用 CDev 驱动程序替换 dma_buff_phys 问题

Guru**** 2587345 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1575112/am6442-am64x-issue-replacement-of-dma_buff_phys-with-cdev-driver

器件型号:AM6442


工具/软件:

您好的团队、

我尝试使用远程内核[RF51_0]和 Linux [A53 内核]之间的共享存储器。 最初、我们在 SDK 9.2.1.10 中使用了 dma_buf_phys 驱动程序。 现在我们转到 Processor SDK 11.01.05.03、发现用 remoteproc CDev 驱动程序替换了 dma_buff_phy。

远程核心详细信息:r5F1_0

当我尝试使用 zerocopy 中的示例时,我发现了以下观察。

当我检查/dev/时、我发现了以下内容  

对于 r5F1_0、我引用的 rproc id 为 4

是否需要进行任何更改。

如何进一步使用 A53 和远程内核之间的共享存储器

谢谢您、

Mamatha B M.  

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

    您好、域专家在接下来的几天内不在办公室。 请期待响应延迟。  

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

    尊敬的 Bin:

     我希望该领域专家现在就可以了。

      是否有任何关于此问题的更新、因为我们希望尽早解决此问题。  

    谢谢你

    Mamatha B M.  

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

    对于将来的读者、Mamatha 使用 rpmsg_char_zerocopy 项目作为起点:
    https://git.ti.com/cgit/rpmsg/rpmsg_char_zerocopy/

    您好、Mamatha、

    嗯。 它看起来函数“dmabuf_heap_alloc"通过“通过采用 rproc_id 并将其放在 “/dev/remoteproc %d“的末尾来形成 rproc_name
    https://git.ti.com/cgit/rpmsg/rpmsg_char_zerocopy/tree/linux/src rpmsg_char_zerocopy.c 

    /* Allocate dma-buf from dma-heap, mmap locally, get the phys address
     * and setup the buffer data we want to pass to the remote endpoint
     * in ipc_buf and the local data we want to keep in local_buf.
     */
    int dmabuf_heap_alloc(int rproc_id, int dma_heap_fd, int size,
    		       struct local_buf *lbuf,
    		       struct ipc_buf *ibuf)
    {
    ...
    	sprintf(rproc_name, "/dev/remoteproc%d", rproc_id);
    	rproc_fd = open(rproc_name, O_RDONLY | O_CLOEXEC);
    	if (rproc_fd < 0) {
    		printf("Failed to open %s: -%d\n", rproc_name, errno);
    		return -1;
    	}

    但这不是代码运行方式、因为 rproc_id 是每个内核的固定值。 另一方面、/dev/remoteprocX 不是一个固定值。 X 值按首先初始化内核的顺序分配、这意味着与特定 remoteprocX 编号关联的内核实际上可以在每次引导时更改。

    我们可以查看 函数_rpmsg_char_find_rproc () 作为引用。 rproc_id 用于查找正确的 remoteprocX 实例、它 设置 ept->remoteproc_id == X
    https://git.ti.com/cgit/rpmsg/ti-rpmsg-char/tree/src rpmsg_char.c 

    请尝试修改 rpmsg_char_zerocopy > dmabuf_heap_alloc、使其看起来像_rpmsg_char_find_rproc ()。 请告诉我这是否有效、如果可以、我将用新代码更新 zerocopy 项目。

    此致、

    Nick

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

    您好、Nick、

      我按照您的建议进行了更改,即使用 _rpmsg_char_find_rproc () API 获取详细信息 remoteprocX 值。 我能够继续前进。

    谢谢您、

    Mamatha B M.  

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

    您好、Mamatha、

    感谢您 报告错误、并确认您能够继续! 我已经提交了一个错误报告、因此我们确保在将来循环并修复此代码。

    此致、

    Nick