Enabling SPI 1 on Colibri iMX6 device tree

I am very new to embedded programming. Our custom carrier board has 5 SPI devices. I am using ecspi4 to support 4 devices and using ecspi1 to support the last one.

I was successful in defining spidev3.0 to spidev 3.3. Confirmed with ls /dev | grep "spidev" command.

I am having trouble defining ecspi1 in the device tree. Below is a snippet of module device tree - ‘imx6dl-colibri.dtsi’.

&ecspi4 {
	fsl,spi-num-chipselects = <4>;
	cs-gpios = <&gpio5 2 0>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi4 &pinctrl_spi_cs1 &pinctrl_spi_cs0 &pinctrl_spi_cs2 &pinctrl_spi_cs3>;
	status = "okay";
};

&ecspi1 {
	fsl,spi-num-chipselects = <1>;
	pinctrl-names = "default";
	pinctrl-0 = <&pinctrl_ecspi1 &pinctrl_spi1_cs1 >;
	status = "okay";
};

and Carrier Board level device tree - “imx6dl-colibri-cb.dts”

/* Colibri SPI */
&ecspi4 {
	status = "okay";

	mcp258x0: mcp258x@1 {
		compatible = "microchip,mcp2515";
		reg = <0>;
		clocks = <&clk16m>;
		interrupt-parent = <&gpio3>;
		interrupts = <27 0x2>;
		spi-max-frequency = <10000000>;
		status = "disabled";
	};
	spidev0: spidev@1 {
		compatible = "spidev";
		reg = <0>;
		spi-max-frequency = <23000000>;
	};

	spidev1: spidev@2 {
		compatible = "spidev";
		reg = <1>;
		spi-max-frequency = <23000000>;
	};
};

&ecspi1	{
	status = "okay";

	spidev4: spidev@5 {
		compatible = "spidev";
		reg = <0>;
		spi-max-frequency = <23000000>;
	};
};

I was not able to compile the new SPI node with “spidev0: spidev1”. Wondering why the compiler wont let me define new SPI node with this.

Is it possible for someone to explain the cs-gpio property in the SPI node?

Hi

cs-gpio is explained in the Kernel Documentation.

You are a bit cryptic on what now actually works and what not. Could you elaborate some more.

Could you show what your new nodes you reference (&pinctrl_spi_cs0 &pinctrl_spi_cs2 &pinctrl_spi_cs3) actually contain? Did you make sure that those pins no longer are used by some other component?

What is the error message the device tree compiler shows?

Probably a git diff against the original version of the device tree source files would help.
Assuming you did not check in anything that would be:

git diff arch/arm/boot/dts > add_spidev.patch

Max