devicetree: Add overlay support

This patch adds support for merging a device tree overlay (as defined in
Documentation/dt-object-internal.txt in the dtc repository) into a base
device tree. The new functionality is not used (and therefore mostly
compile-time eliminated) for now, but we intend to augment our FIT
images with overlays in order to save binary size for small SKU
differences in the future.

TEST=Manually hacked up a framework to run all the Android libufdt
overlay test cases and manually compare them with the output produced by
libfdt (which showed no differences other than node/property ordering
which I think is irrelevant and one weird case of libfdt adjusting the
overlay phandles by an unexpectedly high offset, which suggests a bug in
their code but is ultimately inconsequential).

Change-Id: Icd3ed158f33e79e733617b74b1fc1edef762d69a
Signed-off-by: Julius Werner <>
Commit-Ready: ChromeOS CL Exonerator Bot <>
Reviewed-by: Hung-Te Lin <>
2 files changed