U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 3/5] fdt: Allow stacked overlays phandle references
Date: Fri, 07 Jul 2017 10:02:20 +0300	[thread overview]
Message-ID: <1499410940.4225.54.camel@hp800z> (raw)
In-Reply-To: <CAPnjgZ3rNnojm0V7mU5YV-qyiQ=Zs1wbS7CX38=bqW1HDytQzg@mail.gmail.com>

Hi Simon,

On Thu, 2017-07-06 at 21:58 -0600, Simon Glass wrote:
> On 30 June 2017 at 10:23, Pantelis Antoniou
> <pantelis.antoniou@konsulko.com> wrote:
> > This patch enables an overlay to refer to a previous overlay's
> > labels by performing a merge of symbol information at application
> > time.
> >
> > In a nutshell it allows an overlay to refer to a symbol that a previous
> > overlay has defined. It requires both the base and all the overlays
> > to be compiled with the -@ command line switch so that symbol
> > information is included.
> >
> > base.dts
> > --------
> >
> >         /dts-v1/;
> >         / {
> >                 foo: foonode {
> >                         foo-property;
> >                 };
> >         };
> >
> >         $ dtc -@ -I dts -O dtb -o base.dtb base.dts
> >
> > bar.dts
> > -------
> >
> >         /dts-v1/;
> >         /plugin/;
> >         / {
> >                 fragment at 1 {
> >                         target = <&foo>;
> >                         __overlay__ {
> >                                 overlay-1-property;
> >                                 bar: barnode {
> >                                         bar-property;
> >                                 };
> >                         };
> >                 };
> >         };
> >
> >         $ dtc -@ -I dts -O dtb -o bar.dtb bar.dts
> >
> > baz.dts
> > -------
> >
> >         /dts-v1/;
> >         /plugin/;
> >         / {
> >                 fragment at 1 {
> >                         target = <&bar>;
> >                         __overlay__ {
> >                                 overlay-2-property;
> >                                 baz: baznode {
> >                                         baz-property;
> >                                 };
> >                         };
> >                 };
> >         };
> >
> >         $ dtc -@ -I dts -O dtb -o baz.dtb baz.dts
> >
> > Applying the overlays:
> >
> >         $ fdtoverlay -i base.dtb -o target.dtb bar.dtb baz.dtb
> >
> > Dumping:
> >
> >         $ fdtdump target.dtb
> >         / {
> >             foonode {
> >                 overlay-1-property;
> >                 foo-property;
> >                 linux,phandle = <0x00000001>;
> >                 phandle = <0x00000001>;
> >                 barnode {
> >                     overlay-2-property;
> >                     phandle = <0x00000002>;
> >                     linux,phandle = <0x00000002>;
> >                     bar-property;
> >                     baznode {
> >                         phandle = <0x00000003>;
> >                         linux,phandle = <0x00000003>;
> >                         baz-property;
> >                     };
> >                 };
> >             };
> >             __symbols__ {
> >                 baz = "/foonode/barnode/baznode";
> >                 bar = "/foonode/barnode";
> >                 foo = "/foonode";
> >             };
> >         };
> >
> > Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> > ---
> >  lib/libfdt/fdt_overlay.c | 148 ++++++++++++++++++++++++++++++++++++++++++++++-
> >  1 file changed, 147 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> I suppose that the upstream version has tests?
> 

Yes, and I could use a couple reviewers in the dtc mailing list.
 
> Does it make sense to implement this in the live tree instead, or do
> you need to modify the DT before relocation?
> 

There is a port of a patch that works on the live tree; I guess I can
port it to u-boot's live tree as well.

Speaking of which I've done quite a bit of work on a different live tree
implementation as well. I would propose we split off u-boot's one in a
library and port my changes there. That way we can have a definitive
live tree implementation, and in the future move dtc's internal live
tree to it as well. We keep on implementing the same functionality in
different flavors for years, let's consolidate, and start working on
ideas for the future.

> - Simon

Regards

-- Pantelis

  reply	other threads:[~2017-07-07  7:02 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30 16:22 [U-Boot] [PATCH 0/5] uboot overlays and FIT image Pantelis Antoniou
2017-06-30 16:22 ` [U-Boot] [PATCH 1/5] libfdt.h: Introduce FDT_PATH_MAX Pantelis Antoniou
2017-07-01 14:01   ` Marek Vasut
2017-07-07  3:58     ` Simon Glass
2017-07-07  7:03       ` Pantelis Antoniou
2017-06-30 16:22 ` [U-Boot] [PATCH 2/5] libfdt_env.h: Add <malloc.h> in libfdt environment Pantelis Antoniou
2017-07-01 14:02   ` Marek Vasut
2017-07-04 16:53     ` Pantelis Antoniou
2017-07-07  3:58   ` Simon Glass
2017-06-30 16:23 ` [U-Boot] [PATCH 3/5] fdt: Allow stacked overlays phandle references Pantelis Antoniou
2017-07-01 14:07   ` Marek Vasut
2017-07-04 17:03     ` Pantelis Antoniou
2017-07-05  6:25     ` Lothar Waßmann
2017-07-07  3:58   ` Simon Glass
2017-07-07  7:02     ` Pantelis Antoniou [this message]
2017-07-14 13:51       ` Simon Glass
2017-06-30 16:23 ` [U-Boot] [PATCH 4/5] test: overlay: Add unit test for stacked overlay Pantelis Antoniou
2017-07-07  3:58   ` Simon Glass
2017-07-07  7:48   ` Moritz Fischer
2017-07-07  8:32     ` Marek Vasut
2017-07-07 10:33     ` Pantelis Antoniou
2017-06-30 16:23 ` [U-Boot] [PATCH 5/5] fit: Introduce methods for applying overlays on fit-load Pantelis Antoniou
2017-07-01 14:11   ` Marek Vasut
2017-07-04 17:05     ` Pantelis Antoniou
2017-07-04 22:19       ` stefan.bruens at rwth-aachen.de
2017-07-05  6:32         ` Lothar Waßmann
2017-07-28 18:48 ` [U-Boot] [PATCH 0/5] uboot overlays and FIT image Simon Glass
2017-07-28 19:20   ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499410940.4225.54.camel@hp800z \
    --to=pantelis.antoniou@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox