IMX8MN ECSPI buses not available in Linux

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

IMX8MN ECSPI buses not available in Linux

Jump to solution
972 Views
JeffreyDokter
Contributor II

I'm in the process of porting our Yocto build from Dunfell to Kirkstone.

To do this we are switching from Linux-IMX Kernel rel_imx_5.4.24_2.1.0 to lf-5.15.32-2.0.0.
On our board we have a IMX8MN processor and were are using both ECSPI1 and ECSPI3 buses.
This worked in our old version after we applied the patch found here.
However, in the new version this patch is not directly applicable anymore, and the buses are not found at all. The kernel boots but does not give any indication the SPI IMX driver has been probed or that SPI devices have been found.

I suspect this is a devicetree issue, but cannot figure out what is wrong, since it is based in the imx8mn.dtsi devicetree file.

The spi part of our decompiled devicetree looks like this:

                spi@30820000 {

                    compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";

                    #address-cells = <0x1>;

                    #size-cells = <0x0>;

                    reg = <0x30820000 0x10000>;

                    interrupts = <0x0 0x1f 0x4>;

                    clocks = <0x2 0x88 0x2 0x88>;

                    clock-names = "ipg", "per";

                    status = "okay";

                    fsl,spi-num-chipselects = <0x1>;

                    pinctrl-names = "default";

                    pinctrl-0 = <0x23 0x24>;

                    cs-gpios = <0x25 0x9 0x1>;

                    flash@0 {

                        reg = <0x0>;

                        compatible = "gigadevice,gd25wq32e", "jedec,spi-nor";

                        spi-max-frequency = <0x1f78a40>;

                        status = "okay";

                    };

                };

                spi@30830000 {

                    compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";

                    #address-cells = <0x1>;

                    #size-cells = <0x0>;

                    reg = <0x30830000 0x10000>;

                    interrupts = <0x0 0x20 0x4>;

                    clocks = <0x2 0x89 0x2 0x89>;

                    clock-names = "ipg", "per";

                    dmas = <0x26 0x2 0x7 0x1 0x26 0x3 0x7 0x2>;

                    dma-names = "rx", "tx";

                    status = "disabled";

                };

                spi@30840000 {

                    compatible = "fsl,imx8mn-ecspi", "fsl,imx51-ecspi";

                    #address-cells = <0x1>;

                    #size-cells = <0x0>;

                    reg = <0x30840000 0x10000>;

                    interrupts = <0x0 0x21 0x4>;

                    clocks = <0x2 0x8a 0x2 0x8a>;

                    clock-names = "ipg", "per";

                    status = "okay";

                    fsl,spi-num-chipselects = <0x1>;

                    pinctrl-names = "default";

                    pinctrl-0 = <0x27 0x28>;

                    cs-gpios = <0x25 0x19 0x1>;

                    can@0 {

                        reg = <0x0>;

                        compatible = "microchip,mcp251xfd";

                        pinctrl-names = "default";

                        pinctrl-0 = <0x29>;

                        clocks = <0x2a>;

                        interrupt-parent = <0x25>;

                        interrupts = <0xa 0x8>;

                        microchip,rx-int-gpios = <0x25 0xb 0x1>;

                        spi-max-frequency = <0x1312d00>;

                        status = "okay";

                    };

                };

And the SPI part of the defconfig looks like this:

CONFIG_SPI=y
CONFIG_SPI_FSL_LPSPI=y
CONFIG_SPI_FSL_QUADSPI=y
CONFIG_SPI_NXP_FLEXSPI=y
CONFIG_SPI_IMX=m
CONFIG_SPI_SPIDEV=y

Are there any additional adjustments that have to be made for the buses to work with the new kernel version?

I have also attached our decompiled devicetree of defconfig for additional clarity.

Thanks in advance!

0 Kudos
Reply
1 Solution
926 Views
JeffreyDokter
Contributor II

The issue has been solved.

Unlike my suspicions, I solved the issue by enabling the following option in the kernel configuration:

CONFIG_IMX_SCU=y

I'm not exactly sure why this is required for SPI to function, but this way the SPI_IMX driver is probed and the buses and connected devices can be used.

Thanks for the support!

View solution in original post

0 Kudos
Reply
3 Replies
927 Views
JeffreyDokter
Contributor II

The issue has been solved.

Unlike my suspicions, I solved the issue by enabling the following option in the kernel configuration:

CONFIG_IMX_SCU=y

I'm not exactly sure why this is required for SPI to function, but this way the SPI_IMX driver is probed and the buses and connected devices can be used.

Thanks for the support!

0 Kudos
Reply
954 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

It does look good, you may even take the i.MX8MM EVK devicetree as an example for this:
https://github.com/nxp-imx/linux-imx/blob/lf-5.15.y/arch/arm64/boot/dts/freescale/imx8mn.dtsi

Also, could you share a booting log?

Best regards,
Aldo.

0 Kudos
Reply
938 Views
JeffreyDokter
Contributor II

Hello Aldo,

thanks for the quick reply!

Yes, that devicetree is used as the baseline for ours.

I attached a boot log with this message. I already set the log level such that debug messages are also printed.
As you can see, there is no mention of probing the SPI IMX driver, which was shown before on our previous version

0 Kudos
Reply