Re: [PATCH v3 2/2] Preserve datatype markers when emitting dts format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Sun, Jun 17, 2018 at 7:36 PM, David Gibson
<david@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, May 15, 2018 at 05:42:55PM -0500, Rob Herring wrote:
>> From: Grant Likely <grant.likely@xxxxxxx>
>>
>> If datatype markers are present in the property value, use them to
>> output the data in the correct format instead of trying to guess the
>> datatype. This also will preserve data grouping, such as in an
>> interrupts list.
>>
>> This is a step forward for preserving and using datatype information
>> when processing DTS/DTB files. Schema validation tools can use the
>> datatype information to make sure a DT is correctly formed and
>> intepreted.
>>
>> Signed-off-by: Grant Likely <grant.likely@xxxxxxx>
>> [robh: rework marker handling and fix label output]
>> Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
>> ---
>> v3:
>> - Fixed the label output handling. The code previously was dropping and
>>   misplacing labels in the output as it was dependent on the order of
>>   the markers.
>> - Re-factor code handling for no marker case. (Simon, not sure if this
>>   is what you had in mind.
>> - Added a test case.
>> - Support outputting '\0' as-is if the input has '\0'
>> - Drop unneeded (width - 1) in calculating the data end
>> - Fixed some style nits
>>
>>  dtc.h              |   1 +
>>  tests/markers.dts  |  28 ++++++
>>  tests/run_tests.sh |   7 ++
>>  treesource.c       | 221 +++++++++++++++++++++++++++------------------
>>  4 files changed, 167 insertions(+), 90 deletions(-)
>>  create mode 100644 tests/markers.dts
>>
>> diff --git a/dtc.h b/dtc.h
>> index e648cdf0210b..806bbb804d58 100644
>> --- a/dtc.h
>> +++ b/dtc.h
>> @@ -74,6 +74,7 @@ typedef uint32_t cell_t;
>>
>>  /* Data blobs */
>>  enum markertype {
>> +     MARKER_NONE,
>
> So, the other type markers were fixed in the previous patch, but this
> one still has the tautological MARKER_NONE name.

What would you like then?

>
>>       REF_PHANDLE,
>>       REF_PATH,
>>       LABEL,
>> diff --git a/tests/markers.dts b/tests/markers.dts
>> new file mode 100644
>> index 000000000000..62c0c235087a
>> --- /dev/null
>> +++ b/tests/markers.dts
>
> Not a great name for this test file.  It's not really about markers,
> which have a bunch of different uses, but about preservation of type
> information.

type-preservation.dts?

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



[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux