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.

TDA4VM: Linux UDMA

Part Number: TDA4VM

Hi TI,

PSDK version: 7.0.2.006
Host OS: Ubuntu 18.04

At this stage of development we want to utilize UDMA to speed up data movement.

We did look in to the DMA driver of Linux Kernel (<psdkla>/board-support/linux-5.4.74+gitAUTOINC+9574bba32a-g9574bba32a/drivers/dma/ti),
and we saw that there is UDMA source and Kernel config, specifically this part got our attention:

config TI_K3_UDMA
    tristate "Texas Instruments UDMA support"
    depends on ARCH_K3 || COMPILE_TEST
    depends on TI_SCI_PROTOCOL
    depends on TI_SCI_INTA_IRQCHIP
    select DMA_ENGINE
    select DMA_VIRTUAL_CHANNELS
    select TI_K3_RINGACC
    select TI_K3_PSIL
        help
      Enable support for the TI UDMA (Unified DMA) controller. This
      DMA engine is used in AM65x and j721e.

Does this means if 'TI_K3_UDMA=y' is enabled in kernel config, the UDMA is underlying mechanism of the Linux DMA engine, and whenever we use DMA transfer the UDMA controller will actually be used?

Can you clarify for us is it possible to use UDMA of the Navigator Subsystem (NAVSS hardware) directly from Linux on A72 core to move data internally in Linux space?

Regards.
Uros

  • Hi Uros,

    Yes. This is already enabled in Linux kernel. For example: SA2UL is already using the UDMA:

    mcu_cpsw is also using UDMA:

    Does this means if 'TI_K3_UDMA=y' is enabled in kernel config, the UDMA is underlying mechanism of the Linux DMA engine, and whenever we use DMA transfer the UDMA controller will actually be used?

    That is correct.

    Regards,
    Keerthy

  • Hi Keerthy, thank you for confirming this.

    Is there any example of how to use UDMA in Linux user space to copy from DDR to DDR?

    We looked at the linux mem test in vission apps (<psdkra>/vision_apps/apps/basic_demos/app_mem), and saw that some kind of DMA file descriptor is being used and virtual address is translated. We have a few questions regarding this topic:

    • Can you explain how exactly is DMA FD, and Linux DMA generally, being used in this example?
    • Is UDMA used here when read and write happens in the test?

    What we want to do is being used in this UDMA example in RTOS PDK: pdk_jacinto_07_01_05_14/packages/ti/drv/udma/examples/udma_memcpy_test
    But we want to do something like this in Linux, use UDMA instead of memcopy to offload the A72 core.

    Is something like that possible?

    Regards.
    Uros

  • Hi Uros,

    Unfortunately there isnot any example available on Linux to demonstrate memory copy using UDMA. The example that you are referring above is just used to demonstrate the allocation of memory using OpenVX API appMemAlloc. The OpenVX internally uses standard dma-buf framework for the buffer management and the framework provides interfaces to convert physical address to virtual and vice versa. Here, the buffer is represented by the file descriptor, so the name DMA-FD. This is not related to the UDMA usage... You could refer to https://01.org/linuxgraphics/gfx-docs/drm/driver-api/dma-buf.html, for more information on dma-buf.

    The memcpy example is supported on QNX, but not on the Linux..  

    Regards,

    Brijesh

  • Thank you Brijesh for clarifying this issue for us.

    We will try to implement TIOVX graph to instance UDMA data handling in DDR between Linux and RTOS.

    Regards.
    Uros

  • Thanks Uros, i am closing this ticket. Please start new ticket for further/new questions.