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:设置 UDMA 驱动程序 CPU 关联性

Guru**** 2398695 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1485803/am6442-setting-udma-driver-cpu-affinity

器件型号:AM6442

工具与软件:

您好!

我目前正在尝试确定如何利用 uDMA 驱动程序设置外设的 CPU 关联。 例如、我想更改 DMA 控制器的中断关联。 默认情况下、关联设置为0x3 (两个 A53内核)、如下所示:

root@phyboard-Electra-am64xx# cat /proc/interrupts

...

30: 5 MSI-INTA 1713152 Level 485c0100.dma-控制器 chan0

...

root@phyboard-Electra-am64xx# cat /proc/irq/30/smp_affinity
3.

root@phyboard-Electra-am64xx# readlink /sys/bus/platform/devices/485c0100.dma-controller/driver
/../../../../bus/platform/drivers/ti-udma

我想更改关联、以便只有 CPU0可以处理 IRQ。 我曾尝试过通过 sysfs 来完成此操作;但是、我会收到以下错误消息:


root@phyboard-Electra-am64xx# echo 1 >/proc/irq/30/smp_affinity [368451.488942]尝试设置 CPU 关联性
-sh: echo:写错误:参数无效

更改 CPU 关联性的推荐方法是什么、这甚至是可行的?

感谢您的帮助!

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

    尊敬的 Jared:

    您是否正在使用最新/当前的 AM64 SDK v10.1? 我们最近改进了 SMP 亲和力的管理方式。 这主要是为了使以太网等用例受益。 您在尝试任何操作时、似乎都可以轻松使用此 SDK。 您能尝试重新创建吗?

    root@am64xx-evm:~# grep '485c0100.dma-controller chan0' /proc/interrupts
     25:       2681          0  MSI-INTA 1713152 Level     485c0100.dma-controller chan0
    
    root@am64xx-evm:~# cat /proc/irq/25/smp_affinity
    3
    
    root@am64xx-evm:~# echo 1 > /proc/irq/25/smp_affinity
    root@am64xx-evm:~# cat /proc/irq/25/smp_affinity
    3
    
    # Not sure why this is needed a second time initially before the value "sticks"
    root@am64xx-evm:~# echo 1 > /proc/irq/25/smp_affinity
    root@am64xx-evm:~# cat /proc/irq/25/smp_affinity
    1
    
    # Further changes will get picked up immediately
    root@am64xx-evm:~# echo 2 > /proc/irq/25/smp_affinity
    root@am64xx-evm:~# cat /proc/irq/25/smp_affinity
    2

    此致、Andreas

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

    尊敬的 Andreas:

    感谢您的快速回复、非常感谢!

    我使用 Yocto 构建我的 AM64映像、我不确定如何确定 Yocto 在构建过程中使用的 SDK 版本。 你知道我可以用什么方法在 Yocto 检查这个吗? 或者、在编译图像后、是否有办法在电路板上检查此问题?  

    再次感谢、

    -贾里德  

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

    尊敬的 Jared:

    [报价 userid="642425" url="~/support/processors-group/processors/f/processors-forum/1485803/am6442-setting-udma-driver-cpu-affinity/5710601 #5710601"]我使用 Yocto 构建我的 AM64映像、但我不确定如何确定 Yocto 在构建过程中使用的 SDK 版本。

    在我们的软件堆栈的典型"客户采用流程"中、您可以启动并分叉特定版本的 SDK 或关联的 Yocto 树、然后从上面进行自定义。 因此、在某种意义上、fork-point 将成为您的"SDK 基本版本"。

    由于设置 SMP 关联性的功能几乎肯定取决于您使用的内核版本(以及它具有的修补程序等)、因此我们只需查看该特定 BSP 层的版本历史记录。

    在我的系统上、下面是我针对当前设置的内容获取的内容、作为示例来说明该过程(注意:这不是我之前用于演示该功能的内容;因此、我使用并对直接从 TI.com 下载的 SDK v10.1映像进行了编程、而不是 v10.0)。

    a0797059@jiji:~/tisdk/am64xx-evm (master)
    $ git -C sources/meta-ti/ log --oneline -1
    13807734 (HEAD, tag: cicd.scarthgap.202407301155, tag: cicd.scarthgap.202407271443, tag: 10.00.07) CI/CD Auto-Merger: cicd.scarthgap.202407271443

    您可以看到版本标签  10.00.07. Git 日志中。

    此致、Andreas

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

    尊敬的 Andreas:

    在 Phytec (我正在使用他们的 SOM)来回走动后、我能够确定 IRQ 修复程序没有包含在 Yocto 构建中。 我继续在发行版层内修补 Linux、这些修补程序确实解决了 IRQ 关联问题。 感谢您为我介绍此解决方案、并感谢实施更改的开发人员。

    对于任何处于类似情况的人、在 PROCESSOR-SDK-LINUX/ti-LINUX-6.12.y 上的两个相关提交是:

    • 3228d92e89e5待定:irqchip:irq-ti-sci-inta:引入 IRQ 关联性支持  
    • b73f2b8dd225 pending:irqchip:irq-ti-sci-inta:必要时不要聚合事件

    再次感谢、

    Jared