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

Wolfgang Denk wd at denx.de
Mon Jan 16 09:03:23 CET 2012


Dear Mike Frysinger,

In message <1326670329-18644-1-git-send-email-vapier at gentoo.org> you 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.


Additionally, your patch potentially breaks a number of boards.

> index 3d78274..2c4276b 100644
> --- 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.

When moving this into net/eth.c, it will be missing for all oards that
do not have CONFIG_CMD_NET defined.

So NAK.

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
An Ada exception is when a routine gets in trouble and says
'Beam me up, Scotty'.


More information about the U-Boot mailing list