Created attachment 162478 [details] pandaboard dts sh -c 'MACHINE=arm /scratch/tmp/emaste/freebsd/sys/tools/fdt/make_dtb.sh /scratch/tmp/emaste/freebsd/sys pandaboard.dts /scratch/tmp/emaste/obj/arm.armv6/scratch/tmp/emaste/freebsd/sys/PANDABOARD' converting pandaboard.dts -> /scratch/tmp/emaste/obj/arm.armv6/scratch/tmp/emaste/freebsd/sys/PANDABOARD/pandaboard.dtb Error on line 102: Expected numbers in array of cells interrupts = <1 13 (((3) << 8) | 4)>; ^ Error on line 102: Expected ; at end of property interrupts = <1 13 (((3) << 8) | 4)>; ^ Failed to parse tree. Unhappy face! preprocessed file obtained with: cpp -P -x assembler-with-cpp -I sys/gnu/dts/include -I sys/boot/fdt/dts/arm -I sys/gnu/dts/arm -include sys/boot/fdt/dts/arm/pandaboard.dts /dev/null
Created attachment 162479 [details] dtb file generated with gpl'd dtc
ATMEL kernel conf fails the same way: Generating at91-sama5d3_xplained.dtb from at91-sama5d3_xplained.dts converting at91-sama5d3_xplained.dts -> /scratch/tmp/emaste/obj/arm.arm/scratch/tmp/emaste/freebsd/sys/ATMEL/modules/scratch/tmp/emaste/freebsd/sys/modules/dtb/atmel/at91-sama5d3_xplained.dtb Error on line 127: Expected numbers in array of cells dmas = <&dma0 2 (0 & (0xff))>; ^ Error on line 127: Expected ; at end of property dmas = <&dma0 2 (0 & (0xff))>; ^ Failed to parse tree. Unhappy face! *** [at91-sama5d3_xplained.dtb] Error code 1
I've pushed some fixes to dtc here: https://github.com/davidchisnall/dtc I believe that they address this bug and also #204042. Please can you test (in particular, compile the output of `dtc -I dts -O dts` on both the GPL and BSDL dtc implementations and see if they differ) and let me know if there are any issues? Pre-commit review on GitHub before I push to svn would also be appreciated.
Created attachment 164781 [details] dtb from gnu dtc
Created attachment 164782 [details] dtb from bsd dtc
The errors are indeed gone in the latest version from GitHub, although the produced dtb output differs between the GNU and BSD dtc.
(In reply to Ed Maste from comment #6) Thanks. That looks as if it's an issue in merging. I'll take a look. In future, is it possible for you to upload the generated dts (`-O dts` instead of `-O dtb` on the command lines)?
Ooops, I was comparing against an older version of some of the include files. The only differences in the assignment of phandle numbers (BSD DTC assigns them in order of first reference, GPL DTC assigns them in order of first definition). As these are effectively pointers, it shouldn't matter. Do you want to look at the code on GitHub, or should I just commit it?
With the latest version on GitHub, both dtc implementations generate byte-for-byte identical dts output from the pandaboard dts. BSDL DTC appears to lose the null terminators on the property values in the aliases section when generating dtb output.
The generated dtb files from the two versions are still not identical, however the .dts files generated from the two .dtb files by either tool are identical. I take this to mean that we're now able to generate a correct dtb from this dts.
> Do you want to look at the code on GitHub, or should I just commit it? I intend to give the code on GitHub a look over the holidays still.
> I intend to give the code on GitHub a look over the holidays still. On second thought, it's probably best to just commit to HEAD, since this change is an improvement and it's not enabled by default at present. I can still take a look either in GitHub or in HEAD.
Committed to head.