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/AM4372: DMA support in McSPI driver

Part Number: AM4372

Tool/software: Linux

Hi, I have following setup for SPI in the device tree. 

&spi1 {
status = "okay";
ti,spi-num-cs = <2>;
pinctrl-names = "default", "sleep";
pinctrl-0 = <&spi1_pins_default>;
pinctrl-1 = <&spi1_pins_sleep>;
spidev@0 {
compatible = "rohm,dh2228fv";
reg = <0>;
spi-max-frequency = <16000000>;
};
};

in am4372.dtsi

spi1: spi@481a0000 {
compatible = "ti,am4372-mcspi","ti,omap4-mcspi";
reg = <0x481a0000 0x400>;
interrupts = <GIC_SPI 125 IRQ_TYPE_LEVEL_HIGH>;
ti,hwmods = "spi1";
#address-cells = <1>;
#size-cells = <0>;
status = "disabled";
};

The spi1.0 interface is working as I setup loopback connection. I can send and receive data.

But I get  error: spi spi1.0: not using DMA for McSPI (-19) 

How to enable DMA support for SPI1.0 ?

  • Hi Asfak,

    The McSPI driver support DMA by default, check the driver user guide:

    software-dl.ti.com/.../Foundational_Components.html

    You should update your DTS file, add DMA support. Refer to below files for more info:

    linux-4.9.69/Documentation/devicetree/bindings/spi/omap-spi.txt

    linux-4.9.69/arch/arm/boot/dts/am437x-cm-t43.dts

    Regards,
    Pavel
  • Hi Pavel,

    Thank you for the solution. Now DMA is working in SPI interfaces. I will write down the solution for others as a reference.

    Basically, I added dma lines in my dts file. Remember to use correct rx and tx configuration. It should be same as the reg number.

    &spi1 {

    status = "okay";

    ti,spi-num-cs = <2>;

    pinctrl-names = "default", "sleep";

    pinctrl-0 = <&spi1_pins_default>;

    pinctrl-1 = <&spi1_pins_sleep>;

    dmas = <&edma 16 0

    &edma 17 0>;

    dma-names = "tx0", "rx0";

    spidev@0 {

    compatible = "rohm,dh2228fv";

    reg = <0>;

    spi-max-frequency = <16000000>;

    };

    }

    I have one questions though. Where can I find information about  edma 16 0? 

    how do I know which edma number to use?