From patchwork Tue May 19 12:39:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 245999 List-Id: U-Boot discussion From: marek.vasut at gmail.com (Marek Vasut) Date: Tue, 19 May 2020 14:39:23 +0200 Subject: [PATCH V2 1/5] libfdt: Export overlay_apply_node() as fdt_overlay_apply_node() Message-ID: <20200519123927.13876-1-marek.vasut+renesas@gmail.com> This function is useful to merge a subset of DT into another DT, for example if some prior-stage firmware passes a DT fragment to U-Boot and U-Boot needs to merge it into its own DT. Export this function to permit implementing such functionality. Reviewed-by: Simon Glass Signed-off-by: Marek Vasut Cc: Nobuhiro Iwamatsu Cc: Simon Glass Cc: Tom Rini --- MR: https://github.com/dgibson/dtc/pull/35 V2: No change --- scripts/dtc/libfdt/fdt_overlay.c | 5 +++++ scripts/dtc/libfdt/libfdt.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/dtc/libfdt/fdt_overlay.c b/scripts/dtc/libfdt/fdt_overlay.c index be71873366..c090e6991e 100644 --- a/scripts/dtc/libfdt/fdt_overlay.c +++ b/scripts/dtc/libfdt/fdt_overlay.c @@ -879,3 +879,8 @@ err: return ret; } + +int fdt_overlay_apply_node(void *fdt, int target, void *fdto, int node) +{ + return overlay_apply_node(fdt, target, fdto, node); +} diff --git a/scripts/dtc/libfdt/libfdt.h b/scripts/dtc/libfdt/libfdt.h index fa63fffe28..421f90ad93 100644 --- a/scripts/dtc/libfdt/libfdt.h +++ b/scripts/dtc/libfdt/libfdt.h @@ -2032,6 +2032,13 @@ int fdt_del_node(void *fdt, int nodeoffset); */ int fdt_overlay_apply(void *fdt, void *fdto); +/** + * fdt_overlay_apply_node - Merges a node into the base device tree + * + * See overlay_apply_node() for details. + */ +int fdt_overlay_apply_node(void *fdt, int target, void *fdto, int node); + /**********************************************************************/ /* Debugging / informational functions */ /**********************************************************************/