I used imx6qsabread board,can anyone tell me how to use sdma channel to transfer data for uart or give me an example
It looks like common UART has used SDMA to transfer data. You can refer to Appendix A SDMA Scripts in i.MX6RM.Thank you！
thaks for your answer,but I still can't understand usage of sdma for uart,can you give me an example ?
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 DMAchannel in the DTS file. The driver requests two DMA channels for the UARTs that need DMA transfer. On areceive transaction, the driver copies the data from the DMA receive buffer to the TTYFlip Buffer
While using DMA to transmit, the driver copies the data from the UART transmit bufferto the DMA transmit buffer and sends this buffer to the DMA system. For moreinformation, 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!
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?
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
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.
Retrieving data ...