Re: [PATCH] libfdt: fdt_address_cells() and fdt_size_cells()

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



On Thu, Jul 19, 2018 at 07:26:55AM +0200, Sebastian Huber wrote:
> 
> 
> On 18/07/18 15:20, Rob Herring wrote:
> > On Wed, Jul 18, 2018 at 4:50 AM Sebastian Huber
> > <sebastian.huber@xxxxxxxxxxxxxxxxxx> wrote:
> > > Make the default cells compatible with Linux
> > > (OF_ROOT_NODE_ADDR_CELLS_DEFAULT and OF_ROOT_NODE_SIZE_CELLS_DEFAULT)
> > > which is one cell (except on SPARC, here the default address cells are
> > > two).
> > The kernel supports a default to avoid breaking old DTs (or perhaps
> > just OpenFirmware based platforms) which didn't set them. dtc will
> > throw a warning or error if they are not set. So what platform do we
> > need to support this on with libfdt?

It is indeed just for old OF based platforms.  Moreover the default
that Linux implements does not match the one defined by the IEE1275
spec, in order to accomodate certain broken device trees on certain
machines (mostly Apple, I think).  The IEEE1275 default is simply 2,
which is why that's what libfdt implements.  These properties were
never supposed to be inherited, but apparently some old firmwares
didn't get the memo.

> These two functions had already a default value (2), however, it was
> different to the default values chosen by the Linux kernel. This makes no
> sense from my point of view since Linux is probably the largest consumer of
> device trees.

> It is good that the dtc issues warnings and errors in case of malformed
> device tree sources. However, the libfdt should be able to deal with all
> sorts of already existing device trees. I would like to use these functions
> for the real-time operating system RTEMS.
> 

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