[PATCH v4 3/3] dtc: Add support for variable sized elements

Anton Staaf robotboy at chromium.org
Wed Oct 12 02:12:55 EST 2011


On Tue, Oct 11, 2011 at 7:44 AM, David Gibson
<david at gibson.dropbear.id.au> wrote:
> On Tue, Sep 27, 2011 at 11:11:38AM -0700, Anton Staaf wrote:
>> Elements of size 8, 16, 32, and 64 bits are supported.  The new
>> /bits/ syntax was selected so as to not pollute the reserved
>> keyword space with uint8/uint16/... type names.
>>
>> With this patch the following property assignment:
>>
>>     property = /bits/ 16 <0x1234 0x5678 0x0 0xffff>;
>>
>> is equivalent to:
>>
>>     property = <0x12345678 0x0000ffff>;
>>
>> It is now also possible to directly specify a 64 bit literal in a
>> cell list, also known as an array using:
>>
>>     property = /bits/ 64 <0xdeadbeef00000000>;
>>
>> It is an error to attempt to store a literal into an element that is
>> too small to hold the literal, and the compiler will generate an
>> error when it detects this.  For instance:
>>
>>     property = /bits/ 8 <256>;
>>
>> Will fail to compile.  It is also an error to attempt to place a
>> reference in a non 32-bit element.
>>
>> The documentation has been changed to reflect that the cell list
>> is now an array of elements that can be of sizes other than the
>> default 32-bit cell size.
>>
>> The sized_cells test tests the creation and access of 8, 16, 32,
>> and 64-bit sized elements.  It also tests that the creation of two
>> properties, one with 16 bit elements and one with 32 bit elements
>> result in the same property contents.
>>
>> Signed-off-by: Anton Staaf <robotboy at chromium.org>
>
> What the hell, I think I've convinced myself that /bits/ is good
> enough.

Thanks David, I haven't thought of anything more appropriate either.
I'm looking forward to getting this landed.  :)

-Anton

> Acked-by: David Gibson <david at gibson.dropbear.id.au>
>
> --
> 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
>


More information about the devicetree-discuss mailing list