[U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize

Mike Frysinger vapier at gentoo.org
Mon Jan 16 11:05:13 CET 2012


On Monday 16 January 2012 03:03:23 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > All arches init these variables the same way, so move the logic
> > into the core net code to avoid duplicating it everywhere else.
> 
> This is the wrong approach.
> 
> There are many more ieces of code in arch/*/lib/board.c which are
> duplicated across some or all architectures.  Instread of ripping
> these apart and fixing a bit here and a bit thre we should combine
> efforts and merge all arch/*/lib/board.c into a common file.

or, if we add bit by bit, we have an easily testable solution rather than one 
giant leap

> > --- a/arch/arm/lib/board.c
> > +++ b/arch/arm/lib/board.c
> > @@ -536,9 +536,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
> > 
> >  	arm_pci_init();
> >  
> >  #endif
> > 
> > -	/* IP Address */
> > -	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
> 
> The code which you remove here does NOT depend on CONFIG_CMD_NET;
> note that this is intentional.

i noticed that, however, i'm not sure it matters.  i can't find any place in u-
boot that actually reads this variable.

arch/*/include/asm/u-boot.h: bi_ip_addr is declared as part of bd_t
arch/*/lib/board.c: bi_ip_addr gets initialized based on env
common/cmd_bdinfo.c: the value of bi_ip_addr gets displayed
common/cmd_nvedit.c: bi_ip_addr gets written when user does "setenv ipaddr"
board/esd/cpci405/cpci405.c: bi_ip_addr is written via the env
net/net.c: bi_ip_addr gets written as part of global env sync

is there any reason i shouldn't just rip out all bi_ip_addr handling ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120116/4969ee87/attachment.pgp>


More information about the U-Boot mailing list