I have feature request for TCB based in one of our use cases: the possibility to add custom overlays, but not explicitly load them at boot time.
For context, we are using a dynamic kernel DTB (similar to Toradex’s fdtfile handling for carrier boards and wifi presence/absence) to handle subtle incompatible differences between board hardware revisions.
We’ve modified u-boot to append a #conf node to the FIT configuration selection based on the detected hardware DTB version (read from EEPROM on the carrier board). We currently use TorizonCore builder to manage device trees since it’s very convenient to do so there and it’s more accessible than a raw Yocto build for rapid iteration and easy adjustments.
We’ve managed to achieve what we want already but I suspect this is a happy accident and not an intended functionality, so I would like to mention our use case for consideration as an explicit capability.
In essence, we are achieving the goal by doing a two-stage build:
- First, we run a TorizonCore builder build which specifies the base DTS, and adds two overlays, e.g.
my-hardware.dtsandmy-hardware-v1.dtso/my-hardware-v2.dtso. This adds the overlays to the FIT image (or boot ostree dtb/overlays folder) , but crucially, also adds them to overlays.txt meaning that uboot will attempt to apply multiple conflicting/incompatible overlays. - We then run a second TCB invocation with
overlays-> clear: trueto clear the applied overlays.
this empties overlays.txt but does not remove the entries from the FIT image or filesystem
This leaves the build result in exactly the situation we need - the required hw revision conf nodes are present, but not automatically all applied by the overlays.txt processing.
Relying on the “feature” that clearing overlays clears the text file but does not remove the conf nodes or .dtbo files from disk seems like a behaviour that might change in future versions of TCB - especially given the context comment:
# >> Whether to ignore all overlays from the base image (or ostree
# >> archive in the future).
Hence: this request to either pin this as an explicit, known behaviour or adding a property option to allow specifying whether added overlays should be included in overlays.txt (or only added to the selection of dtbos/#conf nodes) would be ideal. Ex:
device-tree:
# >> Directories where to look for include files.
include-dirs:
- my_dts/include/
# >> Custom device tree source:
custom: my_dts/imx8mp-verdin-MyDevice.dts
# >> Device-tree overlays configuration:
overlays:
add:
# Legacy syntax and legacy behaviour:
- my_dts/overlays/some-overlay-to-always-apply.dtso
# Example for new syntax and new behaviour:
file: my_dts/overlays/imx8mp-verdin-MyDevice-Rev1.dtso
auto_apply: false
file: my_dts/overlays/imx8mp-verdin-MyDevice-Rev2.dtso
auto_apply: false
What do you think?
TCB currently hard-codes u-boot’s fdtfile value when you specify a custom device tree but my proposed feature could potentially go hand-in-hand with the auto-derived fdtfile based on fdt_board as a seamless officially supported dts hw revision management feature if fw_setenv could be used to fix a particular (custom) board at deployment time in the persistent u-boot environment.
~BW908