Using ecspi5 on i.MX6 SoloX

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

Using ecspi5 on i.MX6 SoloX

Jump to solution
1,158 Views
donghyunkim
Contributor III

Hi,

I try to use ecspi5 on the i.MX6soloX board.

&flexcan1 {
    status = "disabled";
};

&flexcan2 {
    status = "disabled";
};

&qspi1 {
    status = "disabled";
};

&qspi2 {
    status = "disabled";
};

&ecspi5 {
#if 0
    pinctrl-names = "default";
    pinctrl-0 = <&pinctrl_ecspi5_1>;
#endif

#if 0

    spi-slave;

#endif
    status = "okay";
};

&iomuxc {
    ecspi5 {
        pinctrl_ecspi5_1: ecspi5grp-1 {
            fsl,pins = <
                MX6SX_PAD_QSPI1A_SS1_B__ECSPI5_MISO 0x100b1????
                MX6SX_PAD_QSPI1A_DQS__ECSPI5_MOSI 0x100b1????
                MX6SX_PAD_QSPI1B_SS1_B__ECSPI5_SCLK 0x100b1????
                MX6SX_PAD_QSPI1B_DQS__ECSPI5_SS0 0x100b1????
            >;
        };
    };
};

1. question. spi devices are not retrieved on /dev. How do I create it?

root@imx6sxsabresd:~# ls -al /dev/spi*
ls: cannot access '/dev/spi*': No such file or directory
root@imx6sxsabresd:~# dmesg | grep spi
[ 1.054004] spi_imx 228c000.ecspi: dma setup error -19, use pio
[ 1.058943] spi_imx 228c000.ecspi: probed
root@imx6sxsabresd:~# ls -al /sys/bus/platform/drivers/spi_imx/228c000.ecspi
lrwxrwxrwx 1 root root 0 Jun 23 08:35 /sys/bus/platform/drivers/spi_imx/228c000.ecspi -> ../../../../devices/soc0/soc/2200000.aips-bus/228c000.ecspi
root@imx6sxsabresd:~# ls -al /sys/devices/soc0/soc/2200000.aips-bus/228c000.ecspi
total 0
drwxr-xr-x 4 root root 0 Jun 23 07:48 .
drwxr-xr-x 13 root root 0 Jun 23 07:48 ..
lrwxrwxrwx 1 root root 0 Jun 23 08:35 driver -> ../../../../../bus/platform/drivers/spi_imx
-rw-r--r-- 1 root root 4096 Jun 23 08:35 driver_override
-r--r--r-- 1 root root 4096 Jun 23 08:35 modalias
lrwxrwxrwx 1 root root 0 Jun 23 08:35 of_node -> ../../../../../firmware/devicetree/base/soc/aips-bus@02200000/ecspi@0228c000
drwxr-xr-x 2 root root 0 Jun 23 08:34 power
drwxr-xr-x 3 root root 0 Jun 23 07:48 spi_master
lrwxrwxrwx 1 root root 0 Jun 23 07:48 subsystem -> ../../../../../bus/platform
-rw-r--r-- 1 root root 4096 Jun 23 07:48 uevent
root@imx6sxsabresd:~#

2. question. What value should each pin set on iomuxc? (there is no xml for i.mx6sx in iomuxtool)

3. question. How do I change to slave mode? Is there anything else I need to add besides "spi-slave;"?

4. question. Can I get the *.mex file of MCIMX6S and MXIMX6SX sabred board for config tool?

Please answer.

Thanks.

Labels (1)
Tags (3)
1 Solution
1,099 Views
igorpadykov
NXP Employee
NXP Employee
3 Replies
1,099 Views
igorpadykov
NXP Employee
NXP Employee

Hi DongHyun

1.2. one can look at ecspi4 configuration and make similar changes for ecspi5

imx6sx-19x19-arm2.dts\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

>3. question. How do I change to slave mode?

please check example on

imx6ul-14x14-evk-ecspi-slave.dts\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

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

0 Kudos
1,099 Views
donghyunkim
Contributor III

Hi, igorpadykov

Thank you for your reply.

In the example in answer 3, remove the spidev0("/delete-node/&spidev0;").
This does not create a spi device in /dev in the slave.

Is there an example of spi device being created in /dev in slave mode?

Thanks.

0 Kudos
1,100 Views
igorpadykov
NXP Employee
NXP Employee

may be useful to check

Linux kernel Controller as SPI slave - Stack Overflow 

Best regards
igor