Don't know where to start with device tree

I read through the device tree page: Device Tree Customization and cannot find where the device tree is located in my computer. I searched online for other suggestions on where it might be located but can’t find it. I even used the “find” operation in the console and tried to find all dtbo files in the embedded linux operating system and can’t find anything.

The device tree page gives info on how to modify the file and that’s great, but I can’t find where it is. And do you edit it in a text editor in the console?

Hi,

Did you get kernel sources? Device tree files are in linux-toradex/arch/arm/boot/dts
If you don’t, then you may clone them with git clone -b toradex_5.4-2.1.x-imx git://git.toradex.com/linux-toradex.git

To be honest, I’m working with a group and I received the imx6 with embedded linux already installed. So I’m trying to find the device tree while I’m logged into the system. If I go to the main directory “cd /” I don’t see a folder arch/ to go into.

The more I read about it I’m getting the impression that the device tree needs to be modified in the source code for the entire system, then you re-compile the system and reinstall it and everything, then you can use SPI let’s say.

I thought based on the device tree link I posted, you could just edit the file in the existing system, and then when you rebooted it would just recompile the device tree without needing to compile the entire operating system.

Sorry, I’m a noob.

@SterlingA your correct that device trees need to be modified at source. The device tree on your SOM is a compiled one. You can download the source here and modify the device tree as required.

Like others said the device tree is created at build time of embeded image.

But usally you have a few options to get to the device on a running device:

  1. Search for a *.dtb file. dtb=device tree binary / on rootfs or external media often the devicetree binary is included in /boot you can use the device tree compiler (dtc) to create a src out of it. The devicetree compiler is not architecture related - so you can get the dtb file to your development machine and use it on this machine.

  2. You can use the device tree compiler, if it is included on your system to create a dts (device tree source) dtc -I fs -O dts -o /tmp/device_tree.dts /sys/firmware/devicetree/base
    This command would create a dts file of your actuall running device tree.

  3. If you embeded image has procfs enabled you can inspect the actual device in /proc/device-tree/

Kind regards

Sebastian

HI @SterlingA

@seho85 is right, if you know which exactly you want to change, then you can just decompose the .dtb file to .dts and recompile the file using dtc compiler.

Otherwise, you might have a look here to find information about dtb sources.

Best regards,
Jaski