[SLOF] [Qemu-ppc] [PATCH v4] board-qemu: add private hcall to inform host on "phandle" update

David Gibson david at gibson.dropbear.id.au
Tue Oct 3 11:21:34 AEDT 2017


On Sun, Oct 01, 2017 at 03:37:07PM -0500, Segher Boessenkool wrote:
> On Sat, Sep 30, 2017 at 01:17:55PM +1000, David Gibson wrote:
> > On Fri, Sep 29, 2017 at 03:18:41AM -0500, Segher Boessenkool wrote:
> > > I'm a bit worried about the phandles FDT requires, which are a different
> > > size than what OF uses (OF uses cell size, which is 64 bit on 64-bit OF;
> > > the device tree specification uses 32 bit always).
> > 
> > Um.  Wat.
> > 
> > Maybe this was theoretically possible at some point.  Maybe there's
> > just never been a 64-bit OF in this sense.  But in practice phandles
> > (and all cells) have been always 32-bit for a very, very long time.
> 
> All cells (and all phandles) are 64 bits on a 64-bit OF.  This is what
> a 64-bit OF _is_, fundamentally: it uses 64-bit cells.  Cells are the
> fundamental data type: for example stack entries are cells.
> 
> The things in the device tree are 32 bits.  A few places in the Open
> Firmware specification unfortunately call those "cells" as well.

Right.  Unfortunate as it may be, that's the main sense in which
"cell" is now being used.

> With the status quo (32-bit phandles in the device tree, so the client
> uses 32-bit phandles as well) we can still use phandles with a non-zero
> upper 32 bits in OF, using one of various translation schemes.  I was
> worried that the translation via FDT would prevent that, force OF to
> always use only memory in the low 4GB.  I now think that not much changes,
> and in practice we will always use low 4GB addresses for OF's memory
> anyway.  The recommendation in 1275.6 (the 64-bit extension) is similar.

So, I'm still a bit unclear on this.  Ok, so in a 64-bit OF phandles
are 64-bit internally.  What happens when they get encoded out into
the device tree though (e.g. in 'interrupt-parent' or whatever)?

1) Do they get encoded as 64-bit integers?

If this is the case then Linux does not support 64-bit OF, and never
has.

2) Do they get (somehow) translated down into 32-bit quantities?

If this is the case, then this problem has always existed and fdt adds
nothing new.  As long as the phandles are encoded/translated the same
way in the special 'phandle' properties, and when they're referenced
in 'interrupt-parent' and similar situations, fdt is fine.

-- 
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/slof/attachments/20171003/53b37ba7/attachment.sig>


More information about the SLOF mailing list