[PATCH 15/19] bootwrapper: Add initrd information to the device tree in ft_finalize().

David Gibson david at gibson.dropbear.id.au
Sat Feb 10 11:37:49 EST 2007


On Fri, Feb 09, 2007 at 04:02:07PM -0700, Mark A. Greer wrote:
> On Wed, Feb 07, 2007 at 05:01:40PM -0600, Scott Wood wrote:
> 
> Sorry for being so slow on this Scott.
> 
> <snip>
> 
> > diff --git a/arch/powerpc/boot/flatdevtree_misc.c b/arch/powerpc/boot/flatdevtree_misc.c
> > index 04da38f..39fa010 100644
> > --- a/arch/powerpc/boot/flatdevtree_misc.c
> > +++ b/arch/powerpc/boot/flatdevtree_misc.c
> > @@ -33,8 +33,20 @@ static int ft_setprop(const void *phandl
> >  	return ft_set_prop(&cxt, phandle, propname, buf, buflen);
> >  }
> >  
> > -static unsigned long ft_finalize(void)
> > +unsigned long ft_finalize(void)
> 
> This is unnecessary.  There is already global access from
> dt_ops.finalize.
> 
> >  {
> > +	unsigned long initrd_end = initrd.addr + initrd.size;
> > +	void *devp;
> > +
> > +	if (initrd.size && (devp = finddevice("/chosen"))) {
> > +		setprop(devp, "linux,initrd-start", &initrd.addr,
> > +		        sizeof(initrd.addr));
> > +		setprop(devp, "linux,initrd-end", &initrd_end,
> > +		        sizeof(initrd_end));
> > +
> > +		ft_add_rsvmap(&cxt, initrd.addr, initrd.size);
> > +	}
> > +
> 
> IMHO, this is a very unnatural place to put this code.
> It really belongs in main.c.  That's where all the rest
> of the code that accesses initrd.* is.

Agreed.  I have a couple of pending patches that do this in a more
sensible place.

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



More information about the Linuxppc-dev mailing list