Imx6 no spi devices in /dev with kernel 5.15

Over the last few years we have developed a custom board based on the imx6q sabresd. Currently we use kernel 4.19 RT and based our custom build on the one that was previously available on your " Debian: Getting Started with the i.MX6q SABRE Board" page. This kernel has been working fine. We did customise the device tree for our board in particular to ad an Intel i210 PCIe Ethernet adapter and to enable access to the 5 SPIs for communicating with our FPGA.

I wanted to try kernel 5.15 RT from your getting started page. I have it built and running now on one of our boards everything seems to be working as it did on the 4.19 build except we no longer see the SPI devices listed under /dev and cannot access them.

We have the same/equivalent options in the kernel .config as we did for 4.19 when we build it and see these set int UI of the kernel build menu e.g.
CONFIG_SPI=y
CONFIG_SPI_MASTER=y
CONFIG_SPI_MEM=y
CONFIG_SPI_BITBANG=y
CONFIG_SPI_IMX=y
CONFIG_SPI_SPIDEV=y
etc.

Also we have the entries in our dtsi file to enable the 5 SPIs but seemingly something isn’t right. For example for the first SPI we have (we have similar for the other 4):

&ecspi1 {
    num-cs = <1>;
    cs-gpios = <0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1>;
	status = "okay";

	spidev@0 {
		compatible = "spidev";
        // We can theoretically set this to 66.5MHz.
		spi-max-frequency = <66500000>;
		reg = <0>;
        status = "okay";
	};
};

And in iomuxc:

pinctrl_ecspi1: ecspi1grp {
    fsl,pins = <
        MX6QDL_PAD_CSI0_DAT6__ECSPI1_MISO	0x100b1
        MX6QDL_PAD_CSI0_DAT5__ECSPI1_MOSI	0x100b1
        MX6QDL_PAD_CSI0_DAT4__ECSPI1_SCLK	0x100b1
        MX6QDL_PAD_CSI0_DAT7__ECSPI1_SS0	0x1b0b0
    >;
};

These settings worked fine in 4.19 build and we can see and use the SPI lines to the FPGA. But with 5.15 we can’t see the SPI devices anymore.

I wondered if anyone might have an idea as to what the issue might be?

Change your compatible from: spidev to:

		compatible = "rohm,dh2228fv";

For a long time I kept reverting the ‘spidev’ disable in the spidev driver… But on every new kernel release they kept rewriting that section. So personally, i just moved to another long ‘approved’ spidev reference…

Regards,

Many thanks for such a speedy response. I’ll give that a go. I figured it was something related to this area but for the life of me couldn’t work out what was wrong!

PS, for future users, why that specific compatible?

It was the first added, so it’s been enabled for a long time: (v3.8.x based kernels have it…)

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/spi/spidev.c?h=v3.8.1#n648

Regards,

That seems to have worked. I can see spi devices listed in /dev now. Thanks.

May have spoken too soon. Although I can see the 5 spi devices listed as:

/dev/spidev0.0
/dev/spidev1.0
/dev/spidev2.0
/dev/spidev3.0
/dev/spidev4.0

When I run our test app to send and receive some messages to and from our FPGA I get an error when trying to use the SPI device:

“imx-sdma 20ec000.sdma: sdma firmware not ready!”

Not something I ever ran into using 4.19.

In case any one else reads this post and ends up with the SDMA firmware not ready error I fixed it by changing the kernel build config to have:

CONFIG_IMX_SDMA=m

(instead of CONFIG_IMX_SDMA=y)

Found solution here:

1 Like