All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frank Rowand <frowand.list@gmail.com>
To: Stefani Seibold <stefani.seibold.ext@huawei.com>,
	Stefani Seibold <stefani@seibold.net>,
	Pantelis Antoniou <pantelis.antoniou@konsulko.com>,
	Rob Herring <robh+dt@kernel.org>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Holm Rauchfuss <holm.rauchfuss@huawei.com>
Subject: Re: [PATCH] external references for device tree overlays
Date: Tue, 6 Jun 2017 00:20:15 -0700	[thread overview]
Message-ID: <593657AF.8050208@gmail.com> (raw)
In-Reply-To: <1496667567-13266-1-git-send-email-stefani.seibold.ext@huawei.com>

On 06/05/17 05:59, Stefani Seibold wrote:
> From: Stefani Seibold <stefani@seibold.net>
> 
> This patch enables external references for symbols which are not
> exported by the current device tree. For example
> 
> // RASPI example (only for testing)
> /dts-v1/;
> /plugin/;
> 
> / {
>     compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
> 
>     fragment@0 {
>         target-path = "/soc/i2s@7e203000";
>         __overlay__ {
>             #address-cells = <0x00000001>;
>             #size-cells = <0x00000001>;
>             test = "test";
>             timer = <&timer>;
>         };
>     };
> 
>     __external_symbols__ {
>         timer = "/soc/timer@7e003000";
>     };
> };

My hope is that the dtc compiler will stop supporting specification of the
__symbols__ node in dts source, and only generate it automatically in the dtb.
That change to dtc would not allow any node name specified in a dts to begin
with an underscore.  Thus node __external_symbols__ would not be allowed.


> 
> The "timer" symbol is not exported by the RASPI device tree, because it is
> missing in the __symbols__ section of the device tree.
> 
> In case of the RASPI device tree this could be simple fixed by modifing
> the device tree source, but when the device tree is provided by a closed
> source BIOS this kind of missing symbol could not be fixed.

Is there a real example of this issue, or is this a theoretical concern?
If this is a real example, we should be discouraging such behavior.

The suggestion by Pantelis should work, but that is just a hack to get
you out of a bad situation, not a good practice.

> 
> An additional benefit is to override a (possible broken) symbol exported
> by the currect live device tree.
> 
> The patch is based and tested on linux 4.12-rc3.
> 
> Signed-off-by: Stefani Seibold <stefani.seibold.ext@huawei.com>
> Signed-off-by: Stefani Seibold <stefani@seibold.net>
> ---
>  drivers/of/overlay.c  | 19 +++++++++++++++++++
>  drivers/of/resolver.c | 27 ++++++++++++++++++++++-----
>  2 files changed, 41 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
> index 7827786718d8..de6516ea0fcd 100644
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c

< snip >

-Frank

  parent reply	other threads:[~2017-06-06  7:20 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-05 12:59 [PATCH] external references for device tree overlays Stefani Seibold
2017-06-05 12:59 ` Stefani Seibold
2017-06-05 18:43 ` Pantelis Antoniou
2017-06-06 19:17   ` Stefani Seibold
2017-06-06 22:05     ` Rob Herring
2017-06-06 22:05       ` Rob Herring
2017-06-07  8:11     ` Pantelis Antoniou
2017-06-07 22:19       ` Rob Herring
2017-06-07 22:19         ` Rob Herring
2017-06-08  6:51         ` Stefani Seibold
2017-06-08  6:51           ` Stefani Seibold
2017-06-08  6:48       ` Stefani Seibold
2017-06-08  6:48         ` Stefani Seibold
2017-06-11 23:04         ` Frank Rowand
2017-06-11 23:04           ` Frank Rowand
2017-06-06  7:20 ` Frank Rowand [this message]
2017-06-06 16:12   ` Frank Rowand
2017-06-06 16:12     ` Frank Rowand
2017-06-06 19:22   ` Stefani Seibold
2017-06-07  0:46     ` Frank Rowand
2017-06-07  0:46       ` Frank Rowand
     [not found]       ` <1496815399.6999.1.camel@seibold.net>
     [not found]         ` <1496815399.6999.1.camel-mkwtCZVSLSnR7s880joybQ@public.gmane.org>
2017-06-08  3:07           ` Frank Rowand
     [not found]             ` <5938BF8F.2010001-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-06-08  7:08               ` Pantelis Antoniou
2017-06-08  7:08               ` Stefani Seibold
     [not found]                 ` <1496905725.7999.5.camel-mkwtCZVSLSnR7s880joybQ@public.gmane.org>
2017-06-11 23:14                   ` Frank Rowand
     [not found]                     ` <1497248029.9234.1.camel@seibold.net>
2017-06-12 18:46                       ` Frank Rowand
2017-06-12 18:46                         ` Frank Rowand

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=593657AF.8050208@gmail.com \
    --to=frowand.list@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=holm.rauchfuss@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pantelis.antoniou@konsulko.com \
    --cc=robh+dt@kernel.org \
    --cc=stefani.seibold.ext@huawei.com \
    --cc=stefani@seibold.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.