IMX6ULL ECSPI4 DMA TX Error

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX6ULL ECSPI4 DMA TX Error

243 Views
almaz1c
Contributor III

Hello.

Having some IMX6ULL based custom hardware. It communicates with SPI device using ECSPI2. Here is working dts:

 

 

&ecspi2 {
	fsl,spi-num-chipselects = <1>;
	cs-gpios = <&gpio4 22 0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi2_0>;
	status = "okay"; 

	dma-names = "rx", "tx";
	dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;

	spidev0: spidev@1 {
		status = "okay";
		compatible = "semtech,sx1301";
		spi-max-frequency = <1000000>;
		reg = <0>;
	};
};

 

 

and

 

 

		pinctrl_ecspi2_0: ecspi2grp-0 {
			fsl,pins = <
				MX6UL_PAD_CSI_DATA02__ECSPI2_MOSI 0x110b1
				MX6UL_PAD_CSI_DATA03__ECSPI2_MISO 0x110b1
				MX6UL_PAD_CSI_DATA00__ECSPI2_SCLK 0x110b1
				MX6UL_PAD_CSI_DATA01__GPIO4_IO22 0x10b0
			>;
		};

 

 

Everything works like a charm.

Now I am trying to move this hardware to ECSPI4:

 

&ecspi4 {
        fsl,spi-num-chipselects = <1>;
        cs-gpios = <&gpio4 9 0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ecspi4_0>;
        status = "okay";

        dma-names = "rx", "tx";
        dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;

        spidev0: spidev@1 {
                status = "okay";
                compatible = "semtech,sx1301";
                spi-max-frequency = <1000000>;
                reg = <0>;
        };
};

 

and:

 

 

                pinctrl_ecspi4_0: ecspi4grp-0 {
                        fsl,pins = <
                                MX6UL_PAD_NAND_DATA05__ECSPI4_MOSI 0x110b1
                                MX6UL_PAD_NAND_DATA06__ECSPI4_MISO 0x110b1
                                MX6UL_PAD_NAND_DATA04__ECSPI4_SCLK 0x110b1
                                MX6UL_PAD_NAND_DATA07__GPIO4_IO09  0x10b0
                        >;
                };

 

 

Now trying to test it:

 

 

root@OpenWrt:/# spidev_test -D /dev/spidev3.0
spi mode: 0x0
bits per word: 8
max speed: 500000 Hz (500 KHz)
[  167.763338] spi_imx 2014000.ecspi: I/O Error in DMA TX
[  167.770578] spidev spi3.0: SPI transfer failed: -110
[  167.775678] spi_master spi3: failed to transfer one message from queue
can't send spi message: Operation timed out
Aborted

 

 

 

So probably something wrong with this field:

 

 

        dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;

 

I copied it as is from working ECSPI2 based dts. What are the magic numbers must be used here? 

 

EDIT:

Seems that first digit in each sdma element is SDMA event number from Table 3-2 IMX6ULLRM. What is rest two digits?

0 Kudos
0 Replies