Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1660284 > unrolled thread

Re: [PATCH] external references for device tree overlays

Started byRob Herring <robh+dt@kernel.org>
First post2017-06-08 00:20 +0200
Last post2017-06-08 09:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] external references for device tree overlays Rob Herring <robh+dt@kernel.org> - 2017-06-08 00:20 +0200
    Re: [PATCH] external references for device tree overlays Stefani Seibold <stefani@seibold.net> - 2017-06-08 09:00 +0200

#1660284 — Re: [PATCH] external references for device tree overlays

FromRob Herring <robh+dt@kernel.org>
Date2017-06-08 00:20 +0200
SubjectRe: [PATCH] external references for device tree overlays
Message-ID<tPRsZ-47t-5@gated-at.bofh.it>
On Wed, Jun 7, 2017 at 3:11 AM, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> Hi Stefani,
>
> On Tue, 2017-06-06 at 21:17 +0200, Stefani Seibold wrote:
>> Hi Pantelis,
>>
>> thanks for the suggestion. This feature is not very well documented. I
>> tried this on my rasp1 running 4.12.0-rc3 and it doesn't work. My
>> source is:
>>
>> // rapsi example
>> /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 = <&{/soc/timer@7e0030000}>;
>>         };
>>     };
>> };
>>
>>
>> The resulting overlay is (decompiled with fdtdump):
>>
>> /dts-v1/;
>> // magic:             0xd00dfeed
>> // totalsize:         0x19a (410)
>> // off_dt_struct:     0x38
>> // off_dt_strings:    0x148
>> // off_mem_rsvmap:    0x28
>> // version:           17
>> // last_comp_version: 16
>> // boot_cpuid_phys:   0x0
>> // size_dt_strings:   0x52
>> // size_dt_struct:    0x110
>>
>> / {
>>     compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
>>     fragment@0 {
>>         target-path = "/soc/i2s@7e203000";
>>         __overlay__ {
>>             #address-cells = <0x00000001>;
>>             #size-cells = <0x00000001>;
>>             test = "test";
>>             timer = <0xdeadbeef>;
>>         };
>>     };
>>     __fixups__ {
>>         /soc/timer@7e0030000 = "/fragment@0/__overlay__:timer:0";
>>     };
>> };
>>
>> But this will not apply:
>>
>> OF: resolver: overlay phandle fixup failed: -22
>> create_overlay: Failed to resolve tree
>>
>>
>
> Yes, it will not work as it is; my point is that you don't need the
> magic __*__ node.
>
> You will need to modify the overlay application code to live insert a
> phandle (if it doesn't exist) when it encounters a /path fixup.

phandles only exist if something in the base tree refers to that node.
Adding them when they don't exist should definitely be something we
support for overlays. But don't call that a broken DT. That would be a
separate issue.

Rob

[toc] | [next] | [standalone]


#1660796

FromStefani Seibold <stefani@seibold.net>
Date2017-06-08 09:00 +0200
Message-ID<tPZAd-Nh-3@gated-at.bofh.it>
In reply to#1660284
On Wed, 2017-06-07 at 17:19 -0500, Rob Herring wrote:
> On Wed, Jun 7, 2017 at 3:11 AM, Pantelis Antoniou
> <pantelis.antoniou@konsulko.com> wrote:
> > Hi Stefani,
> > 
> > On Tue, 2017-06-06 at 21:17 +0200, Stefani Seibold wrote:
> > > Hi Pantelis,
> > > 
> > > thanks for the suggestion. This feature is not very well
> > > documented. I
> > > tried this on my rasp1 running 4.12.0-rc3 and it doesn't work. My
> > > source is:
> > > 
> > > // rapsi example
> > > /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 = <&{/soc/timer@7e0030000}>;
> > >         };
> > >     };
> > > };
> > > 
> > > 
> > > The resulting overlay is (decompiled with fdtdump):
> > > 
> > > /dts-v1/;
> > > // magic:             0xd00dfeed
> > > // totalsize:         0x19a (410)
> > > // off_dt_struct:     0x38
> > > // off_dt_strings:    0x148
> > > // off_mem_rsvmap:    0x28
> > > // version:           17
> > > // last_comp_version: 16
> > > // boot_cpuid_phys:   0x0
> > > // size_dt_strings:   0x52
> > > // size_dt_struct:    0x110
> > > 
> > > / {
> > >     compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
> > >     fragment@0 {
> > >         target-path = "/soc/i2s@7e203000";
> > >         __overlay__ {
> > >             #address-cells = <0x00000001>;
> > >             #size-cells = <0x00000001>;
> > >             test = "test";
> > >             timer = <0xdeadbeef>;
> > >         };
> > >     };
> > >     __fixups__ {
> > >         /soc/timer@7e0030000 = "/fragment@0/__overlay__:timer:0";
> > >     };
> > > };
> > > 
> > > But this will not apply:
> > > 
> > > OF: resolver: overlay phandle fixup failed: -22
> > > create_overlay: Failed to resolve tree
> > > 
> > > 
> > 
> > Yes, it will not work as it is; my point is that you don't need the
> > magic __*__ node.
> > 
> > You will need to modify the overlay application code to live insert
> > a
> > phandle (if it doesn't exist) when it encounters a /path fixup.
> 
> phandles only exist if something in the base tree refers to that
> node.
> Adding them when they don't exist should definitely be something we
> support for overlays. But don't call that a broken DT. That would be
> a
> separate issue.
> 

Believe me it is broken. Due a NDA i am not able to give you more
details about the vendor. But there forgot do provide an device node
which must refer to the attached network and interrupt controller.

- Stefani

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web