
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