I used imx6qsabread board,can anyone tell me how to use sdma channel to transfer data for uart or give me an example
Hi jingyang,
It looks like common UART has used SDMA to transfer data. You can refer to Appendix A SDMA Scripts in i.MX6RM.Thank you!
Best Regards,
Frank
HI,Frank
thaks for your answer,but I still can't understand usage of sdma for uart,can you give me an example ?
Hi jingyang,
For the SDMA usage of Linux UART driver, you can refer to chapter 47 of i.MX Linux RM. I paste some paragraphs as below.
Each UART can be configured to use DMA for the data transfer by enabling the DMA
channel in the DTS file.
The driver requests two DMA channels for the UARTs that need DMA transfer. On a
receive transaction, the driver copies the data from the DMA receive buffer to the TTY
Flip Buffer
While using DMA to transmit, the driver copies the data from the UART transmit buffer
to the DMA transmit buffer and sends this buffer to the DMA system. For more
information, see the Linux documentation on the serial driver in the kernel source tree.
Also you can check the driver <Yocto_BuildDir>/linux/drivers/tty/serial/imx.c and the related dts file, Thank you!
Best Regards,
Frank
Hi,Frank
I read the chapter and check the driver,the driver supports DMA ,but how can I use this in an application?
could you give me an source code example?
From the application layer, any application doesn't know about the hardware detail including using or not using DMA.
That is why need different layer for software and OS. One application can run under the different platform.
The different is the speed and the CPU loading if it is using or not using DMA.
Hi jingyang,
Per my understanding, if you enable the tx and rx dma channels in the dts file(it should aready be enabled by default), it can enable SDMA support for UART. Do you need the sample code for the sdma mem2mem application? You can refer to https://community.nxp.com/message/862063?commentID=862063#comment-862063
Thank you!
Best Regards,
Frank