From 735ddc930f77950e1f292c574067106cf38e2e87 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Tue, 7 May 2019 17:05:28 -0700 Subject: device_tree: 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. It was adapted from depthcharge's http://crosreview.com/1536387. Change-Id: Ibec833cd471201bcc7a79eebf360d5f12adb8ff9 Signed-off-by: Julius Werner Reviewed-on: https://review.coreboot.org/c/coreboot/+/32869 Reviewed-by: Hung-Te Lin Tested-by: build bot (Jenkins) --- src/include/device_tree.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/include/device_tree.h') diff --git a/src/include/device_tree.h b/src/include/device_tree.h index d9d9613f96..8d86bc5acb 100644 --- a/src/include/device_tree.h +++ b/src/include/device_tree.h @@ -180,6 +180,10 @@ void dt_find_bin_prop(const struct device_tree_node *node, const char *name, const char *dt_find_string_prop(const struct device_tree_node *node, const char *name); +/* Apply an overlay to a base device tree. Ownership of the overlay data passes + to the newly combined base tree -- do not free() or access it afterwards! */ +int dt_apply_overlay(struct device_tree *tree, struct device_tree *overlay); + /* * Fixups to apply to a kernel's device tree before booting it. */ -- cgit v1.2.3