Re: fdt_setprop comma-separated cells

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



On Wed, Sep 21, 2022 at 7:35 PM Radha Mohan Chintakuntla
<radhamohan.cta@xxxxxxxxx> wrote:
>
> Hi,
> Not sure if this right forum to discuss this issue.
> I have a requirement where I have to update the device tree property
> with comma-separated values. If I use fdt_setprop() and pass a
> 2-dimensional array then it is not creating the property with comma
> separation. Instead I get all the values in same cell separated by
> space.

'cell' in DT terms means a uint32 value, but I gather here you mean
values within '<>' brackets. The brackets are part of dts syntax and
are irrelevant for dtb. Values in a dtb are just a byte array. dtc
will do some guessing of types (e.g. divisible by 4 or ascii), but
that's it.

> Is there any other way this should be done?
> I have referred to some uboot code that used libfdt and does same way
> as me but even that has the same problem.
>
> Any suggestions please?

The only way to get from a dtb to some output format with decoded
types without guessing is by knowing the type of every possible
property. dtc doesn't have this information. Fortunately, with
dtschema[1] we do and it can decode dtb files assuming it has a schema
for every property. dts as an output format is not supported though.
Only dumping the internal python representation is supported ATM.
dtb2py does this.

Rob

[1] https://github.com/devicetree-org/dt-schema/



[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