In order to make a device tree change currently, I have to recompile the whole base image and push it to the device. This takes over an hour and also is not very flexible for development or different models of devices. The dtb file is very small and if dtsoverlay is enabled then I can be even more flexible. Given this I have the following Questions:
- Is there a mechanism to just update the dtb file?
- If dtsoverlay is enabled, can the bootloader be told use the overlay?
So far I don’t quite see such mechanism
In the kernel, I was able to enable:
CONFIG_OF=y
CONFIG_OF_DYNAMIC=y
CONFIG_OF_OVERLAY=y
I had to patch in (not needed but greatly simplifies overlay management)
CONFIG_OF_CONFIGFS=y
While I did patch Makefile.lib
to force the primary DTB to include references, and while it worked, I am not sure how much memory this takes up and not including that patch for production. References are not critical as they just simplify overlay creation.
Anyhow the end result is the ability to patch the provided DTB after boot and from userspace.
IE:
/dts-v1/;
/plugin/;
/ {
fragment@0 {
target-path = "/";
__overlay__ {
model = "sanity test";
};
};
};
Compile with dtc -I dts -O dtb -o sanity-test.dtbo sanity-test.dts
and then apply and test
root@wp-under-test:~# cat /proc/device-tree/model
Sierra Wireless, Inc. MDM WP7xxx series
root@wp-under-test:~# mkdir /sys/kernel/config/device-tree/overlays/sanity
root@wp-under-test:~# cat ./sanity-test.dtbo > /sys/kernel/config/device-tree/overlays/sanity/dtbo
root@wp-under-test:~# strings /proc/device-tree/model
sanity test
root@wp-under-test:~# rmdir /sys/kernel/config/device-tree/overlays/sanity
root@wp-under-test:~# cat /proc/device-tree/model
Sierra Wireless, Inc. MDM WP7xxx series
Given the lack of bootloader documentation (IE: the ability to alter DTB selection at boot), this should be the Legato Platforms primary/support method of Device Tree modification.