Device tree SPI issue. Cannot find MODALIAS and CS1 >= max 1

I’m getting the errors shown in the photo of the boot log.
The code below is in the imx6dl-colibri-eval-v3.dtb file which I’m modifying the .dts version of it and then re-compiling and overriding the .dtb file. Then copying it via usb stick to my imx6 SoC’s boot folder and overriding the .dtb file in there.
I’m a bit new to this and right now I’m trying to enable ecspi1 which is spi@2008000, enable spidev1 which my ArduCAM OV5642 will be using, and then specify the alternate pins that I’ve selected for MISO, MOSI, and etc, based on the iMX6 datasheet alternate pin functions which are:
ECSPI_SCLK = pin 140
ECSPI_MOSI = pin 142
ECSPI_MISO = pin 144
ECSPI_SS0 = pin 146

Device tree code:
aips-bus@2000000 {
compatible = “fsl,aips-bus\0simple-bus”;
#address-cells = <0x01>;
#size-cells = <0x01>;
reg = <0x2000000 0x100000>;
ranges;
phandle = <0x92>;

			spba-bus@2000000 {
				compatible = "fsl,spba-bus\0simple-bus";
				#address-cells = <0x01>;
				#size-cells = <0x01>;
				reg = <0x2000000 0x40000>;
				ranges;

				spdif@2004000 {
					compatible = "fsl,imx35-spdif";
					reg = <0x2004000 0x4000>;
					interrupts = <0x00 0x34 0x04>;
					dmas = <0x0d 0x0e 0x12 0x00 0x0d 0x0f 0x12 0x00>;
					dma-names = "rx\0tx";
					clocks = <0x04 0xf4 0x04 0x03 0x04 0xc5 0x04 0x6b 0x04 0x00 0x04 0x76 0x04 0x3e 0x04 0x00 0x04 0x00 0x04 0x9c>;
					clock-names = "core\0rxtx0\0rxtx1\0rxtx2\0rxtx3\0rxtx4\0rxtx5\0rxtx6\0rxtx7\0spba";
					status = "disabled";
					pinctrl-names = "default";
					pinctrl-0 = <0x10>;
					phandle = <0x7f>;
				};

				spi@2008000 {
					#address-cells = <0x01>;
					#size-cells = <0x00>;
					compatible = "fsl,imx6q-ecspi\0fsl,imx51-ecspi";
					reg = <0x2008000 0x4000>;
					interrupts = <0x00 0x1f 0x04>;
					clocks = <0x04 0x70 0x04 0x70>;
					clock-names = "ipg\0per";
					dmas = <0x0d 0x03 0x07 0x01 0x0d 0x04 0x07 0x02>;
					dma-names = "rx\0tx";
					fsl,spi-num-chipselects = <1>;
					cs-gpios = <0x5 0x02 0x00>;
					status = "okay";
					pinctrl-names = "default";
					pinctrl-0 = <&pinctrl_ecspi1>;
					phandle = <0x93>;
					
					spidev@1 {
						compatible = "toradex,evalspi";
						reg = <1>;
						spi-max-frequency = <0x15ef3c0>;
						status = "okay";
					};
					
					pinctrl_ecspi1: ecspi1grp {
						fsl,pins = <
						0x1c8 0x4dc 0x7f8 0x2 0x1 0x100b1
						0x1c4 0x4d8 0x7fc 0x2 0x1 0x100b1
						0x1c0 0x4d4 0x7f4 0x2 0x1 0x100b1
						0x1cc 0x4e0 0x800 0x2 0x1 0x000b1
						>;
					};
				};

Hello @SterlingA ,

Greetings from Toradex Community!

Could you please tell the output of uname -a?
And when you like to use the ecspi1, have you enable the &ecspi1 in the imx6dl-colibri-eval-v3.dts device tree?

Could you also tell me in which file you have modified to include the snippet mentioned in your message above?

The error means that there is a conflict in pin mux. You might have to disable the standard functionality before you can use that Spi

Best Regards,
Janani

uname -a: "Linux colibri-imx6 5.4.91-5.2.0-devel+git.590db576d04d #1 SMP Tue Feb 2 16:38:41 UTC 2021 armv71 GNU/Linux"

The only reference to ecspi1 in the device tree I see is “ecspi1 = “/soc/aips-bus@2000000/spba-bus@2000000/spi@2008000”;” under the section “–symbols–” (won’t let me make - into underscores) . So “spi@2008000” should be ecspi1, in which I’ve made it enabled in the code above using “status = okay”.

I converted imx6dl-colibri-eval-v3.dtb file into dts, modified it, converted it back to a .dtb, and then overried it in my /boot/ folder. There are a few other blobs in the boot folder of the embedded Linux I’m using, but I haven’t looked at them because when I modified this one, I saw the changes reflected in the /dev/ folder, so I assumed that my system was using this particular device tree blob.

I’m not sure what you mean by standard functionality as I am new to this.

Thank you for your help.

Hello @SterlingA ,

Thank you explaining how to arrived at your device tree. The recommended method is to take the imx6dl-colibri-eval-v3.dts and then compile the changes and use the new device tree.

For example, the definition for the SoM can be found here in the device tree: imx6dl-colibri-eval-v3.dts « dts « boot « arm « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

And you also add the additional &ecspi1 here, for example.

I would also kindly recommend you to take a look at our developer article that briefs on SPI: SPI (Linux) | Toradex Developer Center

And also another one here that talks about the Device tree customizations:

What I mean by Standard functions is that some pins are recommended to be used for a certain functionality so that, if you would like to upgrade to another Colibri module in the future, you could do that with ease as all modules within Colibri family (For that matter, Apalis and Verdin too) are pin compatible. For example, the pins 86, 88, 90, 92 have the standard function of SPI allocated to them. So, when you use these functions fo SPI functionality you can be sure there can be no conflicts. Similiarly, the pins that you have used 140, 142, 144, 146 are primarily used to drive the display, as found in https://docs.toradex.com/102075-colibri-imx6-datasheet.pdf ( Page 25).

Hope this helps!

Best Regards,
Janani

Did you mean to include a link in this portion “And you also add the additional &ecspi1 here, for example.”, because there’s no link on the “here” word?

I’m looking into the rest of the items you asked me to look at, but it will take some time. Will msg back soon as I can.

I think I made some progress. All of the other pinmuxing used phandles under “iomuxc@20e0000 {”, so I followed the same convention that they were using, and moved my pinmux fsl pin description from my spi definition to the iomuxc@20e000 part of the device tree. I assigned phandle to it as well and the errors I got before are completely gone.

My issue now is that when I boot the SoC I will see all of the different SPI protocols such as 200c000, 2010000, and 2014000 all show that they’ve been “probed”, except for spi@2008000 which is the one I want. Sample code in boot log: “spi_imx 200c000.spi: probed”. I’m not sure why it’s ignoring it.

I pasted my revised code below.

aips-bus@2000000 {
			compatible = "fsl,aips-bus\0simple-bus";
			#address-cells = <0x01>;
			#size-cells = <0x01>;
			reg = <0x2000000 0x100000>;
			ranges;
			phandle = <0x92>;

			spba-bus@2000000 {
				compatible = "fsl,spba-bus\0simple-bus";
				#address-cells = <0x01>;
				#size-cells = <0x01>;
				reg = <0x2000000 0x40000>;
				ranges;

				spdif@2004000 {
					compatible = "fsl,imx35-spdif";
					reg = <0x2004000 0x4000>;
					interrupts = <0x00 0x34 0x04>;
					dmas = <0x0d 0x0e 0x12 0x00 0x0d 0x0f 0x12 0x00>;
					dma-names = "rx\0tx";
					clocks = <0x04 0xf4 0x04 0x03 0x04 0xc5 0x04 0x6b 0x04 0x00 0x04 0x76 0x04 0x3e 0x04 0x00 0x04 0x00 0x04 0x9c>;
					clock-names = "core\0rxtx0\0rxtx1\0rxtx2\0rxtx3\0rxtx4\0rxtx5\0rxtx6\0rxtx7\0spba";
					status = "disabled";
					pinctrl-names = "default";
					pinctrl-0 = <0x10>;
					phandle = <0x7f>;
				};

				spi@2008000 {
					#address-cells = <0x01>;
					#size-cells = <0x00>;
					compatible = "fsl,imx6q-ecspi\0fsl,imx51-ecspi";
					reg = <0x2008000 0x4000>;
					interrupts = <0x00 0x1f 0x04>;
					clocks = <0x04 0x70 0x04 0x70>;
					clock-names = "ipg\0per";
					dmas = <0x0d 0x03 0x07 0x01 0x0d 0x04 0x07 0x02>;
					dma-names = "rx\0tx";
					fsl,spi-num-chipselects = <1>;
					cs-gpios = <0x5 0x02 0x00>;
					status = "okay";
					pinctrl-names = "default";
					pinctrl-0 = <0xfa>;
					phandle = <0x93>;
					
					spidev@1 {
						compatible = "toradex,evalspi";
						reg = <0x00>;
						spi-max-frequency = <0x15ef3c0>;
						status = "okay";
					};
					
					mcp251x@1 {
						compatible = "microchip,mcp2515";
						reg = <0x00>;
						clocks = <0x13>;
						interrupt-parent = <0x14>;
						interrupts = <0x1b 0x02>;
						spi-max-frequency = <0x989680>;
						status = "disabled";
					};
				};

HI @SterlingA

Could you share the dmesg.log in a text file?

As already @saijanani.tx pointed out, the way you are doing the device-tree is not very useful. Use a regular .dts file as explained in this Guide and post the git diff between the original file and your changes in a text file?

Thanks and best regards,
Jaski

It doesn’t look like I have a dmesg.log in the /var/volatile/log/ folder. I only have btmp, lastlog, messages, private, and wtmp. Do you want the one called “messages” perhaps?

Dear @SterlingA ,

It looks to me like the environment is not configured properly. In order to make changes to the .dts files, you need to first source the repo locally, check out the appropriate branch, do your commits. Maybe this thread could be a nice read for you: [yocto] How to define and build device tree in Yocto?

We also have a developer article on how to set the environment correctly.Build U-Boot and Linux Kernel from Source Code | Toradex Developer Center
You need to have a locally the repo: linux-toradex. And within that you will find the tree structure of /arch/arm/boot/dts/… etc and also the Makefile.

I hope this helps.

Best Regards,
Janani

I will upload the log when I get home tonight.

I’m trying to not write paragraphs but it’s hard because there’s a lot going on.

Regarding the article. The only thing is is that if I look under “arch/arm/boot/dts/” in the OS it’s self, I have no /dts folder in my /boot folder. My boot folder only has a few different .dtb files, one of which is the “imx6dl-colibri-eval-v3.dtb”. So I can’t do the step in the Device Tree Customization where it asks to extend the Makefile for example, and the way it writes the device tree is very different than what’s in the existing .dtb file. I’m not sure that if I write one according to the article and the override the original .dtb that it will work, because I would only be writing a couple of nodes for SPI and I2C and UART. The .dtb is supposed to be the final amalgamation of all of the different SoC, Module, and board DT layers, so if I remove all that stuff by overriding a .dtb containing only a few nodes it will be missing a lot of stuff.

Previously I attempted to add my own device tree and alter the Makefile in the source code of the OS before I used bitbake to compile everything, but it was suggested by someone in this forum to not bother with that and just edit the final .dtb file in the OS’s /boot folder. So that’s why I was trying to do it the way I’m doing it now.

I appreciate the time you guys are taking to answer my question. I’m kind of over my head with this and I’m really trying.

Thank you for your response.

I made some progress and found a more specific error that I can show you in the link below. I found the kmsg log, but it was under the /dev folder. I had posted a new question about it because I thought everyone stopped answering on this one.

Previously when I tried to modify the device tree in my build environment the changes wouldn’t “stick” for lack of a better word, and I was told by the community to just modify the end .dtb file located on the OS itself. Unfortunately, I’m running out of time to complete this project so I really need to focus on one method of modifying the device tree. I feel like I’m very close and the answer would lie in the new question I posted.

If you have time to take a look at the error I got:
https://www.toradex.com/community/questions/62185/pinmuxed-specific-pins-to-spi-kernel-is-trying-to.html?childToView=62186#answer-62186

Thank you for your response.

I made some progress and found a more specific error that I can show you in the link below. I found the kmsg log, but it was under the /dev folder. I had posted a new question about it because I thought everyone stopped answering on this one.

Previously when I tried to modify the device tree in my build environment the changes wouldn’t “stick” for lack of a better word, and I was told by the community to just modify the end .dtb file located on the OS itself. Unfortunately, I’m running out of time to complete this project so I really need to focus on one method of modifying the device tree. I feel like I’m very close and the answer would lie in the new question I posted.

If you have time to take a look at the error I got: https://www.toradex.com/community/questions/62185/pinmuxed-specific-pins-to-spi-kernel-is-trying-to.html?childToView=62186#answer-62186

Hello @SterlingA ,

Thank you for your feedback. It may occasionally take some time for us to respond, especially when it’s holiday season, but we will always come back at you. In the future, if you are unsure of the progress please feel free to add a comment enquiring about the progress. Thank you for your understanding!

As for the new ticket that you have created, I or one of our colleagues will look into.

Best Regards,
Janani

Thank you.

You are welcome.