All of lore.kernel.org
 help / color / mirror / Atom feed
* device tree compiler with overlay support?
@ 2015-05-05 15:18 Michal Suchanek
       [not found] ` <CAOMqctSZObmoJQocCg3JvCA=ZDvvrxzKC9Ko=aq0J=LphNW+EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Michal Suchanek @ 2015-05-05 15:18 UTC (permalink / raw)
  To: devicetree

Hello,

where is a device tree compiler that can compile an overlay?

The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
there is a syntax error as soon as the /plugin/ tag is present.

Please CC me.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found] ` <CAOMqctSZObmoJQocCg3JvCA=ZDvvrxzKC9Ko=aq0J=LphNW+EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-05 16:51   ` Michal Suchanek
       [not found]     ` <CAOMqctT3WuqMTqaqUTN44zA2TEYmP9X7SN8ufTouQFoy=GjB1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Michal Suchanek @ 2015-05-05 16:51 UTC (permalink / raw)
  To: devicetree

On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello,
>
> where is a device tree compiler that can compile an overlay?
>
> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
> there is a syntax error as soon as the /plugin/ tag is present.

ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295

This does not apply cleanly to current DTC but the parts that fail are
due to cosmetic changes in the code so I went ahead and applied it.

However, the created blob is not what the kernel can accept into
of_overlay_create so what do I do with the blob to load it?

 Please CC me.

 Thanks

 Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]     ` <CAOMqctT3WuqMTqaqUTN44zA2TEYmP9X7SN8ufTouQFoy=GjB1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-06 17:18       ` Michal Suchanek
  2015-05-07  7:17       ` Geert Uytterhoeven
  1 sibling, 0 replies; 13+ messages in thread
From: Michal Suchanek @ 2015-05-06 17:18 UTC (permalink / raw)
  To: devicetree

On 5 May 2015 at 18:51, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hello,
>>
>> where is a device tree compiler that can compile an overlay?
>>
>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>> there is a syntax error as soon as the /plugin/ tag is present.
>
> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>
> This does not apply cleanly to current DTC but the parts that fail are
> due to cosmetic changes in the code so I went ahead and applied it.
>
> However, the created blob is not what the kernel can accept into
> of_overlay_create so what do I do with the blob to load it?

Looks like applying of_fdt_unflatten_tree on the blob is the thing to
do. Now the kernel just rejects the tree and does not crash. I get no
diagnostics as to why the overlay is rejected.

Time to add some debugging I guess.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]     ` <CAOMqctT3WuqMTqaqUTN44zA2TEYmP9X7SN8ufTouQFoy=GjB1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-05-06 17:18       ` Michal Suchanek
@ 2015-05-07  7:17       ` Geert Uytterhoeven
       [not found]         ` <CAMuHMdU=WySZ8kfaVmU6Bed=ofvrDQ9s51m7zyXN0qu-G-d4cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  1 sibling, 1 reply; 13+ messages in thread
From: Geert Uytterhoeven @ 2015-05-07  7:17 UTC (permalink / raw)
  To: Michal Suchanek; +Cc: Pantelis Antoniou, devicetree

On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> where is a device tree compiler that can compile an overlay?
>>
>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>> there is a syntax error as soon as the /plugin/ tag is present.
>
> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>
> This does not apply cleanly to current DTC but the parts that fail are
> due to cosmetic changes in the code so I went ahead and applied it.

Thanks for the link! That patch indeed requires some manual rework.

> However, the created blob is not what the kernel can accept into
> of_overlay_create so what do I do with the blob to load it?

Use "OF: DT-Overlay configfs interface" from Pantelis?

That depends on "configfs: Implement binary attributes", also from Pantelis,
which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
fold into its sole caller").

All of the above require manual fixups to apply.

Still have to try the actual loading, new to the overlay game on mainline
kernels (I did use it on boneblack with its original kernel and its overlay
manager).

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]         ` <CAMuHMdU=WySZ8kfaVmU6Bed=ofvrDQ9s51m7zyXN0qu-G-d4cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-07  7:28           ` Pantelis Antoniou
       [not found]             ` <E8C27FD0-CF22-4D8F-AC05-55518BEF4B84-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-05-07  7:48           ` Pantelis Antoniou
  1 sibling, 1 reply; 13+ messages in thread
From: Pantelis Antoniou @ 2015-05-07  7:28 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Michal Suchanek, devicetree

Hi Geert,

> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
> 
> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> where is a device tree compiler that can compile an overlay?
>>> 
>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>> there is a syntax error as soon as the /plugin/ tag is present.
>> 
>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>> 
>> This does not apply cleanly to current DTC but the parts that fail are
>> due to cosmetic changes in the code so I went ahead and applied it.
> 
> Thanks for the link! That patch indeed requires some manual rework.
> 
>> However, the created blob is not what the kernel can accept into
>> of_overlay_create so what do I do with the blob to load it?
> 
> Use "OF: DT-Overlay configfs interface" from Pantelis?
> 
> That depends on "configfs: Implement binary attributes", also from Pantelis,
> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
> fold into its sole caller").
> 
> All of the above require manual fixups to apply.
> 
> Still have to try the actual loading, new to the overlay game on mainline
> kernels (I did use it on boneblack with its original kernel and its overlay
> manager).
> 

Posted the patches recently, but for your convenience here’s the git tree.

https://github.com/pantoniou/dtc/tree/dt-overlays5

FWIW, I’ll post the capemgr patch today too.

> Gr{oetje,eeting}s,
> 
>                        Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                -- Linus Torvalds

Regards

— Pantelis

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]         ` <CAMuHMdU=WySZ8kfaVmU6Bed=ofvrDQ9s51m7zyXN0qu-G-d4cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-05-07  7:28           ` Pantelis Antoniou
@ 2015-05-07  7:48           ` Pantelis Antoniou
  1 sibling, 0 replies; 13+ messages in thread
From: Pantelis Antoniou @ 2015-05-07  7:48 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Michal Suchanek, devicetree

Oh, and since I forgot to include that earlier, there’s a git tree against 
mainline that I update regularly:

https://github.com/pantoniou/linux-beagle-track-mainline/tree/bbb-overlays

Regards

— Pantelis

> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
> 
> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> where is a device tree compiler that can compile an overlay?
>>> 
>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>> there is a syntax error as soon as the /plugin/ tag is present.
>> 
>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>> 
>> This does not apply cleanly to current DTC but the parts that fail are
>> due to cosmetic changes in the code so I went ahead and applied it.
> 
> Thanks for the link! That patch indeed requires some manual rework.
> 
>> However, the created blob is not what the kernel can accept into
>> of_overlay_create so what do I do with the blob to load it?
> 
> Use "OF: DT-Overlay configfs interface" from Pantelis?
> 
> That depends on "configfs: Implement binary attributes", also from Pantelis,
> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
> fold into its sole caller").
> 
> All of the above require manual fixups to apply.
> 
> Still have to try the actual loading, new to the overlay game on mainline
> kernels (I did use it on boneblack with its original kernel and its overlay
> manager).
> 
> Gr{oetje,eeting}s,
> 
>                        Geert
> 
> --
> Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
> 
> In personal conversations with technical people, I call myself a hacker. But
> when I'm talking to journalists I just say "programmer" or something like that.
>                                -- Linus Torvalds

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]             ` <E8C27FD0-CF22-4D8F-AC05-55518BEF4B84-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-05-07  8:07               ` Michal Suchanek
       [not found]                 ` <CAOMqctRPiPFtNAMBa5eZx=erL4xtohMxXAeFeMG-7KZaRxDnew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-05-07 14:57               ` Michal Suchanek
  1 sibling, 1 reply; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07  8:07 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

Hello,

On 7 May 2015 at 09:28, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> Hi Geert,
>
>> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>>
>> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> where is a device tree compiler that can compile an overlay?
>>>>
>>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>>> there is a syntax error as soon as the /plugin/ tag is present.
>>>
>>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>>>
>>> This does not apply cleanly to current DTC but the parts that fail are
>>> due to cosmetic changes in the code so I went ahead and applied it.
>>
>> Thanks for the link! That patch indeed requires some manual rework.
>>
>>> However, the created blob is not what the kernel can accept into
>>> of_overlay_create so what do I do with the blob to load it?
>>
>> Use "OF: DT-Overlay configfs interface" from Pantelis?
>>
>> That depends on "configfs: Implement binary attributes", also from Pantelis,
>> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
>> fold into its sole caller").
>>
>> All of the above require manual fixups to apply.
>>
>> Still have to try the actual loading, new to the overlay game on mainline
>> kernels (I did use it on boneblack with its original kernel and its overlay
>> manager).
>>
>
> Posted the patches recently, but for your convenience here’s the git tree.
>
> https://github.com/pantoniou/dtc/tree/dt-overlays5
>
> FWIW, I’ll post the capemgr patch today too.
>

I did not find those so tried loading the overlay by hand. FWIW like
the half dozen patches of this https://github.com/hramrach/linux-sunxi
are the overlay loading atm.

I can cat the overlay blob to sysfs and it creates a device so I guess
it basically works.

What I need to investigate is exporting some useful information about
the overlays in sysfs.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]                 ` <CAOMqctRPiPFtNAMBa5eZx=erL4xtohMxXAeFeMG-7KZaRxDnew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-07  8:09                   ` Pantelis Antoniou
       [not found]                     ` <67E0CBA3-C499-4A98-9F23-E228E334546D-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Pantelis Antoniou @ 2015-05-07  8:09 UTC (permalink / raw)
  To: Michal Suchanek; +Cc: Geert Uytterhoeven, devicetree

Hi Michal,

> On May 7, 2015, at 11:07 , Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> 
> Hello,
> 
> On 7 May 2015 at 09:28, Pantelis Antoniou
> <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
>> Hi Geert,
>> 
>>> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>>> 
>>> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>> where is a device tree compiler that can compile an overlay?
>>>>> 
>>>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>>>> there is a syntax error as soon as the /plugin/ tag is present.
>>>> 
>>>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>>>> 
>>>> This does not apply cleanly to current DTC but the parts that fail are
>>>> due to cosmetic changes in the code so I went ahead and applied it.
>>> 
>>> Thanks for the link! That patch indeed requires some manual rework.
>>> 
>>>> However, the created blob is not what the kernel can accept into
>>>> of_overlay_create so what do I do with the blob to load it?
>>> 
>>> Use "OF: DT-Overlay configfs interface" from Pantelis?
>>> 
>>> That depends on "configfs: Implement binary attributes", also from Pantelis,
>>> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
>>> fold into its sole caller").
>>> 
>>> All of the above require manual fixups to apply.
>>> 
>>> Still have to try the actual loading, new to the overlay game on mainline
>>> kernels (I did use it on boneblack with its original kernel and its overlay
>>> manager).
>>> 
>> 
>> Posted the patches recently, but for your convenience here’s the git tree.
>> 
>> https://github.com/pantoniou/dtc/tree/dt-overlays5
>> 
>> FWIW, I’ll post the capemgr patch today too.
>> 
> 
> I did not find those so tried loading the overlay by hand. FWIW like
> the half dozen patches of this https://github.com/hramrach/linux-sunxi
> are the overlay loading atm.
> 
> I can cat the overlay blob to sysfs and it creates a device so I guess
> it basically works.
> 
> What I need to investigate is exporting some useful information about
> the overlays in sysfs.
> 

If you were to share some details of what you’re trying to achieve I might be able to help.

I have no clue what you guys are trying to do :)

> Thanks
> 
> Michal

Regards

— Pantelis

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]                     ` <67E0CBA3-C499-4A98-9F23-E228E334546D-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
@ 2015-05-07  8:28                       ` Michal Suchanek
       [not found]                         ` <CAOMqctQUhV6=YyyZNT7Kzmd5pYYaYNxA2F+c9RCH98fUabzMUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07  8:28 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

On 7 May 2015 at 10:09, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> Hi Michal,
>
>> On May 7, 2015, at 11:07 , Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>
>> Hello,
>>
>> On 7 May 2015 at 09:28, Pantelis Antoniou
>> <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
>>> Hi Geert,
>>>
>>>> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqygBwfqmJ+zsg@public.gmane.orgg> wrote:
>>>>
>>>> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8@public.gmane.orgm> wrote:
>>>>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>>>> where is a device tree compiler that can compile an overlay?
>>>>>>
>>>>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>>>>> there is a syntax error as soon as the /plugin/ tag is present.
>>>>>
>>>>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>>>>>
>>>>> This does not apply cleanly to current DTC but the parts that fail are
>>>>> due to cosmetic changes in the code so I went ahead and applied it.
>>>>
>>>> Thanks for the link! That patch indeed requires some manual rework.
>>>>
>>>>> However, the created blob is not what the kernel can accept into
>>>>> of_overlay_create so what do I do with the blob to load it?
>>>>
>>>> Use "OF: DT-Overlay configfs interface" from Pantelis?
>>>>
>>>> That depends on "configfs: Implement binary attributes", also from Pantelis,
>>>> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
>>>> fold into its sole caller").
>>>>
>>>> All of the above require manual fixups to apply.
>>>>
>>>> Still have to try the actual loading, new to the overlay game on mainline
>>>> kernels (I did use it on boneblack with its original kernel and its overlay
>>>> manager).
>>>>
>>>
>>> Posted the patches recently, but for your convenience here’s the git tree.
>>>
>>> https://github.com/pantoniou/dtc/tree/dt-overlays5
>>>
>>> FWIW, I’ll post the capemgr patch today too.
>>>
>>
>> I did not find those so tried loading the overlay by hand. FWIW like
>> the half dozen patches of this https://github.com/hramrach/linux-sunxi
>> are the overlay loading atm.
>>
>> I can cat the overlay blob to sysfs and it creates a device so I guess
>> it basically works.
>>
>> What I need to investigate is exporting some useful information about
>> the overlays in sysfs.
>>
>
> If you were to share some details of what you’re trying to achieve I might be able to help.
>
> I have no clue what you guys are trying to do :)
>

I am trying to load overlays at runtime to see if that's usable for something.

For example, with the above tree I can load simple overlay like this
(the compatible and part number is not used for anything atm):

/dts-v1/;
/plugin/;

/ {
    compatible = "olimex,a10s-olinuxino-micro";

    /* identification */
    part-number = "A10S-SPI2";

    fragment@0 {
        target = <&spi2>;
        __overlay__ {
            #address-cells = <1>;
            #size-cells = <0>;
            flash: m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "nor-jedec";
                reg = <0>;
                spi-max-frequency = <40000000>;
                m25p,fast-read;
                   };
        };
    };
};

and it probes the flash and does not find any because I have none
attached. I can also destroy and reload the overlay so that works
nice. Loading the overlay twice without destroying it in between
causes kernel oops.

So presumably if I wired my display backlight to PWM I could write an
overlay for the PWM backlight and patch it in at runtime and possibly
test different settings by destroying the overlay and reloading an
updated one.

This is already good enough for testing even complex devices without
reboot provided the driver for them is compiled into the kernel.

With your node kprintf providing enough information about the overlays
so they can be identified should not be that difficult.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]                         ` <CAOMqctQUhV6=YyyZNT7Kzmd5pYYaYNxA2F+c9RCH98fUabzMUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-07 10:24                           ` Michal Suchanek
       [not found]                             ` <CAOMqctR5ZmgCQNqzoZv6hwAJ0h-r89fPabkK6hVCVeS2io7+Eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-05-07 13:18                           ` Michal Suchanek
  1 sibling, 1 reply; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07 10:24 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

Hello,

On 7 May 2015 at 10:28, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> On 7 May 2015 at 10:09, Pantelis Antoniou
> <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
>> Hi Michal,
>>
>>> On May 7, 2015, at 11:07 , Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>
>>> Hello,
>>>
>>> On 7 May 2015 at 09:28, Pantelis Antoniou
>>> <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
>>>> Hi Geert,
>>>>

>>>> Posted the patches recently, but for your convenience here’s the git tree.
>>>>
>>>> https://github.com/pantoniou/dtc/tree/dt-overlays5
>>>>
>>>> FWIW, I’ll post the capemgr patch today too.
>>>>
>>>
>>> I did not find those so tried loading the overlay by hand. FWIW like
>>> the half dozen patches of this https://github.com/hramrach/linux-sunxi
>>> are the overlay loading atm.
>>>
>>> I can cat the overlay blob to sysfs and it creates a device so I guess
>>> it basically works.
>>>
>>> What I need to investigate is exporting some useful information about
>>> the overlays in sysfs.
>>>
>>
>> If you were to share some details of what you’re trying to achieve I might be able to help.
>>
>> I have no clue what you guys are trying to do :)
>>
>
> I am trying to load overlays at runtime to see if that's usable for something.

So I tried to cherry-pick some more of your patches and I have a few
observations.

I tried to use the new node formatter for debug prints and on loading
the spi nor overlay I get this:
[  181.805666]  -> unflatten_device_tree()
[  181.805686] Unflattening device tree:
[  181.805698] magic: d00dfeed
[  181.805705] size: 0000026b
[  181.805711] version: 00000011
[  181.805748]   size is 7f4, allocating...
[  181.805761]   unflattening d9ff5800...
[  181.805773] fixed up name for  ->
[  181.805850] fixed up name for fragment@0 -> fragment
[  181.805866] fixed up name for __overlay__ -> __overlay__
[  181.805884] fixed up name for m25p80@0 -> m25p80
[  181.805901] fixed up name for __symbols__ -> __symbols__
[  181.805915] fixed up name for __fixups__ -> __fixups__
[  181.805926] unflattened tree is detached
[  181.805932]  <- unflatten_device_tree()
[  181.806025] __of_adjust_tree_phandles: /|0||0| (): invalid phandle 0
[  181.806044] __of_adjust_tree_phandles:
/fragment@0|0|fragment|0|fragment (fragment): invalid phandle 0
[  181.806058] __of_adjust_tree_phandles:
/fragment@0/__overlay__|0|__overlay__|0|__overlay__ (__overlay__):
invalid phandle 0
[  181.806073] __of_adjust_tree_phandles: adjusting
/fragment@0/__overlay__/m25p80@0|1 (m25p80) +111
[  181.806093] __of_adjust_tree_phandles:
/__symbols__|0|__symbols__|0|__symbols__ (__symbols__): invalid
phandle 0
[  181.806109] __of_adjust_tree_phandles:
/__fixups__|0|__fixups__|0|__fixups__ (__fixups__): invalid phandle 0
[  181.806181] of_resolve_phandles: spi2 phandle is 0x00000045
[  181.806190] __of_adjust_phandle_ref: , spi2, 69
[  181.806960] of_fill_overlay_info: info for /fragment@0|0 (fragment)
[  181.806982]  overlay /fragment@0/__overlay__|0 (__overlay__)
[  181.807035]  target /soc@01c00000/spi@01c17000|69 (spi)
[  181.807046] of_fill_overlay_info: info for /__symbols__|0 (__symbols__)
[  181.807059] of_fill_overlay_info: info for /__fixups__|0 (__fixups__)
[  181.808569] spi spi2.0: setup mode 0, 8 bits/w, 40000000 Hz max --> 0
[  181.811670] spi_master spi2: Using PIO mode for transfer
[  181.811994] spi_master spi2: Using PIO mode for transfer
[  181.823587] m25p80 spi2.0: unrecognized JEDEC id bytes: 00,  0,  0
[  181.828741] m25p80: probe of spi2.0 failed with error -2
[  181.832920] sun4i-spi 1c17000.spi: registered child spi2.0

I believe that I use the formatter correctly given that m25p80 node is
formatted ok. So it fails to format the fragment, fixups and overlay
nodes for some reason. Note that at a later time the fixups node
appears correctly formatted so this may be due to the formatter being
used during tree resolving.

When I cat /sys/firmware/devicetree/overlays/0/targets the kernel
detects a deadlock. /sys/firmware/devicetree/overlay-control/list
provides same information without deadlock but I am not sure I have
everything locked properly.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]                         ` <CAOMqctQUhV6=YyyZNT7Kzmd5pYYaYNxA2F+c9RCH98fUabzMUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2015-05-07 10:24                           ` Michal Suchanek
@ 2015-05-07 13:18                           ` Michal Suchanek
  1 sibling, 0 replies; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07 13:18 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

On 7 May 2015 at 10:28, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

> and it probes the flash and does not find any because I have none
> attached. I can also destroy and reload the overlay so that works
> nice. Loading the overlay twice without destroying it in between
> causes kernel oops.

ok, I found the oops cause. I have to check for invalid blobs in the
sysfs handler.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]                             ` <CAOMqctR5ZmgCQNqzoZv6hwAJ0h-r89fPabkK6hVCVeS2io7+Eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-05-07 13:22                               ` Michal Suchanek
  0 siblings, 0 replies; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07 13:22 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

On 7 May 2015 at 12:24, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hello,
>
> On 7 May 2015 at 10:28, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> On 7 May 2015 at 10:09, Pantelis Antoniou
>> <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:

>>> If you were to share some details of what you’re trying to achieve I might be able to help.
>>>
>>> I have no clue what you guys are trying to do :)
>>>
>>
>> I am trying to load overlays at runtime to see if that's usable for something.
>
> So I tried to cherry-pick some more of your patches and I have a few
> observations.
>

>
> When I cat /sys/firmware/devicetree/overlays/0/targets the kernel
> detects a deadlock. /sys/firmware/devicetree/overlay-control/list
> provides same information without deadlock but I am not sure I have
> everything locked properly.
>

For some reason it deadlocks against the dt unittests which never
finish. So the workaround is to disable unittests. Why the unittest
locks up needs investigating, though.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: device tree compiler with overlay support?
       [not found]             ` <E8C27FD0-CF22-4D8F-AC05-55518BEF4B84-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
  2015-05-07  8:07               ` Michal Suchanek
@ 2015-05-07 14:57               ` Michal Suchanek
  1 sibling, 0 replies; 13+ messages in thread
From: Michal Suchanek @ 2015-05-07 14:57 UTC (permalink / raw)
  To: Pantelis Antoniou; +Cc: Geert Uytterhoeven, devicetree

On 7 May 2015 at 09:28, Pantelis Antoniou
<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> wrote:
> Hi Geert,
>
>> On May 7, 2015, at 10:17 , Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
>>
>> On Tue, May 5, 2015 at 6:51 PM, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> On 5 May 2015 at 17:18, Michal Suchanek <hramrach-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> where is a device tree compiler that can compile an overlay?
>>>>
>>>> The compiler at git://git.kernel.org/pub/scm/utils/dtc/dtc.git shrieks
>>>> there is a syntax error as soon as the /plugin/ tag is present.
>>>
>>> ok, so I found a dtc patch here https://lkml.org/lkml/2013/1/4/295
>>>
>>> This does not apply cleanly to current DTC but the parts that fail are
>>> due to cosmetic changes in the code so I went ahead and applied it.
>>
>> Thanks for the link! That patch indeed requires some manual rework.
>>
>>> However, the created blob is not what the kernel can accept into
>>> of_overlay_create so what do I do with the blob to load it?
>>
>> Use "OF: DT-Overlay configfs interface" from Pantelis?
>>
>> That depends on "configfs: Implement binary attributes", also from Pantelis,
>> which requires reverting commit 28444a2bde8d1695i ("configfs_add_file:
>> fold into its sole caller").
>>
>> All of the above require manual fixups to apply.
>>
>> Still have to try the actual loading, new to the overlay game on mainline
>> kernels (I did use it on boneblack with its original kernel and its overlay
>> manager).
>>
>
> Posted the patches recently, but for your convenience here’s the git tree.
>
> https://github.com/pantoniou/dtc/tree/dt-overlays5
>
> FWIW, I’ll post the capemgr patch today too.

FWIW here is a separate branch with the dt overlay stuff I am running.

https://github.com/hramrach/linux-sunxi/commits/dt-overlay

You might want to look at the small fixes there.

It is worth noting that with your version of the patch adding -@ dtc
option the built board dtbs do not contain the symbols needed for
overlays unless overlays are enabled. So far dtbs were static wrt
build options AFAIK. That is they were either built or not but unless
the sources in question changed the dtbs would be the same.
Introducing this option dynamically based on CONFIG_OF_OVERLAY makes
dtbs content config dependent which does not seem like a very good
idea.

In fact I think -@ should be the default on compilers that support it
and might be optionally turned off.

Maybe some statistic of the size of the symbol table so generated and
relative size increase  for various boards might be nice thing to
have.

Thanks

Michal
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2015-05-07 14:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-05 15:18 device tree compiler with overlay support? Michal Suchanek
     [not found] ` <CAOMqctSZObmoJQocCg3JvCA=ZDvvrxzKC9Ko=aq0J=LphNW+EA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-05 16:51   ` Michal Suchanek
     [not found]     ` <CAOMqctT3WuqMTqaqUTN44zA2TEYmP9X7SN8ufTouQFoy=GjB1Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-06 17:18       ` Michal Suchanek
2015-05-07  7:17       ` Geert Uytterhoeven
     [not found]         ` <CAMuHMdU=WySZ8kfaVmU6Bed=ofvrDQ9s51m7zyXN0qu-G-d4cg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-07  7:28           ` Pantelis Antoniou
     [not found]             ` <E8C27FD0-CF22-4D8F-AC05-55518BEF4B84-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-05-07  8:07               ` Michal Suchanek
     [not found]                 ` <CAOMqctRPiPFtNAMBa5eZx=erL4xtohMxXAeFeMG-7KZaRxDnew-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-07  8:09                   ` Pantelis Antoniou
     [not found]                     ` <67E0CBA3-C499-4A98-9F23-E228E334546D-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2015-05-07  8:28                       ` Michal Suchanek
     [not found]                         ` <CAOMqctQUhV6=YyyZNT7Kzmd5pYYaYNxA2F+c9RCH98fUabzMUg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-07 10:24                           ` Michal Suchanek
     [not found]                             ` <CAOMqctR5ZmgCQNqzoZv6hwAJ0h-r89fPabkK6hVCVeS2io7+Eg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-05-07 13:22                               ` Michal Suchanek
2015-05-07 13:18                           ` Michal Suchanek
2015-05-07 14:57               ` Michal Suchanek
2015-05-07  7:48           ` Pantelis Antoniou

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.