How OpenWrt compiles DTS files?

I'm fairly new to OpenWrt development and I have a question regarding dts(device tree) files.
I've checked that there are some folders in target/linux which consist dts files but I didn't find out how OpenWrt uses them and more specific how it compiles them and where the output dtb file is generated.
I previously knew that dtb files may be passed to kernel by bootloader or they may be appended to kernel image itself(Not sure).
I want to know which statement is correct and also which config determines this?
Thank you

1 Like

In the devices I've looked at, append-dtb or KERNEL_DTB are used in the target makefile:

The dtb is built from here:

The build process for my devices compiles the dts files to here:
ls build_dir/target-*/linux-*/*.dt*

On a device which uses dts, you can normally see the device tree here (but this can be configured off):
ls /proc/device-tree/
hexdump -C /proc/device-tree/compatible is a great resource.

The linux dtc utilities are very useful for investigating the dts / dtb.

1 Like