UART DMA issues

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

UART DMA issues

1,833 Views
davidhassett123
Contributor I

Using Linux 4.9 I have the following symptom with all Uarts on imx6q

Sending  data to serial port and reading back through a loopback will not

return characters unless this entry is made in the dts file

&uart3 {    status = "okay";    dma-names = "", "tx"; };
Why is  dma-names = "", "tx" necessary to make the serial port work? 
0 Kudos
3 Replies

1,283 Views
davidhassett123
Contributor I

Hello

Thank you so much for your reply. We are using mainline kernel 4.9

I see this entry in our im6ql.dtsi file

dma_apbh: dma-apbh@00110000 {                         compatible = "fsl,imx6q-dma-apbh", "fsl,imx28-dma-apbh";                         reg = <0x00110000 0x2000>;                         interrupts = <0 13 IRQ_TYPE_LEVEL_HIGH>,                                      <0 13 IRQ_TYPE_LEVEL_HIGH>,                                      <0 13 IRQ_TYPE_LEVEL_HIGH>,                                      <0 13 IRQ_TYPE_LEVEL_HIGH>;                         interrupt-names = "gpmi0", "gpmi1", "gpmi2", "gpmi3";                         #dma-cells = <1>;                         dma-channels = <4>;                         clocks = <&clks IMX6QDL_CLK_APBH_DMA>;                 };
This is the router instance?
                       uart4: serial@021f0000 {                                 compatible = "fsl,imx6q-uart", "fsl,imx21-uart";                                 reg = <0x021f0000 0x4000>;                                 interrupts = <0 29 IRQ_TYPE_LEVEL_HIGH>;                                 clocks = <&clks IMX6QDL_CLK_UART_IPG>,                                          <&clks IMX6QDL_CLK_UART_SERIAL>;                                 clock-names = "ipg", "per";                                 dmas = <&sdma 31 4 0>, <&sdma 32 4 0>;                                 dma-names = "rx", "tx";                                 status = "disabled";                         };

This is the serial client?

I can only characters if I put this entry in my main dts file

           dma-names = "", "tx";

Without this entry I get an empty buffer back

This test was done with the rx and tx lines looped back

DMA On

dma-names = "rx", "tx";

Device Name /dev/ser4
dddddddddddddfffgfhgjhgfhjgfhgfh
Wrote 32
Read 32
0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0
dma-names = "","tx";
DMA off
Device Name /dev/ser4
dddddddddddddfffgfhgjhgfhjgfhgfh
Wrote 32
Read 32 dddddddddddddfffgfhgjhgfhjgfhgfh

Is there an updated dtsi file for 4.9 kernel?

Thanks

0 Kudos

1,283 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello  David Hassett,

I would recommend switching to NXP’s 4.9.11 BSP Kernel instead of mainline, as this kernel has all the necessary changes to work correctly with NXP’s supported processors. Unfortunately there is not an individual patch I can point you to that will update the device tree include file.

My apologies for the inconvenience.

Regards,

0 Kudos

1,283 Views
gusarambula
NXP TechSupport
NXP TechSupport

Hello  David Hassett,

Would you please let us know if you are you using the L4.9.11 BSP Release or Mainline 4.9 Kernel?

The dma-names should be declared for both rx and tx to work correctly as the driver uses dma to handle the UART operation.

There are some details on how the DMA controller and requests are hanlded on the following document:

https://www.kernel.org/doc/Documentation/devicetree/bindings/dma/dma.txt

I hope this helps,

Regards,

0 Kudos