Re: integer lost format from dtb to dts

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



On Sun, Apr 08, 2018 at 01:03:50AM +0000, Yuan, Linyu (NSB - CN/Shanghai) wrote:
> 
> 
> > -----Original Message-----
> > From: David Gibson [mailto:david@xxxxxxxxxxxxxxxxxxxxx]
> > Sent: Wednesday, April 04, 2018 6:31 PM
> > To: Rob Herring
> > Cc: Yuan, Linyu (NSB - CN/Shanghai); devicetree-spec@xxxxxxxxxxxxxxx; Jon
> > Loeliger; Devicetree Compiler
> > Subject: Re: integer lost format from dtb to dts
> > 
> > On Tue, Apr 03, 2018 at 01:49:46PM -0500, Rob Herring wrote:
> > > On Mon, Apr 2, 2018 at 4:15 AM, Yuan, Linyu (NSB - CN/Shanghai)
> > > <linyu.yuan@xxxxxxxxxxxxxxx> wrote:
> > > > Hi all,
> > > >
> > > > When use dtc to compile dtb to dts, always lost integer format,
> > > > For example, clock frequency, normally it should not print as hexadecimal,
> > other issue from my view is integer lower than 255, normally should not print
> > as hexadecimal too.
> > > >
> > > > Any good method to solve this issue ?
> > >
> > > No. The dtb format doesn't have type information, nor formatting
> > > information.
> > 
> > Right.  In the dtb format the properties are just bytestrings.  Like
> > any decompilation process the results won't exactly match the original
> > input.
> > 
> > > Adding this is certainly desired,
> > 
> > That's not really true.  We're looking at adding temporary type
> > information so that -I dts -O dts will give a better approximation to
> > the input, but that's just types, not formatting down to the level of
> > decimal vs. hex representation.  I don't think there's any reason to
> > do that or any plans to do so.
> 
> I do found some colleague in our company use coverted dts from dtb
> directly, which is not good.

Yes, that's not usually a good idea.  Think of dtb->dts conversion
like a decompile.  It can be useful for debugging, and sometimes as a
starting point for cleaning up new sources, but it's not generally
useful for a production process.

> 
> > 
> > Plus that's talking about adding type information as a temporary, and
> > possibly translating it into a yaml based format.  Actually putting
> > the type information into the dtb is a different matter entirely.
> > 
> > > but no one has come up
> > > with a way to add the information in a backwards compatible way.
> > 
> > Adding type information to the dtb really doesn't make sense, the
> > format simply isn't designed for it.  Adding type information
> > essentially means creating an entirely new device information format.
> > 

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