Re: [PATCH v4 3/5] Mention pylibfdt in the documentation

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



Hi David,

On 9 February 2017 at 21:58, David Gibson <david@xxxxxxxxxxxxxxxxxxxxx> wrote:
> On Sun, Feb 05, 2017 at 01:13:21PM -0700, Simon Glass wrote:
>> Add a note about pylibfdt in the README.
>>
>> Signed-off-by: Simon Glass <sjg@xxxxxxxxxxxx>
>> ---
>>
>> Changes in v4: None
>> Changes in v3: None
>> Changes in v2:
>> - Add details on how to obtain full help and code coverage
>>
>>  README | 33 +++++++++++++++++++++++++++++++++
>>  1 file changed, 33 insertions(+)
>>
>> diff --git a/README b/README
>> index f92008f..7191d1b 100644
>> --- a/README
>> +++ b/README
>> @@ -7,6 +7,39 @@ DTC and LIBFDT are maintained by:
>>  David Gibson <david@xxxxxxxxxxxxxxxxxxxxx>
>>  Jon Loeliger <jdl@xxxxxxx>
>>
>> +
>> +Python library
>> +--------------
>> +
>> +A Python library is also available. To build this you will need to install
>> +swig and Python development files. On Debian distributions:
>> +
>> +   sudo apt-get install swig python-dev
>> +
>> +The library provides an Fdt class which you can use like this:
>> +
>> +    fdt = _ReadFdt('test_tree1.dtb')
>
> This seems to be using the test wrapper _ReadFdt(0 rather than the fdt
> class proper.
>
>> +    node = fdt.path_offset('/test-node')
>> +    prop = fdt.first_property_offset(node)
>> +    print 'Property name: %s' % fdt.string(prop.nameoff)
>> +    print 'Property data: %s' % fdt.data(prop.nameoff)
>
> I think this is not quite up to date with the current version.
>
> In addition, I think the example would be more informative if you
> showed an interactive session, demonstrating how the offsets and
> property values are encoded as Python ints and strings.

OK, sounds good. I will revisit it once the interface is nailed down.
I can also expand this with a few more examples.

Regards,
Simon
--
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