[U-Boot] [PATCH] Honor /memory/reg node in DTB files

Scott Wood scottwood at freescale.com
Wed Dec 8 20:33:27 CET 2010


On Wed, 8 Dec 2010 11:22:59 -0800
Dan Malek <ppc6dev at digitaldans.com> wrote:

> 
> On Dec 8, 2010, at 11:11 AM, Scott Wood wrote:
> 
> > Probably want to complain to the user if reg is invalid and not  
> > zero/missing.
> 
> I think you guys are making this too complicated.
> There are many ways to pass stupid mistakes via
> a device tree, don't get carried away trying to single
> out this one for error checking where the user is likely
> to really know what they are doing.  This isn't a required
> specification to get correct, without anything u-boot
> will provide the proper information.

I don't think that's what this is for.  I think it's for AMP scenarios
where you want to carve up memory between guests -- in which case you
want U-Boot to not overwrite the device tree with its own idea of how
much memory is present.

This patch was trying to guess whether that's the case based on whether
the existing value looks reasonable, but I think it has to be an
explicit configuration (board config, environment variable, etc).  Once
that is done, then the test should either go away, or complain -- don't
just silently do something different if it's been told that the memory
node is supposed to be complete and correct.

As for the merits of error checking in general, obviously it's not
going to be complete.  But it can be useful to check for some common
errors, such as when a board has multiple DTSes and the user has to
pick the right one for how U-Boot has been configured.  Maybe
granting an AMP partition a memory region beyond the bounds of detected
memory is another such case.

-Scott



More information about the U-Boot mailing list