diff mbox series

[1/5] libfdt: Export overlay_apply_node() as fdt_overlay_apply_node()

Message ID 20200411200119.309400-1-marek.vasut+renesas@gmail.com
State Superseded
Headers show
Series [1/5] libfdt: Export overlay_apply_node() as fdt_overlay_apply_node() | expand

Commit Message

Marek Vasut April 11, 2020, 8:01 p.m. UTC
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.

Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
Cc: Simon Glass <sjg at chromium.org>
Cc: Tom Rini <trini at konsulko.com>
---
 scripts/dtc/libfdt/fdt_overlay.c | 5 +++++
 scripts/dtc/libfdt/libfdt.h      | 7 +++++++
 2 files changed, 12 insertions(+)

Comments

Simon Glass April 19, 2020, 11:37 p.m. UTC | #1
Hi Marek,

On Sat, 11 Apr 2020 at 14:01, Marek Vasut <marek.vasut at gmail.com> wrote:
>
> 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.
>
> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
> Cc: Simon Glass <sjg at chromium.org>
> Cc: Tom Rini <trini at konsulko.com>
> ---
>  scripts/dtc/libfdt/fdt_overlay.c | 5 +++++
>  scripts/dtc/libfdt/libfdt.h      | 7 +++++++
>  2 files changed, 12 insertions(+)

This is fine but please send the patch upstream as we just copy this file.

Regards,
Simon
Marek Vasut May 16, 2020, 6:55 p.m. UTC | #2
On 4/20/20 1:37 AM, Simon Glass wrote:
> Hi Marek,
> 
> On Sat, 11 Apr 2020 at 14:01, Marek Vasut <marek.vasut at gmail.com> wrote:
>>
>> 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.
>>
>> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
>> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
>> Cc: Simon Glass <sjg at chromium.org>
>> Cc: Tom Rini <trini at konsulko.com>
>> ---
>>  scripts/dtc/libfdt/fdt_overlay.c | 5 +++++
>>  scripts/dtc/libfdt/libfdt.h      | 7 +++++++
>>  2 files changed, 12 insertions(+)
> 
> This is fine but please send the patch upstream as we just copy this file.

PR is open here:
https://github.com/dgibson/dtc/pull/35
Simon Glass May 18, 2020, 3:17 a.m. UTC | #3
On Sat, 16 May 2020 at 13:55, Marek Vasut <marek.vasut at gmail.com> wrote:
>
> On 4/20/20 1:37 AM, Simon Glass wrote:
> > Hi Marek,
> >
> > On Sat, 11 Apr 2020 at 14:01, Marek Vasut <marek.vasut at gmail.com> wrote:
> >>
> >> 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.
> >>
> >> Signed-off-by: Marek Vasut <marek.vasut+renesas at gmail.com>
> >> Cc: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
> >> Cc: Simon Glass <sjg at chromium.org>
> >> Cc: Tom Rini <trini at konsulko.com>
> >> ---
> >>  scripts/dtc/libfdt/fdt_overlay.c | 5 +++++
> >>  scripts/dtc/libfdt/libfdt.h      | 7 +++++++
> >>  2 files changed, 12 insertions(+)
> >
> > This is fine but please send the patch upstream as we just copy this file.
>
> PR is open here:
> https://github.com/dgibson/dtc/pull/35
>
Reviewed-by: Simon Glass <sjg at chromium.org>
diff mbox series

Patch

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                                */
 /**********************************************************************/