iMX28 enable SPI in Linux 3.10

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

iMX28 enable SPI in Linux 3.10

Jump to solution
1,177 Views
silviagonzalez
Contributor II

Hello

We’re trying to enable the SPI functionality in an iMX287 with kernel 3.10.

We’ve added the highlighted lines to the imx28-mba28.dts file:

apb@80000000 {

                               apbh@80000000 {

                                             

                                               pinctrl@80018000 {

                                               ...           

                                               };

                               };

                               apbx@80040000 {

                                             

                                              ssp2: ssp@80014000 {

                                                               #address-cells = <1>;

                                                               #size-cells = <0>;

                                                               compatible = "fsl,imx28-spi";

                                                               pinctrl-names = "default";

                                                               pinctrl-0 = <&spi2_pins_a>;

                                                               status = "okay";

                                                               flash: m25p80@0 {

                                                                              #address-cells = <1>;

                                                                              #size-cells = <1>;

                                                                              compatible = "m25p80,fsl,imx28-spi";

                                                                              spi-max-frequency = <40000000>;

                                                                              reg = <0>;

                                                               };

                                               };

                               };

                };

But we’ve found that unless we comment the following highlighted lines in the imx28.dtsi file the compilation fails:

apb@80000000 {

                               apbh@80000000 {

                                               compatible = "simple-bus";

                                               #address-cells = <1>;

                                               #size-cells = <1>;

                                               reg = <0x80000000 0x3c900>;

                                               ranges;

                                               /*ssp2: ssp@80014000 {

                                                               #address-cells = <1>;

                                                               #size-cells = <0>;

                                                               reg = <0x80014000 0x2000>;

                                                               interrupts = <98 84>;

                                                               clocks = <&clks 48>;

                                                               dmas = <&dma_apbh 2>;

                                                               dma-names = "rx-tx";

                                                               fsl,ssp-dma-channel = <2>;

                                                               status = "disabled";

                                               };*/

                                               pinctrl@80018000 {

                                                               #address-cells = <1>;

                                                               #size-cells = <0>;

                                                               compatible = "fsl,imx28-pinctrl", "simple-bus";

                                                               reg = <0x80018000 0x2000>;

                                                             

                                                               spi2_pins_a: spi2@0 {

                                                                              reg = <0>;

                                                                              fsl,pinmux-ids = <

                                                                                              0x2100 /* MX28_PAD_SSP2_SCK__SSP2_SCK */

                                                                                              0x2110 /* MX28_PAD_SSP2_MOSI__SSP2_CMD */

                                                                                              0x2120 /* MX28_PAD_SSP2_MISO__SSP2_D0 */

                                                                                              0x2130 /* MX28_PAD_SSP2_SS0__SSP2_D3 */

                                                                              >;

                                                                              fsl,drive-strength = <1>;

                                                                              fsl,voltage = <1>;

                                                                              fsl,pull-up = <1>;

                                                               };

                                               };

                               apbx@80040000 {

                                               compatible = "simple-bus";

                                               #address-cells = <1>;

                                               #size-cells = <1>;

                                               reg = <0x80040000 0x40000>;

                                               ranges;

                               };

                };

};

Once we comment these lines the compilation is successfully completed but when booting the system we get the following error:

mxs-spi: probe of ssp.5 failed with error -22

Are we missing anything? Could you help us, please?

Thanks in advance for your help.

Labels (2)
0 Kudos
1 Solution
597 Views
alejandrolozan1
NXP Employee
NXP Employee
0 Kudos
2 Replies
598 Views
alejandrolozan1
NXP Employee
NXP Employee
0 Kudos
597 Views
fabio_estevam
NXP Employee
NXP Employee

Hi Silvia,

The compatible string you use is not correct.

Take a look at this dts file that shows the usage of a m25p80 spi flash on mx28:

https://git.kernel.org/cgit/linux/kernel/git/stable/linux-stable.git/tree/arch/arm/boot/dts/imx28-m2...