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.

66AK2G12: DMA channels in Linux SDK

Part Number: 66AK2G12

Hi,

My customer is trying to develop kernel module under below environment.

Code Composer Studio ver.10.4.0.00006
SDK: ti-processor-sdk-linux-rt-k2g-evm-06.03.00.106
Board: K2GEVM
Processor: Cortex-A15

Now he has a few questions.
Q1) He used below command to check available DMA channels.
ls -l /sys/class/dma/
Then, he found below channels.
(a) dma0chan0 to dma0chan59
(b) dma1chan0 to dma1chan3
(c) dma2chan0 to dma2chna63

There are two EDMA inside K2G, EDMA_ 0 and EDMA_1. 
How above (a), (b) and (c) are mapped to each EDMA_n?
EDMA_0 = (a) and (b) ?
EDMA_1 = (c) ?

Q2) He tried Test module "dmatest".
https://www.kernel.org/doc/html/v4.19/driver-api/dmaengine/dmatest.html

Only above (b) completes the transfer.
For other channels (a) and (c), test was started, but could not complete transfer.
Any configuration (device tree, etc.) is missing for the test?

Q3) The customer wants to debug kernel module with CCS.
Any document/guideline available?
I found there are a few training videos recommended in below E2E for AM335x.
https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1028376/tmdssk3358-how-to-use-usb-jtag-in-ccs

Do we have similar information for K2G or these videos are applicable for K2G as well?

Thanks and regards,
Koichiro Tashiro

  • Hi Tashiro-san,

    /sys/class/dma/ entries expose kernel DMA information to user space, developing a kernel module is purely a kernel thing, they shouldn't be looking at /sys/class/dma.

    You could connect CCS to Linux via JTAG, but it is not recommended for kernel development or debugging, because CCS is not Linux aware, so the usefulness of CCS in Linux is very limited.

  • Hi Bin,

    Thanks for your reply.

    they shouldn't be looking at /sys/class/dma.

    Could you tell me what should be looked instead?

    You could connect CCS to Linux via JTAG, but it is not recommended for kernel development or debugging, because CCS is not Linux aware, so the usefulness of CCS in Linux is very limited.

    What is recommended way for kernel debug?

    Thanks and regards,
    Koichiro Tashiro

  • Hi Tashiro-san,

    The edma resource/channels are managed by DMA Engine in Linux kernel, other driver modules should use DMA Engine API to request and use DMA channels. Please refer to kernel DMA Engine documentation for details <kernel src>/Documentation/driver-api/dmaengine/.

    There are many ways to debug kernel, mainly to retrieve a kernel runtime log, from simplest printk, to complex tools to kernel debug infrastructure, such as ftrace. Please check the following kernel debug training series if it is helpful.

    training.ti.com/intro-to-debug-embedded-linux-training-series