Make DTB compiler include .dtso files

Instead of making changes to the .dts and .dtsi files, located in arch/arm/boot/dts, I want to add overlay file .dtso and make it automatically included given I have set "compatible" property properly.

I can't achieve result. Lots of info in the web, nothing works :frowning:

Created the .dtso file, put into the arch/arm/boot/dts/overlays. Tried putting into same directory as dts files. Read that dtso files are enumerated during device tree compilation and appropriate are included.

make dtbs does not work. Unable to find option to turn on the inclusion of overlay files in the make menuconfig.

What is the right way? Would be great if it is possible to have it at the Makefile level (so that I identify the platform and copy appropriate .dtso file into device tree compiler - before the device tree is compiled!).


As these overlay device trees aren't really relevant to most 'traditional' OpenWrt routers (because the hardware is fixed and the horribly ancient OEM bootloaders not supporting this in the first place, respectively not even supports device trees at all (and usually requiring to append the device tree to the kernel itself, to bypass this bootloader restriction)), you are probably going to be the first to find out (and having to do the necessary development to add support for it).

Sorry, but there probably is no better news about this (even although the feature would be useful for SBC like platforms such as RPi, rockchip or sunxi).

1 Like

Any news have their value because they lead to action. Thank you for your insight. Yes, I use sunxi platform, and was manually adding my changes to the device tree, hoping I can automate it and make it portable. If it is not possible - not a big problem!

Is it possible to somehow add request for enhancement for this functionality? I am not an expert in the build system thus using me in this role would not be as effective as could be. And I guess cross-platform experience is needed here to just put in place what other build systems already have.

As a more or less suitable/portable way would be if some section of Makefile is invoked at the very beginning of make processing before target/linux is compiled (where I can copy device tree files and configure them appropriately), but I can't find how it could be done. Sometimes package/cleanup is invoked in the order I need, but it seems only if package was not built properly/previously with errors to ensure there're no defective remainders of the source code.

Edit: this seems to be a miss as I can't know location of DTS files in the Makefile.

I've been using overlays for OrangePi-zero and OrangePi-R1 for over three years.
There was also a message on the forum.

The boot-config package is here.
Overlays are added after the images are assembled on the SBC itself.

An example of installing boot-config and enabling Wi-Fi (xradio-xr819) for Orangepi-Zero (OpenWrt 22.03.6 stable firmware image for MMC).