Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-09-08 Thread David Chisnall
On 24 Jul 2016, at 12:42, David Chisnall  wrote:
> 
> I’ve now fixed both of these in the version here:
> 
> https://github.com/davidchisnall/dtc

Andy filed a number of issues on GitHub, which are now all fixed.  In 
particular, /include/ should now work everywhere and /delete-node/ now works.

I’ve added a CMake build system and tests to the version on GitHub, which 
should make it easier for people to build out of tree (for example, in a port).

Please file issues as you find them.  I hope to look at the overlay stuff soon. 
 I believe that the support that it requires from dtc is relatively small.

I hope to find time to look at overlay support soon,

David



smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-24 Thread David Chisnall
Thanks,

On 19 Jul 2016, at 20:49, Emmanuel Vadot  wrote:
> 
> 
> Hello,
> 
> I've just tried bsd dtc on all arm dts that we have.
> It doesn't seems to handle multiple include directories.
> Here is how to reproduce :
> 
> $ export SRCROOT=/path/to/fbsd/src
> $ export MACHINE=arm
> $ cd $SRCROOT/sys/boot/fdt/dts/arm
> $ $SRCROOT/sys/tools/fdt/make_dtb.sh $SRCROOT/sys
> beaglebone-black.dts . converting beaglebone-black.dts
> -> ./beaglebone-black.dtb Unable to open file
> '/home/elbarto/Work/freebsd/freebsd.git//sys/boot/fdt/dts/arm/am33xx-clocks.dtsi'.
> No such file or directory Unable to open file
> '/home/elbarto/Work/freebsd/freebsd.git//sys/boot/fdt/dts/arm/tps65217.dtsi'.
> No such file or directory
> 
> Both dtsi files are include with /include/ (i.e. not handled by cpp).
> make_dtb.sh specify : -i $S/boot/fdt/dts/${MACHINE} -i
> $S/gnu/dts/${MACHINE}, it looks like the second one isn't added to the
> list.

It actually is added to the list and found.  The bug here is in error reporting 
- it was reporting an error for each file that it tried to open but couldn’t, 
even when it subsequently found the correct file.

> 
> Trying tegra124-jetson-tk1-fbsd.dts give this :
> converting tegra124-jetson-tk1-fbsd.dts
> -> /tmp/bsd_dtb//tegra124-jetson-tk1-fbsd.dtb Error on line 1214:
> Expected node name interrupt-affinity = <&{/cpus/cpu@0}>,
> ^
> Error on line 1214: Expected ; at end of property
>  interrupt-affinity = <&{/cpus/cpu@0}>,
> ^
> Failed to parse tree.  Unhappy face!

There was a FIXME relating to this in the code.  

I’ve now fixed both of these in the version here:

https://github.com/davidchisnall/dtc

I’ll push the changes to FreeBSD svn soon, but in the meantime anyone wanting 
to test can just clone that repo over the dtc directory in their src checkout.

David



smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-23 Thread Emmanuel Vadot
On Fri, 22 Jul 2016 22:16:41 -0600
Warner Losh  wrote:

> On Fri, Jul 22, 2016 at 1:03 AM, David Chisnall  wrote:
> > On 22 Jul 2016, at 03:40, Warner Losh  wrote:
> >>
> >> On Wed, Jul 20, 2016 at 9:51 AM, David Chisnall  
> >> wrote:
> >>> On 20 Jul 2016, at 16:46, Warner Losh  wrote:
> 
>  I've been trying to get the final spec for it. Right now it's a
>  disorganized series
>  of patches, some of which have been merge some that haven't. I'll send 
>  you a
>  copy when I can find something better than "here's the code."
> >>>
> >>> Thanks.  From the information I can find, it looks as if most of the 
> >>> machinery required to implement it is already in dtc, so it should 
> >>> (hopefully) just be a matter of adding a new keyword to detect plugins, a 
> >>> scan to find the cross-references (or possibly reusing the existing one) 
> >>> and then a little bit of extra logic.
> >>
> >> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
> >> has the specs.
> >
> > Hmm, that?s even less complete than the docs that I?d found.
> 
> Can you share that then?
> 
> >From that, it seems as if the only thing that dtc needs to do is support the 
> >/plugin/ syntax and emit a section describing unresolved references?
> 
> I believe so, yes.
> 
> >Or is dtc also expected to be able to do the merging?
> 
> I think that's TBD. We'll need, at the very least, an update libfdt
> from upstream that knows how to do the merging, as well as changes to
> /boot/loader to be able to pick and choose which plugins to add to the
> base. If we can do all that with the BSDL DTC and it passes all the
> other GPL test cases, then we may have a winner and we can get started
> integrating plugin support to /boot/loader. I know my RPi would be
> happier if it had a 'standard' DTB with a plugin for whatever 1-wire
> stuff I'm playing with today.
> 
> Warner

 ubldr already support dtb overlays as of r298821.
 Also support might come to uboot directly soon.

-- 
Emmanuel Vadot
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-23 Thread David Chisnall
On 23 Jul 2016, at 05:16, Warner Losh  wrote:
> 
> On Fri, Jul 22, 2016 at 1:03 AM, David Chisnall  wrote:
>> On 22 Jul 2016, at 03:40, Warner Losh  wrote:
>>> 
>>> On Wed, Jul 20, 2016 at 9:51 AM, David Chisnall  
>>> wrote:
 On 20 Jul 2016, at 16:46, Warner Losh  wrote:
> 
> I've been trying to get the final spec for it. Right now it's a
> disorganized series
> of patches, some of which have been merge some that haven't. I'll send 
> you a
> copy when I can find something better than "here's the code."
 
 Thanks.  From the information I can find, it looks as if most of the 
 machinery required to implement it is already in dtc, so it should 
 (hopefully) just be a matter of adding a new keyword to detect plugins, a 
 scan to find the cross-references (or possibly reusing the existing one) 
 and then a little bit of extra logic.
>>> 
>>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
>>> has the specs.
>> 
>> Hmm, that’s even less complete than the docs that I’d found.
> 
> Can you share that then?

I only found tutorial-style things:

https://www.raspberrypi.org/documentation/configuration/device-tree.md

https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree/device-tree-overlays

I was hoping for something a bit more like a spec.


>> From that, it seems as if the only thing that dtc needs to do is support the 
>> /plugin/ syntax and emit a section describing unresolved references?
> 
> I believe so, yes.

That sounds like it should be easy.

> 
>> Or is dtc also expected to be able to do the merging?
> 
> I think that's TBD. We'll need, at the very least, an update libfdt
> from upstream that knows how to do the merging, as well as changes to
> /boot/loader to be able to pick and choose which plugins to add to the
> base. If we can do all that with the BSDL DTC and it passes all the
> other GPL test cases, then we may have a winner and we can get started
> integrating plugin support to /boot/loader. I know my RPi would be
> happier if it had a 'standard' DTB with a plugin for whatever 1-wire
> stuff I'm playing with today.

Patrick Wildt was running the GPL’d dtc test suite and I fixed all of the 
things that he reported broken.  We’re now using a less-efficient algorithm for 
calculating the cross-references so that we resolve things in the same order, 
which makes doing a diff on the dts produced by the two tools easier.

David



smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-22 Thread Warner Losh
On Fri, Jul 22, 2016 at 1:03 AM, David Chisnall  wrote:
> On 22 Jul 2016, at 03:40, Warner Losh  wrote:
>>
>> On Wed, Jul 20, 2016 at 9:51 AM, David Chisnall  wrote:
>>> On 20 Jul 2016, at 16:46, Warner Losh  wrote:

 I've been trying to get the final spec for it. Right now it's a
 disorganized series
 of patches, some of which have been merge some that haven't. I'll send you 
 a
 copy when I can find something better than "here's the code."
>>>
>>> Thanks.  From the information I can find, it looks as if most of the 
>>> machinery required to implement it is already in dtc, so it should 
>>> (hopefully) just be a matter of adding a new keyword to detect plugins, a 
>>> scan to find the cross-references (or possibly reusing the existing one) 
>>> and then a little bit of extra logic.
>>
>> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
>> has the specs.
>
> Hmm, that’s even less complete than the docs that I’d found.

Can you share that then?

>From that, it seems as if the only thing that dtc needs to do is support the 
>/plugin/ syntax and emit a section describing unresolved references?

I believe so, yes.

>Or is dtc also expected to be able to do the merging?

I think that's TBD. We'll need, at the very least, an update libfdt
from upstream that knows how to do the merging, as well as changes to
/boot/loader to be able to pick and choose which plugins to add to the
base. If we can do all that with the BSDL DTC and it passes all the
other GPL test cases, then we may have a winner and we can get started
integrating plugin support to /boot/loader. I know my RPi would be
happier if it had a 'standard' DTB with a plugin for whatever 1-wire
stuff I'm playing with today.

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"

Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-22 Thread David Chisnall
On 22 Jul 2016, at 03:40, Warner Losh  wrote:
> 
> On Wed, Jul 20, 2016 at 9:51 AM, David Chisnall  wrote:
>> On 20 Jul 2016, at 16:46, Warner Losh  wrote:
>>> 
>>> I've been trying to get the final spec for it. Right now it's a
>>> disorganized series
>>> of patches, some of which have been merge some that haven't. I'll send you a
>>> copy when I can find something better than "here's the code."
>> 
>> Thanks.  From the information I can find, it looks as if most of the 
>> machinery required to implement it is already in dtc, so it should 
>> (hopefully) just be a matter of adding a new keyword to detect plugins, a 
>> scan to find the cross-references (or possibly reusing the existing one) and 
>> then a little bit of extra logic.
> 
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
> has the specs.

Hmm, that’s even less complete than the docs that I’d found.  From that, it 
seems as if the only thing that dtc needs to do is support the /plugin/ syntax 
and emit a section describing unresolved references?  Or is dtc also expected 
to be able to do the merging?

David




smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-21 Thread Warner Losh
On Wed, Jul 20, 2016 at 9:51 AM, David Chisnall  wrote:
> On 20 Jul 2016, at 16:46, Warner Losh  wrote:
>>
>> I've been trying to get the final spec for it. Right now it's a
>> disorganized series
>> of patches, some of which have been merge some that haven't. I'll send you a
>> copy when I can find something better than "here's the code."
>
> Thanks.  From the information I can find, it looks as if most of the 
> machinery required to implement it is already in dtc, so it should 
> (hopefully) just be a matter of adding a new keyword to detect plugins, a 
> scan to find the cross-references (or possibly reusing the existing one) and 
> then a little bit of extra logic.

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/overlay-notes.txt
has the specs.

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-20 Thread David Chisnall
On 20 Jul 2016, at 16:46, Warner Losh  wrote:
> 
> I've been trying to get the final spec for it. Right now it's a
> disorganized series
> of patches, some of which have been merge some that haven't. I'll send you a
> copy when I can find something better than "here's the code."

Thanks.  From the information I can find, it looks as if most of the machinery 
required to implement it is already in dtc, so it should (hopefully) just be a 
matter of adding a new keyword to detect plugins, a scan to find the 
cross-references (or possibly reusing the existing one) and then a little bit 
of extra logic.

David



smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-20 Thread Warner Losh
On Wed, Jul 20, 2016 at 3:05 AM, David Chisnall  wrote:
> On 20 Jul 2016, at 05:48, Warner Losh  wrote:
>>
>> My concern with this is overlay support. Overlay support for "shields" or
>> "badges" is going into upstream GPL dtc shortly. The patches have been
>> kicking around for a while and are almost ready to go in. We need this 
>> feature
>> and I'd planned on bringing it into the tree as soon as it goes into the git
>> repo. It's sorely needed for things like RPi and BBB that make it super
>> easy to add boards with parts that need a bit more DTB into the FDT to
>> describe them. There's been patches to bring this functionality into the
>> loader and into the in-tree gpl dtc floating around for a while now.
>
> Is the syntax / semantics for overlays documented somewhere?
>
> David
>
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-20 Thread Warner Losh
On Wed, Jul 20, 2016 at 9:45 AM, Warner Losh  wrote:
> On Wed, Jul 20, 2016 at 3:05 AM, David Chisnall  wrote:
>> On 20 Jul 2016, at 05:48, Warner Losh  wrote:
>>>
>>> My concern with this is overlay support. Overlay support for "shields" or
>>> "badges" is going into upstream GPL dtc shortly. The patches have been
>>> kicking around for a while and are almost ready to go in. We need this 
>>> feature
>>> and I'd planned on bringing it into the tree as soon as it goes into the git
>>> repo. It's sorely needed for things like RPi and BBB that make it super
>>> easy to add boards with parts that need a bit more DTB into the FDT to
>>> describe them. There's been patches to bring this functionality into the
>>> loader and into the in-tree gpl dtc floating around for a while now.
>>
>> Is the syntax / semantics for overlays documented somewhere?

I've been trying to get the final spec for it. Right now it's a
disorganized series
of patches, some of which have been merge some that haven't. I'll send you a
copy when I can find something better than "here's the code."

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-20 Thread David Chisnall
On 20 Jul 2016, at 05:48, Warner Losh  wrote:
> 
> My concern with this is overlay support. Overlay support for "shields" or
> "badges" is going into upstream GPL dtc shortly. The patches have been
> kicking around for a while and are almost ready to go in. We need this feature
> and I'd planned on bringing it into the tree as soon as it goes into the git
> repo. It's sorely needed for things like RPi and BBB that make it super
> easy to add boards with parts that need a bit more DTB into the FDT to
> describe them. There's been patches to bring this functionality into the
> loader and into the in-tree gpl dtc floating around for a while now.

Is the syntax / semantics for overlays documented somewhere?

David



smime.p7s
Description: S/MIME cryptographic signature


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-19 Thread Warner Losh
On Tue, Jul 19, 2016 at 1:12 PM, Ed Maste  wrote:
> dtc(1) is the Device Tree Compiler, used for embedded builds. We have
> two versions of dtc(1) in the FreeBSD tree: a GPLv2 one from
> https://git.kernel.org/cgit/utils/dtc/dtc.git and a BSD licensed one
> in https://svn.freebsd.org/base/head/usr.bin/dtc.
>
> We switched back to the GPL one since device tree files in the most
> recent import required features not available in our own at the time.
> However, as of r292876 the BSD licensed dtc(1) is functional and we
> should be able to switch back to it.
>
> I would encourage embedded users (primarily ARM boards) to test with
> WITHOUT_GPL_DTC in /etc/src.conf and report their success or failure.

My concern with this is overlay support. Overlay support for "shields" or
"badges" is going into upstream GPL dtc shortly. The patches have been
kicking around for a while and are almost ready to go in. We need this feature
and I'd planned on bringing it into the tree as soon as it goes into the git
repo. It's sorely needed for things like RPi and BBB that make it super
easy to add boards with parts that need a bit more DTB into the FDT to
describe them. There's been patches to bring this functionality into the
loader and into the in-tree gpl dtc floating around for a while now.

I know that the BSDL compiler doesn't support this. I know from painful
experience that the BSDL compiler is quite hard to fix grammar items
for since it doesn't use yacc, but uses a hand-coded parser / lexer. If
support could be added for this to that, we can throw the switch. Otherwise,
I don't think that it would be wise to switch.

Last time I ran my tests on the BSDL compiler, it failed a few of them. I'll
re-run to see if things have improved since I last checked it out and report
any failures here.

Warner
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-19 Thread Emmanuel Vadot

 Hello,

 I've just tried bsd dtc on all arm dts that we have.
 It doesn't seems to handle multiple include directories.
 Here is how to reproduce :

 $ export SRCROOT=/path/to/fbsd/src
 $ export MACHINE=arm
 $ cd $SRCROOT/sys/boot/fdt/dts/arm
 $ $SRCROOT/sys/tools/fdt/make_dtb.sh $SRCROOT/sys
beaglebone-black.dts . converting beaglebone-black.dts
-> ./beaglebone-black.dtb Unable to open file
'/home/elbarto/Work/freebsd/freebsd.git//sys/boot/fdt/dts/arm/am33xx-clocks.dtsi'.
No such file or directory Unable to open file
'/home/elbarto/Work/freebsd/freebsd.git//sys/boot/fdt/dts/arm/tps65217.dtsi'.
No such file or directory

 Both dtsi files are include with /include/ (i.e. not handled by cpp).
 make_dtb.sh specify : -i $S/boot/fdt/dts/${MACHINE} -i
$S/gnu/dts/${MACHINE}, it looks like the second one isn't added to the
list.

 Trying tegra124-jetson-tk1-fbsd.dts give this :
converting tegra124-jetson-tk1-fbsd.dts
-> /tmp/bsd_dtb//tegra124-jetson-tk1-fbsd.dtb Error on line 1214:
Expected node name interrupt-affinity = <&{/cpus/cpu@0}>,
 ^
Error on line 1214: Expected ; at end of property
  interrupt-affinity = <&{/cpus/cpu@0}>,
 ^
Failed to parse tree.  Unhappy face!

 Cheers,

On Tue, 19 Jul 2016 15:12:02 -0400
Ed Maste  wrote:

> dtc(1) is the Device Tree Compiler, used for embedded builds. We have
> two versions of dtc(1) in the FreeBSD tree: a GPLv2 one from
> https://git.kernel.org/cgit/utils/dtc/dtc.git and a BSD licensed one
> in https://svn.freebsd.org/base/head/usr.bin/dtc.
> 
> We switched back to the GPL one since device tree files in the most
> recent import required features not available in our own at the time.
> However, as of r292876 the BSD licensed dtc(1) is functional and we
> should be able to switch back to it.
> 
> I would encourage embedded users (primarily ARM boards) to test with
> WITHOUT_GPL_DTC in /etc/src.conf and report their success or failure.
> 
> -Ed
> ___
> freebsd-current@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-current
> To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


-- 
Emmanuel Vadot
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Call for Testing: Switching back to our BSD licensed dtc(1)

2016-07-19 Thread Ed Maste
dtc(1) is the Device Tree Compiler, used for embedded builds. We have
two versions of dtc(1) in the FreeBSD tree: a GPLv2 one from
https://git.kernel.org/cgit/utils/dtc/dtc.git and a BSD licensed one
in https://svn.freebsd.org/base/head/usr.bin/dtc.

We switched back to the GPL one since device tree files in the most
recent import required features not available in our own at the time.
However, as of r292876 the BSD licensed dtc(1) is functional and we
should be able to switch back to it.

I would encourage embedded users (primarily ARM boards) to test with
WITHOUT_GPL_DTC in /etc/src.conf and report their success or failure.

-Ed
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"