Re: fdt_setprop comma-separated cells

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



On Wed, Sep 21, 2022 at 05:35:19PM -0700, Radha Mohan Chintakuntla 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.
> 
> 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?

I'm afraid it looks like you have a miunderstanding about the
flattened tree format (a very common one, alas).

In the dtb, properties are simply bytestrings, there is no type
information.  You can only separate them into typed values by knowing
the binding which describes the format.  In other words, in the dtb
there is no such thing as "comma separation".  Commas in dts are
simply a way to notate concatenating bytestrings which can be
generated from integers, strings or whatever.

When using dtc in dtb -> dts mode, it applies some heuristics to guess
the right format to display things in.  However it does not - and
cannot - get this right all the time.

-- 
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

Attachment: signature.asc
Description: PGP signature


[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