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.

[参考译文] DRA712:visonSDK 0304 Early Boot:如何在 Linux 和 RTOS 之间共享 EDMA 通道

Guru**** 2540720 points


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

https://e2e.ti.com/support/processors-group/processors/f/processors-forum/912121/dra712-visonsdk-0304-early-boot-how-to-share-edma-channel-between-linux-and-rtos

器件型号:DRA712

各位专家、您好!

现在、我解决了一个问题、即 EDMA 通道无法在 Linux 和 RTOS 上共享。

我的板 SOC 是 DRA711、我们在 IPU2上成功进行了 VisionSDK0304耳启动。  

内核 DTS 具有以下配置:

/* Linux 使用前32个通道,BIOS 使用后32个*/
EDMA{(&E)
      DMA 请求=<32>;
};

这意味着 Linux 使用前32个通道(0~31)、RTOS 使用最后一个通道(32~63)。

如果在 Linux 内核的 omap_hwmod_7xx_data.c 中启用以下模块,则在 IPU2端,EDMA 无法工作,在 Utils_dmaCopy2D()函数处阻止。 Linux 端 EDMA 可以正常工作

静态结构 omap_hwmod_opc_if *dra7xx_hwmod_opc_ifs[]__initdata ={

。。。μ A

 &dra7xx_L4_cfg_DMA_SYSTEM、
 &dra7xx_L3_MAIN_1_tpcc、
 &dra7xx_L3_MAIN_1__tptc0、
 &dra7xx_L3_main_1__tptc1、

。。。μ A

};

但是、如果我禁用上一个模块、则 IPU2侧可以使用 EDMA 通道32来传输数据、但在 Linux 侧 EDMA 无法正常工作。 内核日志如下所示:

[0.211235]   EDMA3-tptc 43400000。tptc:_od_fail_runtime_resume:FIXME:缺少 hwmod/OMA_dev 信息
[0.211294]   EDMA3-tptc 43500000。tptc:_od_failure_runtime_resume:FIXME:缺少 hwmod/OMA_dev 信息
[0.211492]   EDMA 43300000。EDMA:_od_fail_runtime_resume:FIXME:缺少 hwmod/OMA_dev 信息
[0.211502]   EDMA 43300000。EDMA:Pm_runtime_get_sync()失败

有人能帮我解决这个问题吗?  

我查找此帖子:  

但也无法解决此问题。

因为在完全启动时、EDMA 时钟已经在 IPU2侧启用。 那么、如何在内核方面禁用 EDMA 时钟设置呢?

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

    您是否尝试恢复内核上的修补程序
    0002-arm-mach-omap2-Remove-edma-related -nodes-from -hwmod-.patch?

    您是否看到此问题仅在早期启动后附加用例中重现?

    谢谢
    RamPrasad

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

    尊敬的 RamPrasad:

    根据 0002-arm-mach-omap2-remove-edma-related nodes-from -hwmod-.patch、它删除了 EDMA Related HW 模块。  

    这在 A15侧 EDMA 上无法正常工作。  

    删除了与硬件模块相关的 EDMA、我认为 EDMA 不能在 A15端用于和案例。

    此致!

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

    大家好、 Fanok。  

    感谢您引用我的主题。

    您不会 在内核中禁用 EDMA、而是会旁路复位/空闲/设置 EDMA (在 IPU 中使用)的任何内容。 请 参阅此处

    下面是我尝试过的补丁、但测试结果仍然失败

    这个问题困扰了我很长时间,我仍然在挣扎。

    索引:src/arch/arm/mach-omap2/omap_hwmod.c

    ===================================================================================================================================
    --src/arch/arm/mach-omap2/omap_hwmod.c(修订版76059)
    +++ src/arch/arm/mach-omap2/omap_hwmod.c(工作副本)
    @@-1582,6+1582,14 @@
    {
    int tret =0;
    
    ++
    if (strcmp (oh->name,"tpt0|"=0")|tctrt
    (strcmp (oh->name、"tptc1")==0)
    +{
    +printk ("%s"的 skiping 名称%s\n"、__func__、oh->name);
    +返回0;
    +}
    +
    IF (oh->_state!=_HWMOD_State_Registered)
    返回0;
    
    @@-1653、6 +1661、13 @@
    if (!oh)
    返回-EINVAL;
    
    + if (strcmp (oh->name、"tptc0")=0)||
    +(strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    +返回0;
    +}
    +
    IF (!soc_ops.assert_hardreset)
    返回-ENOSYS;
    
    @@-1686,6+1701,14 @@
    if (!oh)
    返回-EINVAL;
    
    +
    if (strcmp (oh->name、"tptc0")=0)||
    +(strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    +返回0;
    +}
    +
    IF (!soc_ops.deassert_hardreset)
    返回-ENOSYS;
    
    @@-2081,6 +2104,13 @@
    {
    int r;
    
    + if (strcmp (oh->name、"tptc0")==0)||
    +(strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    +return 0;
    +}
    +
    pr_debug("omap_hwmod:%s:启用\n"、oh->name);
    
    /*
    @@-2202、9 +2232、17 @@
    oh->_int_FLAGS |=_HWMOD_SKIP_ENABLE;
    return 0;
    }
    
    -+
    pr_debug ("omap_hwmod:%s:闲置\n"t
    
    
    )+ t (t)+ t = 0+ t)、t = t (t)+ t (t)+ t (t)
    (strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    + 返回0;+}+
    
    
    如果(_are _all_hardreset_LINes_asserted (oh))
    返回0;
    
    @@-2698、6 +2736、13 @@
    */
    static int _init _setup (strt omap_hwmod * oh、void * data)
    {
    + if (strcmp (oh->name、"tptc0")= 0)||
    (strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    + 返回0;+}+
    
    
    
    
    
    @@(oh->_state!=_HWMOD_State_Initialized)返回0;@@-3109,6 +3154,14
    if (!oh->clkdm)
    返回-EINVAL;
    
    +
    if (strcmp (oh->name、"tptc0")==0)||
    +(strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    +返回0;
    +}
    +
    返回 OMAP-PRM_IS _hardreset_assert_asserted (ohri->rst_shift、
    OH->clkdm->pwrdm.ptr->
    prcm_partition、
    @@-4107、6 +4160、13 @@
    {
    int i;
    
    + if (strcmp (oh->name、"tptc0")==0)||
    +(strcmp (oh->name、"tptc1")=0)
    )+{
    +printk("%s skiping name of %s\n",__func_, oh->name);
    +如果
    
    
    
    (o->rst_LINES[I].context)
    _assert_hardreset (oh、o->rst_LINES_cnt;i++)_assert_hardreset (oh、o->rst_LINES[I].name)、则返回0;+}+; 

    此致、Wen

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

    大家好、

    感谢您的回复、您是否附加 了 src/arch/arm/mach-omap2/omap_hwmod.c 的补丁可以解决该问题?

    此致!

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

    大家好、 Fanok。

     它是非常糟糕的补丁、 但遗憾的是不是

    我还在挣扎。

    此致、Wen

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

    大家好、范文:

    请尝试以下方法:

    • 恢复修补 程序0002-arm-mach-omap2-Remove-edma-related-nodes-from -hwmod-.patch

    • 在 uboot 中(如果 uboot 存在):arch/arm/cpU/armv7/omap5/hw_data.c (确切文件)

    
    

    • 在内核 DTS 中(请在 DTS 中找到 EDMA 设置)

    可以找到上述内容。

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

    您好、 Peter

    我 已应用补丁并检查系统中的设备树:

    /sys/firmware/devicetree/base/ocp/edma@43300000 # ls
    dma-cells dma-requests 中断名称 reg ti、hwmods ti、no-reset-on-init
    兼容的中断名称 linux、phandle phandle reg-names ti、no-idle-on-init ti、tptcs

    /sys/firmware/devicetree/base/ocp/tptc@43400000 # ls
    兼容的中断名称中断 linux、phandle name phandle reg ti、hwmods ti、no-idle-on-init ti、no-reset-on-init

    /sys/firmware/devicetree/base/ocp/tptc@43500000 # ls
    兼容的中断名称中断 linux、phandle name phandle reg ti、hwmods ti、no-idle-on-init ti、no-reset-on-init

    但遗憾的是、测试结果失败了。

     

    此致、Wen

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

    大家好、

    我修复了问题、EDMA 在 A15和 M4侧都能正常工作。 我可以与您共享该补丁:

    diff --git a/drivers/dma/ti/edma.c b/drivers/dma/ti/edma.c
    旧模式100644
    新模式100755
    索引2fa50a4.50031
    -- a/drivers/dma/ti/edma.c
    ++ b/drivers/dma/ti/edma.c
    @@-2198、6 +2198、7 @@静态 int EDMA_probe (struct platform_device *pdev)
           struct EDMA_cc         *ecc;
           bool                   legacy_mode = true;
           内转台;
    +      u32 num_channels = 0;
           if (node){
                   const struct of _device_id *匹配;
    @@-2258,6+2259,17 @@静态 int EDMA_probe (struct platform_device *pdev)
           IF (RET)
                   回程;
    /*      DMA 请求的通道数*/
    +      IF (pdev->dev.for_node && of _property_read_u32 (pdev->dev.for_node、
    +                                                    "DMA 请求"、
    +                                                    num_channels)){
    +              dev_err (&pdev->dev、"缺少 dma-requests 属性。 使用:%u\n"、ecc->num_channels);
    +      }
    +      else{
    +              dev_dbg (&pdev->dev、"EDMA 请求通道:%d\n"、num_channels);
    +              ecc->num_channels = num_channels;
    +      }
    +
           /*根据我们从 IP 获得的信息分配内存*/
           ecc->slave_chans = devm_kcalloc (dev、ecc->num_channels、
                                           sizeof (* ecc->slave_chans)、gfp_kernel);
    @@-2364,11 +2376,16 @@静态 int EDMA_probe (struct platform_device *pdev)
                   EDMA_assign_priority_TO_queue (ECC、queue_priority_mapping [i][0]、
                                                 queue_priority_mapping [i][1]);
    区域      M 的+//DMA 区域访问使能、因为早期引导 IPU2、EDMA 已经设置好、所以在这里丢弃。
    +/-      EDMA 对于 A15为前32个通道、对于 RTOS 为后32个通道
    +#if 0
           对于(i = 0;i < ecc->num_region;i++){
                   EDMA_WRITE_ARRAY2 (ECC、EDMA_DRAE、I、0、0x0);
                   EDMA_WRITE_ARRAY2 (ECC、EDMA_DRAE、I、1、0x0);
                   EDMA_WRITE_ARRAY (ECC、EDMA_QRAE、I、0x0);
           }
    +#endif
    +
           ecc->info =信息;
           /* Init the DMA device and channels */
    此致!
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

     赞!…