On Fri, Dec 13, 2013 at 05:49:09PM +0100, Tomasz Figa wrote: > This series intends to extend dtc with appropriate infrastructure > to handle property data types. First, dtc is modified to preserve > type information when parsing DTS. Then type guessing is implemented > for flat and fs trees where type data is not available. After that, > DTS generation code is modified to use only type information when > printing property data. Hrm. I think this is completely backwards to the right approach. For dt checking what we want is a schema. That can specify datatypes amongst other constraints, but in the end you can check the actual bytes of the DT against the constraints imposed by the schema, regardless of how those bytes are presented to the checker. By adding type information to the in-flight tree you're checking not the actual content of the DT, but how you've chosen to express that information in DTS format. More concretely, we should be able to schema-check trees in binary format, not just source. With these patches that will fail if -I dtb makes the wrong type guesses. > Effect of this is the ability to implement checks for data types > of properties. Also, as a side effect, it's now possible to do > almost 1:1 dts <=> dts passes (not very useful, but shows that > things are working well). > > Tomasz Figa (3): > dtc: Keep type information from DTS > dtc: Inject guessed type information in case of flat and fs trees > dtc: Use type information when printing tree source > > data.c | 62 +++++++++++++++++++++++- > dtc-parser.y | 47 ++++++++++++++----- > dtc.h | 12 +++++ > flattree.c | 2 +- > fstree.c | 6 ++- > livetree.c | 16 +++++-- > treesource.c | 150 +++++++++++++++++++++++++++++++++-------------------------- > 7 files changed, 209 insertions(+), 86 deletions(-) > -- David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Attachment:
pgpfvOdM4NDLi.pgp
Description: PGP signature