devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* RFC: Host-endian device tree format
@ 2011-01-19 10:43 Dave Martin
       [not found] ` <AANLkTi=AdwaW5vvm1TzNxcNrjYiJ3dOEjwoZrm-koxuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-01-19 18:19 ` Scott Wood
  0 siblings, 2 replies; 13+ messages in thread
From: Dave Martin @ 2011-01-19 10:43 UTC (permalink / raw)
  To: devicetree-discuss; +Cc: linux-arm-kernel

Hi all,

Apologies if this has been discussed before--- I don't see an obvious
rebuttal in my quick searching past threads, so I'll just quickly ask
the question:

Could we use host-endianness for the device tree binary blob?

The fdt binary format seems to lend itself strongly to a host-endian
format: it begins with a word-sized magic number, and when parsing the
device tree every elements type and size is known before that element
is read; furthermore, every element is size-aligned.  Therefore, I
(naively?) presume that a little-endian format should "just work",
simply by flipping the endianness of every element and discarding all
the __be32_to_cpu() type stuff when reading the fdt at boot time.  The
magic number ensures that there's no risk of accidentally reading the
fst in the wrong byte order.

Although it would be necessary to augment the fdt tools to cope with
this, offline tools appear to be the right place to put this
intelligence.  For the kernel to flip the byte order of everything in
the fdt blob every time the system boots just seems unnecessary when
the required endianness is statically known.

Since fdt is new on ARM we have an opportunity to change determine the
binary format now without breaking anything in the field -- we don't
necessarily have to adopt the host-endian format on any other
architectures if it's not desirable.

Any thoughts?

Cheers
---Dave

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

end of thread, other threads:[~2011-01-20  9:28 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-19 10:43 RFC: Host-endian device tree format Dave Martin
     [not found] ` <AANLkTi=AdwaW5vvm1TzNxcNrjYiJ3dOEjwoZrm-koxuw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-19 13:41   ` Grant Likely
2011-01-19 14:55     ` Dave Martin
     [not found]       ` <AANLkTi=xdJ_c3LvCFkeqBRNDf6TSC40Fjxihm9eSeMmf-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-19 15:41         ` Nicolas Pitre
     [not found]           ` <alpine.LFD.2.00.1101191031481.8580-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-01-19 15:52             ` Grant Likely
     [not found]               ` <AANLkTi==KLWXAv79u32ioQ9eSr7JEii7fW93WPPNdAez-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-19 16:05                 ` Nicolas Pitre
     [not found]                   ` <alpine.LFD.2.00.1101191101230.8580-QuJgVwGFrdf/9pzu0YdTqQ@public.gmane.org>
2011-01-19 16:07                     ` Grant Likely
2011-01-19 17:47                     ` Segher Boessenkool
2011-01-19 16:09                 ` Dave Martin
     [not found]                   ` <AANLkTim7F8PBd_4zmQY7717N7CoiGvvyX473CL=6qCaj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-01-19 23:47                     ` David Gibson
2011-01-20  9:28                       ` Dave Martin
2011-01-19 18:19 ` Scott Wood
2011-01-19 20:10   ` Mikael Pettersson

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