Device tree changes aren't reflected in the OS

I modified my device-tree make file to include the DTS file I made, which is a copy of imx6dl-colibri-eval-v3. Within it I’ve enabled SPI and disabled all UARTs except for UARTA. I’ve changed the status property acordingly on that DTS file and to the DTSI files that are included.At this point I’m just trying to be able to see that my changes of turning on and off drivers succeeds on the target device wich is the imx6.

After playing around with it I noticed that something did change if I decompile the dtb file into a dts file from the tar.xz archive that bitbake creates. But when I uploaded that into the imx6 with the toradex easy installer I don’t see any changes in the /dev/ folder of the OS. Further more, when I try to make more modifications now it seems as though bitbake it not recognizing the changes I make and claims that nothing needs to be re-compiled.

I’m using VScode to do all of this with the WSL terminal.

I’m at a loss honestly. I’ve checked endless tutorials and guides, even the ones on the Toradex website.

Dear @SterlingA,

Thanks for reaching out to Toradex.

We would be interested to know more about your project. Can you share more information?

What OS is currently running on your Colibri iMX6, which version?

Best Regards
Kevin

If you wish to compile a device tree only without doing a bitbake you can follow this article.
Kernel binary and device trees are stored at /dev/mmcblk0p1 eMMC partition which is mounted as a /boot so you can just add or replace device tree file. Which device tree is picked upon boot defined by U_boot environment variables.

I decompiled the dtb file and it seems as though my changes where made. However I will note that there are multiple .dtb files in my /boot folder so I’m not sure which one the device will use.

I have the following .dtb in my boot folder:
imx6dl-colibri-aster.dtb
imx6dl-colibri-cam-eval-v3.dtb
imx6dl-colibri-eval-v3.dtb
imx6dl-colibri-iris.dtb
imx6dl-colibri-iris-v2.dtb

I am using the iris carrier board for development, but ultimately the imx6 will be inserted into a custom mother board I made.

This is the imx6dl-colibri-iris.dtb that I decompiled, I haven’t checked the other’s yet.

spi@2014000 {
					#address-cells = <0x01>;
					#size-cells = <0x00>;
					compatible = "fsl,imx6q-ecspi\0fsl,imx51-ecspi";
					reg = <0x2014000 0x4000>;
					interrupts = <0x00 0x22 0x04>;
					clocks = <0x04 0x73 0x04 0x73>;
					clock-names = "ipg\0per";
					dmas = <0x0d 0x09 0x07 0x01 0x0d 0x0a 0x07 0x02>;
					dma-names = "rx\0tx";
					status = "okay";
					cs-gpios = <0x11 0x02 0x00>;
					pinctrl-names = "default";
					pinctrl-0 = <0x12>;
					phandle = <0x90>;

					spidev@0 {
						compatible = "toradex,evalspi";
						reg = <0x00>;
						spi-max-frequency = <0x15ef3c0>;
						status = "okay";
						phandle = <0x91>;
					};
				};

One more thing… in my iris.dts file in my source code I set the compatible to “spidev” but in the .dtb it shows up as “toradex,evalspi”. I’ve changed every instance of that I could find to ‘spidev’.

/* Colibri SSP */
&ecspi4 {
	status = "disabled";

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

I’m not sure what’s happening, I posted another comment with some code but it just dissapeard; fustrating.

This is the code in one of the dtb files in my boot folder. It looks enabled. Note that there’s a few different dtb files in that folder so I’m not sure which one the OS is using. I only decompiled one of the .dtb
spi@2014000 {
#address-cells = <0x01>;
#size-cells = <0x00>;
compatible = “fsl,imx6q-ecspi\0fsl,imx51-ecspi”;
reg = <0x2014000 0x4000>;
interrupts = <0x00 0x22 0x04>;
clocks = <0x04 0x73 0x04 0x73>;
clock-names = “ipg\0per”;
dmas = <0x0d 0x09 0x07 0x01 0x0d 0x0a 0x07 0x02>;
dma-names = “rx\0tx”;
status = “okay”;
cs-gpios = <0x11 0x02 0x00>;
pinctrl-names = “default”;
pinctrl-0 = <0x12>;
phandle = <0x90>;

				spidev@0 {
					compatible = "toradex,evalspi";
					reg = <0x00>;
					spi-max-frequency = <0x15ef3c0>;
					status = "okay";
					phandle = <0x91>;
				};
			};

I used bitbake to create a tdx-reference-minimal-image, then I tried to modify the device tree in there and then re-compile. The project will eventualy involve connecting multiple devices to UART, SPI, and I2C. The one I’m trying to figure out right now is SPI and I2C because that will communicate with our payload an Arducam OV5642. I haven’t configured the SPI for the slave device yet because I was just going to take it one step at a time and just “turn on” SPI so that I could see it in /dev/. That way I know that my changes in the sourve code are being reflected in the OS image.

alex: Thank you I will check that out.

Dear @SterlingA,

did Alex’s suggestion, help to resolve your issue?

Hi,

Thanks for the follow-up. It did solve the problem.

I was hoping to figure out how to do it in the source code for the future. I don’t want to take too much of your time, but do you know any good resources to learn about the linux’s source code including device tree? I’ve gone through all the documentation on the Toradex website and some of their datasheets so I’m looking for other resources.

Thank you for your time.

Device tree used by Linux kernel is defined by fdt_file U_Boot environment variable. Stop boot at U_boot stage and issue printenv command, You will see a details then.