Extra bit when using native slave select on imx6

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

Extra bit when using native slave select on imx6

956 Views
abhinandanbr
Contributor I

I am using native cs pins for SPI master configuration as below:

&ecspi2 {
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ecspi2>;
        fsl,spi-num-chipselects = <2>;
                cs-gpios = <0>, <0>;
        dmas = <&sdma 5 7 1>, <&sdma 6 7 2>;
        dma-names = "rx", "tx";
        status = "okay";

}

pinctrl_ecspi2: ecspi2grp {
                                fsl,pins = <
                                                MX6QDL_PAD_EIM_CS0__ECSPI2_SCLK                0x100b1
                                                MX6QDL_PAD_EIM_OE__ECSPI2_MISO                 0x100b1
                                                MX6QDL_PAD_EIM_CS1__ECSPI2_MOSI                               0x100b1
                                                MX6QDL_PAD_EIM_RW__ECSPI2_SS0                   0x100b9
                                                MX6QDL_PAD_EIM_LBA__ECSPI2_SS1                   0x100b9
                                >;
                };

I see that when I'm using native cs pins I see 1 bit data after every word read/write transfer.

Example: if I send 0x40,0x40,0x0. On the slave, the data received is 0x40,0x40,0x80.

Similar issue when receiving from slave.

If I use gpio pins as CS, this issue is not seen.

Please let me know if any fix is available for this issue.

I am using yocto bsp PD18.1.0.

0 Kudos
Reply
3 Replies

871 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abhinandan

one can look at below patch and try to integrate it to used bsp

[v4,1/3] spi: imx: GPIO chip select DT property should not be required - Patchwork 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

871 Views
abhinandanbr
Contributor I

Hi Igor,

I tried the patch in spi-imx.c file and see that issue is still there. 

Also in the patch, the comment says that usage of native native CS is not recommended and one should switch to gpio based CS.

Anything else I can try other than ??

Regards,

Abhinandan

0 Kudos
Reply

871 Views
igorpadykov
NXP Employee
NXP Employee

Hi Abhinandan

one can try with linux from nxp source.codeaurora.org/external/imx/linux-imx/

repository

linux-imx - i.MX Linux kernel 

Best regards
igor

0 Kudos
Reply