Forums - SPI DMA on mdm9628

1 post / 0 new
SPI DMA on mdm9628
khainguyen
Join Date: 17 Jan 18
Posts: 1
Posted: Thu, 2018-01-18 22:46

Hi All,

I am a newbie for Qualcom chip

I am working on a Snapdragon MDM9628 SPI using DMA to transfer data. 

I have a issue with SPI DMA configuration. 

I am using SPI2 and my SPI configuration in device tree is identical to spi_2 in below link:

https://android.googlesource.com/kernel/msm.git/+/android-7.1.0_r0.3/arc...

spi_2: spi@78B6000 { /* BLSP1 QUP2 */
        compatible = "qcom,spi-qup-v2";
        #address-cells = <1>;
        #size-cells = <0>;
        reg-names = "spi_physical", "spi_bam_physical";
        reg = <0x78B6000 0x600>,
        <0x7884000 0x23000>;
        interrupt-names = "spi_irq", "spi_bam_irq";
        interrupts = <0 96 0>, <0 238 0>;
        spi-max-frequency = <19200000>;
        qcom,use-bam;
        qcom,ver-reg-exists;
        qcom,bam-consumer-pipe-index = <10>;
        qcom,bam-producer-pipe-index = <11>;
        qcom,master-id = <86>;
        qcom,use-pinctrl;
        pinctrl-names = "spi_default", "spi_sleep";
        pinctrl-0 = <&spi_2_active>;
        pinctrl-1 = <&spi_2_sleep>;
        clock-names = "iface_clk", "core_clk";
        clocks = <&clock_gcc clk_gcc_blsp1_ahb_clk>,
        <&clock_gcc clk_gcc_blsp1_qup2_spi_apps_clk>;
        status = "disabled";
    };

And in SPI linux kernel driver , I set DMA mask bit for SPI

    // test device dma mask and prepare for buffer alloc
    if (dma_set_mask(m_prot->dev, DMA_BIT_MASK(32))!=0){
        printk(KERN_ALERT "SPI protocol: cannot set DMA bit mask\n");
    }
    if (dma_set_coherent_mask(m_prot->dev, DMA_BIT_MASK(32))!=0){
        printk(KERN_ALERT "SPI protocol: cannot set coherent mask\n");
    }
 
And the issue is that I hit the alert : cannot set DMA bit mask
I am sure of that :
    -    my driver is mapped to correct device
    -    my driver probe function is called by kernel
    -    my device and linux version is 32bit
 
Is there any missings for SPI DMA configuration in device tree ???
  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.