qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/2] device_tree: Add qemu_devtree_setprop_sized


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 1/2] device_tree: Add qemu_devtree_setprop_sized_cells() utility function
Date: Mon, 24 Jun 2013 12:02:39 +0100

On 24 June 2013 11:56, Alexander Graf <address@hidden> wrote:
> On 24.06.2013, at 12:22, Peter Maydell wrote:
>> We already have a qemu_devtree_setprop_cells() which sets a dtb
>> property to an array of cells whose values are specified by varargs.
>> However for the fairly common case of setting a property to a list
>> of addresses or of address,size pairs the number of cells used by
>> each element in the list depends on the parent's #address-cells
>> and #size-cells properties. To make this easier we provide an analogous
>> qemu_devtree_setprop_sized_cells() function which allows the number
>> of cells used by each element to be specified.
>>
>> Signed-off-by: Peter Maydell <address@hidden>
>
> This looks pretty complicated for something actually quite
> simple: All you want is to pass in a number of 64bit values,
> rather than 32bit ones, right?

Nope. If the device tree blob says #address-cells is 1
and #size-cells is 1, then I want to pass in values to
go in 32 bit cells. If it says #address-cells is 2 but
#size-cells is still 1, then I want to pass in a value
for a 64 bit cell then one for a 32 bit cell. If they're
both 2 then I want to pass in values for two 64 bit
cells. It's pretty complicated because the device tree
spec is pretty complicated (if it had just mandated
64 bit addr/size everywhere then this would be easy).

-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]