Subject: Re: [patch 2/6] cuimage for Bamboo board

From: David Gibson <[email-masked]>
Date: Wed, 5 Sep 2007 15:46:45 +1000

On Tue, Sep 04, 2007 at 07:40:19PM -0500, Josh Boyer wrote:
> On Wed, 2007-09-05 at 11:10 +1000, David Gibson wrote:
> > On Mon, Sep 03, 2007 at 08:42:11AM -0500, Josh Boyer wrote:
> > > On Mon, 2007-09-03 at 11:01 +1000, David Gibson wrote:
> > > > On Fri, Aug 31, 2007 at 03:04:51PM -0500, Josh Boyer wrote:
> > > > > Add a cuboot wrapper for the Bamboo board.  This also removes some obsoleted
> > > > > linker declarations that have been moved into ops.h
> > > > > 
> > > > > Signed-off-by: Josh Boyer <[email-masked]>
> > > > 
> > > > [snip]
> > > > > --- linux-2.6.orig/arch/powerpc/boot/bamboo.c
> > > > > +++ linux-2.6/arch/powerpc/boot/bamboo.c
> > > > > @@ -24,8 +24,7 @@
> > > > >  #include "4xx.h"
> > > > >  #include "44x.h"
> > > > >  
> > > > > -extern char _dtb_start[];
> > > > > -extern char _dtb_end[];
> > > > > +static u8 *bamboo_mac0, *bamboo_mac1;
> > > > >  
> > > > >  static void bamboo_fixups(void)
> > > > >  {
> > > > > @@ -34,12 +33,16 @@ static void bamboo_fixups(void)
> > > > >  	ibm440ep_fixup_clocks(sysclk, 11059200);
> > > > >  	ibm4xx_fixup_memsize();
> > > > >  	ibm4xx_quiesce_eth((u32 *)0xef600e00, (u32 *)0xef600f00);
> > > > > +	if (bamboo_mac0 && bamboo_mac1)
> > > > > +		dt_fixup_mac_addresses(bamboo_mac0, bamboo_mac1);
> > > > 
> > > > Bit ugly that you only set the MAC address for any ethernet if they're
> > > > supplied for every ethernet.
> > > 
> > > Good point.  Will fix.
> > > 
> > > > >  	simple_alloc_init(_end, avail_ram, 32, 64);
> > > > > -	bamboo_init();
> > > > > +	bamboo_init(NULL, NULL);
> > > > 
> > > > There must surely be a way to get the MAC addresses out of OpenBIOS...
> > > 
> > > Probably.  I just need to find out where they are stored.
> > 
> > It's not buried somewhere in the arch/ppc/boot code?
> 
> It's not OpenBIOS, it's PIBS.  And the arch/ppc port uses __res, which
> I'd rather avoid.  But I did find where it's stored in flash, so I can
> read it from there.  I just need to do a little more work to get it in a
> manner that can be used.

Hrm.. is that address actually guaranteed to be stable across PIBS
versions?  If arch/ppc uses __res, I think we should do that too.  It
shouldn't be any worse than what we already do fot cuboot.

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