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.

Linux/DRA744: DMA supported UART driver

Part Number: DRA744

Tool/software: Linux

We are using DRA74 for our project where we are connected to BT chip through UART interface.

We observed that currently with the legacy omap serial driver on the physical lines we are able to achieve 3Mbps. But DMA is not used for transfer.

We even tried with 8250 based UART driver on the information from  But We cannot observe that DMA is used when we do a transfer of 512-4096  bytes.

We need to use DMA in our project to obtain the performance.

Questions:-

IS DMA enalbed UART driver aviaible for DRA74 ?

IS it validated on the EVM and is there any performance value avaialalble ?

 

  • Hi Ishaqe,
    Unfortunately I cannot answer the main question if there is a driver with DMA.
    However, take into account that UART is slow interface and you will have no benefit from DMA. The only thing is that DMA will unload slightly the main CPU, but this alone will not allow you for higher speeds.
    My main question is what is your target speed? Is it 3Mbps or more? I guess 3 Mbps came from the OMAP where this was the fastest bit rate. DRA74x is now capable for up to 12 Mbps. You can set this in driver easily by applying the appropriate clock dividers (See the TRM).
    And at last, if you need it, setting DMA mode should not be pain to set if you follow the UART programming guide in TRM and the DMA chapter.

    Regards,
    Stan
  • I can see in processors.wiki.ti.com/.../Sitara_Linux_UART_-_Switching_to_8250_Driver there is a mentioned of DMA enabled driver for UART.
    IS this validated by TI in DRA7x ?
    The targetted speed which we are going to use is 3Mbps
  • Since kernel 4.0 8250 is the preferred driver.
    DRA75x has the same UART hardware than AM572x Sitaras, therefore driver should run equally on both.
  • Okay thanks...
    But When we use 8250 driver we are not observing that DMA is used when we do a transfer of 512-4096 bytes.
  • Hi Ishaqe,

    can you just tell which version of the SDK/linux you use?

    Thanks,
    Yordan
  • We are using procesor sdk 3.01 

  • Hi Ishaqe,

    I will forward it to UART experts for comment.

    Regards,
    Yordan
  • Ishaqe,

    8250 UART driver use DMA and can be used with the DRA74x device, see the below links for more info:

    processors.wiki.ti.com/.../DRA7xx_GLSDK_6.10.00.02_Post-release_Updates
    processors.wiki.ti.com/.../DRA7xx_GLSDK_7.02.00.02_Post-release_Updates

    There is one know issue regarding UART-DMA 8250 driver in the latest PSDKLA:

    processors.wiki.ti.com/.../Processor_SDK_Linux_Automotive_Release_Notes
    LCPD-9192

    Regards,
    Pavel
  • Hi Ishaqe,
    UART DMA is enabled by default in latest PSDK-LA 3.02 release.

    If you are not using default configuration then make sure to enable CONFIG_SERIAL_8250_DMA=y

    But I would agree with Stan on the benefit of higher baud rates.
    A point to note, that 12 Mbps may require a few additional changes in the driver and dts files and has not been tested in Linux, yet.

    But once you get it working then you should definitely see a boost in perofmance.

    Regards,
    RK
  • Hi RK,

    Thanks for the information. We have done necessary changes to make DMA working and its working for uarts 1-6.

    Now we have to enable DMA for uart10 for that there is no DMA's assigned in dra7.dtsi and we need to use DMA crossbar mappings.

    So I made modifications like below

    &uart10 {
             status = "okay";
             pinctrl-names = "default";
    +	 dmas = <&edma_xbar 150 0 48>, <&edma_xbar 151 0 49>;
    +	 dma-names = "tx", "rx";
    };
    
    

    After this modification it was expected that the DMA crossbar mapping would work but it didn't. The DMA request was failing.

    We started analyzing and found that certain code/dts modifications needed to make crossbar work.

    I made below modifications to make crossbar work

    diff --git a/arch/arm/boot/dts/dra7.dtsi b/arch/arm/boot/dts/dra7.dtsi
    index 1825a6f..89734a9 100644
    --- a/arch/arm/boot/dts/dra7.dtsi
    +++ b/arch/arm/boot/dts/dra7.dtsi
    @@ -224,7 +224,7 @@
                                    edma_xbar: dma-router@c78 {
                                            compatible = "ti,dra7-dma-crossbar";
                                            reg = <0xc78 0x7c>;
    -                                       #dma-cells = <2>;
    +                                       #dma-cells = <3>;
                                            dma-requests = <204>;
                                            ti,dma-safe-map = <0>;
                                            dma-masters = <&edma>;
    
    diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
    index 8181ed1..0ac144d 100644
    --- a/drivers/dma/edma.c
    +++ b/drivers/dma/edma.c
    @@ -2142,6 +2142,9 @@ static struct dma_chan *of_edma_xlate(struct of_phandle_args *dma_spec,
                    goto out;
            }
     
    +       if (dma_spec->args_count == 3)
    +               goto out;
    +
            return NULL;
     out:
            /* The channel is going to be used as HW synchronized */
    

     After this change it seems DMA mapping fine and working. I verified with UART external loopback.

    Could please check and confirm the above modifications are correct? If not Please let us know right modifications.

    Thanks,

    Vikram

  • Vikram,

    Vikram Rao said:
    + dmas = <&edma_xbar 150 0 48>, <&edma_xbar 151 0 49>;

    I would suggest to check the corresponding registers and see if you have the expected values there.

    CTRL_CORE_DMA_EDMA_DREQ_48_49

    [23:16] DMA_EDMA_DREQ_49 = 0x97 (151) - select UART10_DREQ_RX in place of UART1_DREQ_RX

    [7:0] DMA_EDMA_DREQ_48 = 0x96 (150) - select UART10_DREQ_TX in place of UART1_DREQ_TX

    Also <0> seems to be used only for AM335x EDMA (<0> is the TC the event should be assigned), so you can also try with removing it. See the below file for more info:

    linux-kernel/Documentation/devicetree/bindings/dma/ti-dma-crossbar.txt

    Note that McASP1 DMA events are not mapped by default (same as UART10) to the EDMA controller, the crossbar is:

    DMA_CROSSBAR_128   MCASP1_DREQ_RX

    DMA_CROSSBAR_129  MCASP1_DREQ_TX

    And McASP1 is mapped like below:

    linux-kernel/arch/arm/boot/dts/dra7.dtsi

    mcasp1: mcasp@48460000 {

                dmas = <&edma_xbar 129 1>, <&edma_xbar 128 1>;
                dma-names = "tx", "rx";

    }

    Regards,
    Pavel

  • Hi Pavel,

    Thanks for your suggestion. Today I got chance to verify uart10 dma crossbar mapping and seems it is working.

    logs:

    [  935.115121] ti-dma-crossbar 4a002c78.dma-router: Mapping XBAR151 to DMA0
    [  935.121913] ti-dma-crossbar 4a002c78.dma-router: Mapping XBAR150 to DMA1
    [  935.130928] omap8250 4ae2b000.serial: got both dma channels
    [  935.138427] ti-dma-crossbar 4a002c78.dma-router: Unmapping XBAR151 (was routed to 0)
    [  935.147371] ti-dma-crossbar 4a002c78.dma-router: Unmapping XBAR150 (was routed to 1)
    [  935.156260] omap8250 4ae2b000.serial: dma channels released

    changes:

     &uart10 {
     	status = "okay";
    +	dmas = <&edma_xbar 150 1>, <&edma_xbar 151 1>;
    + 	dma-names = "tx", "rx";
     };

    Thanks,

    Vikram

  • Hi Vikram,

    please press "Verify Answer" button on Pavel's post if your issue is resolved to close the thread.
    (after that you can still write here to reopen it if some issue appear)

    Thanks,
    Yordan