Re: [PATCH 0/4] fdtfactor: Introduce fdtfactor to auto-factor overlays
From: Simon Glass
Date: Mon Oct 26 2026 - 11:35:02 EST
Hi Doug,
On 2026-10-15T18:21:33, Douglas Anderson <dianders@xxxxxxxxxxxx> wrote:
> The fdtfactor tool can either work directly on a set of compiled devicetree
> files or it can work on FIT (flattened image tree) file. The idea is that
> you'd create the FIT file containing all of the duplicated devicetree
> files and then fdtfactor would "optimize" them.
This is an excellent idea. I have been thinking about something like
this for some years but then when Chen-Yu Tsai wrote something which
used the kernel build (Linux 17c31aded9a1 scripts/make_fit: Support
decomposing DTBs) I forgot about it all. So thanks for taking it on!
Ths script's post-processing of a finished FIT only works for a narrow
set of images. Apart from signatures nodes (where I think it should
error), it also rejects FITs with external data[1], which mkimage -E
produces and binman[2] uses a lot. Of course, mkimage does support
making the data internal, so it's easy enough to work around, but also
likely easy enough to support in this tool once the initial version is
in.
As an aside, this would be a great feature to add to binman - trivial
once your script is applied.
> Add 3-board test cases covering default mode and `--strip-local-fixups`
> to the `fdtoverlay` test suite.
Please can you move the tests from all three patches out of
fdtoverlay_tests() into a separate fdtfactor test set? Then they can
be run on their own with run_tests.sh -t and skipped cleanly when
Python or lz4 is not available.
> 3. Better savings than just a simple partitioning, like between SoC and
> boards.
It would be worth including numbers for a plain SoC/board split on
trogdor compared with fdtfactor. The whole set compressed with a
large-window compressor would also help (as David suggests). That
would show how much of the 87.5% comes from the factoring itself.
[1] https://fitspec.osfw.foundation/#external-data
[2] https://binman.readthedocs.io/en/latest/entries.html#entry-fit-flat-image-tree-fit
Regards,
Simon