devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* /bits/ encoding
@ 2020-06-12 20:02 Rob Herring
       [not found] ` <CAL_JsqLsT=HBTdRzEg4k6jOHDYkELj4cLXDjX8+9mdc1fNk0RQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Rob Herring @ 2020-06-12 20:02 UTC (permalink / raw)
  To: Devicetree Compiler, David Gibson; +Cc: Andrei Ziureaev

What's the expected property length in these 2 cases?:

prop = /bits/ 16 <0x1234 0x5678>, <0x9abc 0xdef0>;
prop = /bits/ 16 <0x1234 0x5678 0x9abc 0xdef0>;

For 32-bit sizes, the <> don't matter. I had assumed /bits/ applied to
the whole property value and the <> don't matter in that case either.
But that's not the case in dtc. In the 1st example, the last 2 values
are 32-bit. In order to make all values in the 1st example 16-bit, we
have to do:

prop = /bits/ 16 <0x1234 0x5678>, /bits/ 16 <0x9abc 0xdef0>;

That also means one could do:

prop = /bits/ 16 <0x1234 0x5678>, /bits/ 8 <0x9a 0xbc 0xde 0xf0>;

Something we want to support (it already works)? I don't think such a
thing exists in the wild, the kernel's array parsing doesn't expect
it, and I haven't encountered a use for it. Given the non-existent
type information in FDT, that doesn't seem like a great idea.

Rob

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-13  7:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-12 20:02 /bits/ encoding Rob Herring
     [not found] ` <CAL_JsqLsT=HBTdRzEg4k6jOHDYkELj4cLXDjX8+9mdc1fNk0RQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-13  7:10   ` David Gibson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).