[U-Boot] [PATCH] omap3: beagle: fix compile error

Premi, Sanjeev premi at ti.com
Mon Dec 28 13:42:36 CET 2009


 

> -----Original Message-----
> From: Wolfgang Denk [mailto:wd at denx.de] 
> Sent: Saturday, December 26, 2009 5:04 AM
> To: Premi, Sanjeev
> Cc: u-boot at lists.denx.de
> Subject: Re: [U-Boot] [PATCH] omap3: beagle: fix compile error
> 
> Dear Sanjeev Premi,
> 
> In message <1261580085-22547-1-git-send-email-premi at ti.com> you wrote:
> > The configuration for beagle undefs CONFIG_CMD_NET.
> > This leads to following error:
> > 
> > lib_arm/libarm.a(board.o): In function `start_armboot':
> > /home/premi/u-boot/lib_arm/board.c:360: undefined reference
> >  to `getenv_IPaddr'
> > make: *** [u-boot] Error 1
> > 
> > This patch fixes the error by including offending line
> > in appropriate ifdef.
> > 
> > Signed-off-by: Sanjeev Premi <premi at ti.com>
> > ---
> >  lib_arm/board.c |    3 ++-
> >  1 files changed, 2 insertions(+), 1 deletions(-)
> > 
> > diff --git a/lib_arm/board.c b/lib_arm/board.c
> > index e148739..e289fc9 100644
> > --- a/lib_arm/board.c
> > +++ b/lib_arm/board.c
> > @@ -357,8 +357,9 @@ void start_armboot (void)
> >  #endif
> >  
> >  	/* IP Address */
> > +#ifdef CONFIG_CMD_NET
> >  	gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
> > -
> > +#endif
> >  	stdio_init ();	/* get the devices list going. */
> 
> I don't think this is the right way to fix the problem.
> 
> This is global ARM code, and there may well be ARM boards out there
> that do not have network support in U-Boot, but they do so in Linux,
> which makes it desirable to be able to port network configuration
> (like the IP address) to the Linux kernel.

[sp] I may not have great visibility into other ARM boards, but, aren't
the Linux implementations free to init and configure the network on
their own? Why would/should they depend/or not upon the u-boot setting
an IP address?

> 
> We should not make the passing of the IP configuration to Linux
> dependent on U-Boot features / settings.
> 
> Why cannot you simply implement getenv_IPaddr() ?

[sp] The Beagleboard does not have any ethernet port. I believed that
CONFIG_CMD_NET was one way of ensuring that the fix could address
all boards which do not have ethernet connection. And, hence, would
not be setting CONFIG_CMD_NET.

In any case, for beagle I can implement this function to return "0:0:0:0".
But would that be useful?


Best regards,
Sanjeev

> 
> 
> I think the right way to fix this issue is to make getenv_IPaddr()
> always available, independent of CONFIG_NET.
> 
> Best regards,
> 
> Wolfgang Denk
> 
> -- 
> DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> panic: can't find /
> 


More information about the U-Boot mailing list