Imx6ull spi dev/spidev missing

Hello, I am trying to make the spi port of my colibri imx6ull work in the carrier irisV2.0 but dev/spidev does not appear, I already checked that in the kernel I have the option “user mode spi driver support” enabled and I am overwriting the device tree of the eval with the following custom device tree:

//habilito el spi1
&ecspi1 {
	status = "okay";

	mcp2515: can@0 {
		compatible = "microchip,mcp2515";
		pinctrl-names = "default";
		pinctrl-0 = <&pinctrl_can_int>;
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio2>;
		interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
		spi-max-frequency = <10000000>;
		vdd-supply = <&reg_3v3>;
		xceiver-supply = <&reg_5v0>;
		status = "disabled";
	};

	fsl,spi-num-chipselects = <1>;
	cs-gpios = <&gpio3 26 GPIO_ACTIVE_HIGH>;

	spidev0: spidev@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <23000000>;
		status = "okay";
	};
};

//deshabilito la uart2
&uart2 {
	status = "disabled";
};

//mux de los pines
&iomuxc {

	imx6ull-colibri {
		pinctrl_additionalgpio: additionalgpios {
		     fsl,pins = <
				//agrego los pines que saque de la uart aca
				MX6UL_PAD_UART2_TX_DATA__UART2_DTE_RX	0x10b0 /* SODIMM 36 */
				MX6UL_PAD_UART2_RX_DATA__UART2_DTE_TX	0x10b0 /* SODIMM 38 */
				MX6UL_PAD_UART2_CTS_B__UART2_DTE_RTS	0x10b0 /* SODIMM 32 */
				MX6UL_PAD_UART2_RTS_B__UART2_DTE_CTS	0x10b0 /* SODIMM 34 */
				//agrego aca los pines que saque del spi
				//MX6UL_PAD_LCD_DATA21__GPIO3_IO26	0x10b0	/* SODIMM 86 */
				//MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK	0x10b0	/* SODIMM 88 */
				//MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI	0x10b0 /* SODIMM 92 */
				//MX6UL_PAD_LCD_DATA23__ECSPI1_MISO	0x10b0 /* SODIMM 90 */
		     >;
		};
		pinctrl_ecspi1_cs: ecspi1-cs-grp {
			fsl,pins = <
				MX6UL_PAD_LCD_DATA21__GPIO3_IO26	0x70a0	/* SODIMM 86 */
			>;
		};
		pinctrl_ecspi1: ecspi1-grp {
			fsl,pins = <
				MX6UL_PAD_LCD_DATA20__ECSPI1_SCLK	0x000a0	/* SODIMM 88 */
				MX6UL_PAD_LCD_DATA22__ECSPI1_MOSI	0x000a0 /* SODIMM 92 */
				MX6UL_PAD_LCD_DATA23__ECSPI1_MISO	0x100a0 /* SODIMM 90 */
			>;
		};
	}; /* imx6ull { */
};

what am I missing?
some clue?

Regards

Hi @Facundogm,

It seems that you enabled the spidev correctly following this article.

How are you flashing the new dtb? If you are using Toradex Easy Installer, are you making sure that the correct .dtb is set on the image.json file?

Just enabling the spidev on device tree should be enough to find the device under /dev directory.

Best regards,

Daniel Morais

yes, I am using TEZI 1.8 for imx6ull. yesterday I checked and compiled the device tree again, I used the same name for the new dtb for the non-wifi and wifi version so I simply replaced them in the TEZI image, so it is not necessary to edit the json, and I reloaded it in the module with TEZI 1.8 and still the same, I don’t have dev / spidev.

my TEZI image is based in 5.0 devel with the added support for posix queues in the linux kernel and the following local.conf

MACHINE ?= "colibri-imx6ull"

DL_DIR ?= "${TOPDIR}/../downloads"

SSTATE_DIR ?= "${TOPDIR}/../sstate-cache"

DEPLOY_DIR = "${TOPDIR}/deploy"

PACKAGE_CLASSES ?= "package_ipk"

EXTRA_IMAGE_FEATURES ?= "debug-tweaks package-management eclipse-debug tools-sdk"

USER_CLASSES ?= "buildstats image-mklibs image-prelink"

PATCHRESOLVE = "noop"

BB_DISKMON_DIRS ??= "\
    STOPTASKS,${TMPDIR},1G,100K \
    STOPTASKS,${DL_DIR},1G,100K \
    STOPTASKS,${SSTATE_DIR},1G,100K \
    STOPTASKS,/tmp,100M,100K \
    ABORT,${TMPDIR},100M,1K \
    ABORT,${DL_DIR},100M,1K \
    ABORT,${SSTATE_DIR},100M,1K \
    ABORT,/tmp,10M,1K"

PACKAGECONFIG_append_pn-qemu-system-native = " sdl"
PACKAGECONFIG_append_pn-nativesdk-qemu = " sdl"

CONF_VERSION = "1"

INHERIT += "rm_work"

INHERIT += "toradex-mirrors"

DISTRO = "tdx-x11"
DISTRO_mx8 = "tdx-xwayland"

include conf/machine/include/${MACHINE}.inc

ACCEPT_FSL_EULA = "1"
BB_NO_NETWORK = "1"

IMAGE_INSTALL_append = "\
    apache2 \
    libgpiod \
    "
PACKAGECONFIG_remove_pn-dropbear = " disable-weak-ciphers"

Best regards

Facundo

Hello,

I did some tests here and was able to find the device under /dev directory.

I built the tdx-reference-minimal-image, then compiled the device tree under the branch toradex_5.4-2.1.x-imx and then replaced the imx6ull-colibri-eval-v3.dtb file since my module is not the wifi version, see below the used patch:

--- a/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
+++ b/arch/arm/boot/dts/imx6ull-colibri-eval-v3.dtsi
@@ -94,14 +94,14 @@
                spi-max-frequency = <10000000>;
                vdd-supply = <&reg_3v3>;
                xceiver-supply = <&reg_5v0>;
-               status = "okay";
+               status = "disabled";
        };
 
        spidev0: spidev@0 {
                compatible = "toradex,evalspi";
                reg = <0>;
                spi-max-frequency = <23000000>;
-               status = "disabled";
+               status = "okay";
        };
 };

See below image information:

root@colibri-imx6ull:~# cat /etc/issue
TDX Wayland with XWayland 5.0.0-devel-20200924161130+build.0 (dunfell) \n \l
Colibri-iMX6ULL_Reference-Minimal-Image

root@colibri-imx6ull:~# ls /dev/spi*
/dev/spidev0.0

It seems that the device tree isn’t being properly changed, can you please check again?

Best regard,

Daniel Morais

I am 100% sure that the device tree that I am using are the modified ones, next week I have to go to work in person where the colibri module is, so I will try again.

Best regards

Facundo

Hi, today I am trying again, the device tree I am sure they are correct and in fact I see a change, when using the command “cat / sys / kernel / debug / gpio” the gpio corresponding to SPI appears as spi_imx and I no longer lets use SODIMM_86 pin like gpio

 gpio-89 (SODIMM_88)
 gpio-90 (SODIMM_86 | spi_imx) out hi
 gpio-91 (SODIMM_92)
 gpio-92 (SODIMM_90)

however spidev does not appear

root @ colibri-imx6ull: / dev # ls
autofs loop4 ram4 tty27 tty60
block loop5 ram5 tty28 tty61
bus loop6 ram6 tty29 tty62
char loop7 ram7 tty3 tty63
colibri-i2c mem ram8 tty30 tty7
colibri-i2c-on-module memory_bandwidth ram9 tty31 tty8
colibri-uarta mqueue random tty32 tty9
colibri-uartc mtd0 rfkill tty33 ttymxc0
colibri-watchdog mtd0ro rtc tty34 ttymxc4
console mtd1 rtc0 tty35 ubi0
cpu_dma_latency mtd1ro rtc1 tty36 ubi0_0
cuse mtd2 shm tty37 ubi0_1
fb mtd2ro snd tty38 ubi0_2
fb0 mtd3 stderr tty39 ubi0_3
fd mtd3ro stdin tty4 ubi_ctrl
full mtd4 stdout tty40 udev_network_queue
fuse mtd4ro tty tty41 uinput
gpiochip0 net tty0 tty42 urandom
gpiochip1 network_latency tty1 tty43 vcs
gpiochip2 network_throughput tty10 tty44 vcs1
gpiochip3 null tty11 tty45 vcs2
gpiochip4 ppp tty12 tty46 vcs3
hydraw0 pps0 tty13 tty47 vcs4
hydraw1 ptmx tty14 tty48 vcs5
hwrng ptp0 tty15 tty49 vcs6
i2c-0 pts tty16 tty5 vcsa
i2c-1 pxp_device tty17 tty50 vcsa1
iio: device0 ram0 tty18 tty51 vcsa2
initctl ram1 tty19 tty52 vcsa3
input ram10 tty2 tty53 vcsa4
kmsg ram11 tty20 tty54 vcsa5
log ram12 tty21 tty55 vcsa6
loop-control ram13 tty22 tty56 vhci
loop0 ram14 tty23 tty57 watchdog
loop1 ram15 tty24 tty58 watchdog0
loop2 ram2 tty25 tty59 zero
loop3 ram3 tty26 tty6

Best regards

Facundo

solved, the problem was that I was not editing the original device tree “imx6ull-colibri-eval-v3.dtsi”, I was including a custom.dtsi in the parent .dts that stepped on various properties of the other .dtsi, that to disable the uartB and using the pins as gpio worked perfect for me but for the spi it seems that it does not, from now on I edit directly “imx6ull-colibri-eval-v3.dtsi”

Best regards

Facundo

Hi @Facundogm,

Thanks for the feedback!

Best regards,

Daniel Morais