dts: configure SPI

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

dts: configure SPI

2,459 Views
BrilliantovKiri
Senior Contributor I

Hello!

I work with custom iMX287 CPU board.

On board device connected to SSP2_MOSI, SSP2_SCK and SSP2_CS1, follow my code in dts-file:

apb@80000000 {

    apbh@80000000 {

        ssp0: ssp@80010000 {

                compatible = "fsl,imx28-mmc";

                pinctrl-names = "default";

                pinctrl-0 = <&mmc0_4bit_pins_a

                        &mmc0_cd_cfg

                        &mmc0_sck_cfg

                >;

                bus-width = <4>;

                status = "okay";

        };

        ssp2: ssp@80014000 {

                #address-cells = <1>;

                #size-cells = <0>;

                compatible = "fsl,imx28-spi";

                pinctrl-names = "default";

                pinctrl-0 = <&spi2_pins>;

                status = "okay";

                spi2_pins: spi2@0 {

                    reg = <0>;

                    fsl,pinmux-ids = <

                        MX28_PAD_SSP2_SCK__SSP2_SCK

                        MX28_PAD_SSP2_MOSI__SSP2_CMD

                        /* SSP2_CS1 */

                        MX28_PAD_SSP2_SS1__SSP2_D4

                    >;

                    fsl,drive-strength = <MXS_DRIVE_8mA>;

                    fsl,voltage = <MXS_VOLTAGE_HIGH>;

                    fsl,pull-up = <MXS_PULL_ENABLE>;

                };

        };

};

Unforunately spidev not present, linux log contained this - spi_master spi1: cannot find modalias for /apb@80000000/apbh@80000000/ssp@80014000/spi2@0

I not understand this message, why spi1 can't found modalis if I not use spi1?

Can you help me?

Thank you and excuse my bad english.

Labels (2)
Tags (3)
0 Kudos
6 Replies

1,538 Views
BrilliantovKiri
Senior Contributor I

apbh@80000000 {

    ssp2: ssp@80014000 {

                #address-cells = <1>;

                #size-cells = <0>;

                compatible = "fsl,imx28-spi";

                pinctrl-names = "default";

                pinctrl-0 = <&spi2_pins>;

                status = "okay";

                dm631@0 {

                    reg = <0>;

                    compatible = "spidev";

                    spi-max-frequency = <10000000>;

                };

            };

    pinctrl@80018000 {

        spi2_pins: spi2_pins@0 {

                    reg = <0>;

                    fsl,pinmux-ids = <

                        MX28_PAD_SSP2_SCK__SSP2_SCK

                        MX28_PAD_SSP2_MOSI__SSP2_CMD

                        /* SSP2_CS1 */

                        MX28_PAD_SSP2_SS1__SSP2_D4

                    >;

                    fsl,drive-strength = <MXS_DRIVE_8mA>;

                    fsl,voltage = <MXS_VOLTAGE_HIGH>;

                    fsl,pull-up = <MXS_PULL_ENABLE>;

                };

    };

};

0 Kudos

1,538 Views
BrilliantovKiri
Senior Contributor I

Ok, I move SSP2 pins description to pinctrl@80018000 sections and this solve problem.

Unfortunately /dev/spidev is not present.

0 Kudos

1,539 Views
lategoodbye
Senior Contributor I

Hi Kirill,

did you specify spidev as a SPI slave of ssp2 in devicetree?

1,539 Views
BrilliantovKiri
Senior Contributor I

Hello, Stefan!

Can you share example or link on example?

0 Kudos

1,539 Views
csotoalonso
Contributor III

Just to make sure... Do you have spidev support in your kernel? If you have it as a module, you should load the module. Try modprobe spidev and see what happens.

0 Kudos

1,539 Views
BrilliantovKiri
Senior Contributor I

Hello, Carlos!

I embedded SPI support to linux:

$ grep SPI .config | grep -v \#

CONFIG_SPI=y

CONFIG_SPI_MASTER=y

CONFIG_SPI_MXS=y

CONFIG_SPI_SPIDEV=y

0 Kudos