public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
@ 2012-01-15 23:32 Mike Frysinger
  2012-01-16  2:28 ` Thomas Chou
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-01-15 23:32 UTC (permalink / raw)
  To: u-boot

All arches init these variables the same way, so move the logic
into the core net code to avoid duplicating it everywhere else.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/arm/lib/board.c        |   11 -----------
 arch/avr32/lib/board.c      |    5 -----
 arch/blackfin/lib/board.c   |    9 +--------
 arch/m68k/lib/board.c       |   14 --------------
 arch/microblaze/lib/board.c |    7 -------
 arch/mips/lib/board.c       |   11 -----------
 arch/nds32/lib/board.c      |    9 ---------
 arch/nios2/lib/board.c      |    2 --
 arch/powerpc/lib/board.c    |   11 -----------
 arch/sandbox/lib/board.c    |    3 ---
 arch/sh/lib/board.c         |   22 ++--------------------
 arch/sparc/lib/board.c      |    7 -------
 arch/x86/lib/board.c        |   12 ------------
 net/eth.c                   |   12 ++++++++++++
 14 files changed, 15 insertions(+), 120 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
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");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
@@ -576,14 +573,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init();
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 63fe297..4bc3c8a 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -304,8 +304,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	stdio_init();
 	jumptable_init();
 	console_init_r();
@@ -317,9 +315,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s)
-		copy_filename(BootFile, s, sizeof(BootFile));
 	puts("Net:   ");
 	eth_initialize(gd->bd);
 #endif
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index e3ee4cd..4310fef 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -294,15 +294,8 @@ static void board_net_init_r(bd_t *bd)
 	bb_miiphy_init();
 #endif
 #ifdef CONFIG_CMD_NET
-	char *s;
-
-	if ((s = getenv("bootfile")) != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
-	eth_initialize(gd->bd);
+	eth_initialize(bd);
 #endif
 }
 
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 259b71c..b3dca77 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -507,15 +507,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate ();
 
-	/*
-	 * Fill in missing fields of bd_info.
-	 * We do this here, where we have "normal" access to the
-	 * environment; we used to do this still running from ROM,
-	 * where had to use getenv_f(), which can be pretty slow when
-	 * the environment is in EEPROM.
-	 */
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 
 #if defined(CONFIG_PCI)
@@ -568,11 +559,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv ("bootfile")) != NULL) {
-		copy_filename (BootFile, s, sizeof (BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET ();
 
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 9828b76..f3679d5 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -176,19 +176,12 @@ void board_init (void)
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #if defined(CONFIG_CMD_NET)
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 
 	uchar enetaddr[6];
 	eth_getenv_enetaddr("ethaddr", enetaddr);
 	printf("MAC:   %pM\n", enetaddr);
-
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
 	/* main_loop */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index d998f0e..6b36a98 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -316,9 +316,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate();
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
@@ -338,14 +335,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_CMD_SPI
 	puts("SPI:   ");
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 66e4537..446e0fd 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -368,9 +368,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	nds32_pci_init();
 #endif
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
@@ -401,12 +398,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
-#if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-#endif
-
 #ifdef BOARD_LATE_INIT
 	board_late_init();
 #endif
diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
index 65de26e..ca8a3e5 100644
--- a/arch/nios2/lib/board.c
+++ b/arch/nios2/lib/board.c
@@ -143,8 +143,6 @@ void board_init (void)
 	WATCHDOG_RESET ();
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 	stdio_init();
 	jumptable_init();
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index ff5888e..931b098 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -877,9 +877,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 #endif /* CONFIG_CMD_NET */
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	WATCHDOG_RESET();
 
 #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
@@ -935,14 +932,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET();
 
diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
index b7997e9..a71b1ba 100644
--- a/arch/sandbox/lib/board.c
+++ b/arch/sandbox/lib/board.c
@@ -226,9 +226,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index d9c0c22..e1a5739 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -99,14 +99,6 @@ static int sh_mem_env_init(void)
 	return 0;
 }
 
-#if defined(CONFIG_CMD_NET)
-static int sh_net_init(void)
-{
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_CMD_MMC)
 static int sh_mmc_init(void)
 {
@@ -144,9 +136,6 @@ init_fnc_t *init_sequence[] =
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init,
 #endif
-#if defined(CONFIG_CMD_NET)
-	sh_net_init,		/* SH specific eth init */
-#endif
 #if defined(CONFIG_CMD_MMC)
 	sh_mmc_init,
 #endif
@@ -200,15 +189,8 @@ void sh_generic_init(void)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	{
-		char *s;
-		puts("Net:   ");
-		eth_initialize(gd->bd);
-
-		s = getenv("bootfile");
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
+	puts("Net:   ");
+	eth_initialize(gd->bd);
 #endif /* CONFIG_CMD_NET */
 
 	while (1) {
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 519a4fb..a36f165 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -333,8 +333,6 @@ void board_init_f(ulong bootflag)
 	mac_read_from_eeprom();
 #endif
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
@@ -359,11 +357,6 @@ void board_init_f(ulong bootflag)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv("bootfile")) != NULL) {
-		copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif /* CONFIG_CMD_NET */
 
 	WATCHDOG_RESET();
 
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index d742fec..595b3c9 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -321,12 +321,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	env_relocate();
 	show_boot_progress(0x26);
 
-
-#ifdef CONFIG_CMD_NET
-	/* IP Address */
-	bd_data.bi_ip_addr = getenv_IPaddr("ipaddr");
-#endif
-
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
@@ -373,12 +367,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-#endif
 
 	WATCHDOG_RESET();
 
diff --git a/net/eth.c b/net/eth.c
index f3a55ba..c5daee1 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -224,6 +224,16 @@ int eth_register(struct eth_device *dev)
 	return 0;
 }
 
+static void eth_env_init(bd_t *bis)
+{
+	const char *s;
+
+	if ((s = getenv("bootfile")) != NULL)
+		copy_filename(BootFile, s, sizeof(BootFile));
+
+	bis->bi_ip_addr = getenv_IPaddr("ipaddr");
+}
+
 int eth_initialize(bd_t *bis)
 {
 	int num_devices = 0;
@@ -239,6 +249,8 @@ int eth_initialize(bd_t *bis)
 	phy_init();
 #endif
 
+	eth_env_init(bis);
+
 	/*
 	 * If board-specific initialization exists, call it.
 	 * If not, call a CPU-specific one
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
  2012-01-15 23:32 [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize Mike Frysinger
@ 2012-01-16  2:28 ` Thomas Chou
  2012-01-16  8:03 ` Wolfgang Denk
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 21+ messages in thread
From: Thomas Chou @ 2012-01-16  2:28 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On 01/16/2012 07:32 AM, 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.
>
> Signed-off-by: Mike Frysinger<vapier@gentoo.org>
> ---
>   arch/arm/lib/board.c        |   11 -----------
>   arch/avr32/lib/board.c      |    5 -----
>   arch/blackfin/lib/board.c   |    9 +--------
>   arch/m68k/lib/board.c       |   14 --------------
>   arch/microblaze/lib/board.c |    7 -------
>   arch/mips/lib/board.c       |   11 -----------
>   arch/nds32/lib/board.c      |    9 ---------
>   arch/nios2/lib/board.c      |    2 --
>   arch/powerpc/lib/board.c    |   11 -----------
>   arch/sandbox/lib/board.c    |    3 ---
>   arch/sh/lib/board.c         |   22 ++--------------------
>   arch/sparc/lib/board.c      |    7 -------
>   arch/x86/lib/board.c        |   12 ------------
>   net/eth.c                   |   12 ++++++++++++
>   14 files changed, 15 insertions(+), 120 deletions(-)

Tested on nios2 boards.

Tested-by: Thomas Chou <thomas@wytron.com.tw>

Best regards,
Thomas

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
  2012-01-15 23:32 [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize Mike Frysinger
  2012-01-16  2:28 ` Thomas Chou
@ 2012-01-16  8:03 ` Wolfgang Denk
  2012-01-16 10:05   ` Mike Frysinger
  2012-01-17  2:10 ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Mike Frysinger
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
  3 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Denk @ 2012-01-16  8:03 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <1326670329-18644-1-git-send-email-vapier@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'.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
  2012-01-16  8:03 ` Wolfgang Denk
@ 2012-01-16 10:05   ` Mike Frysinger
  2012-01-16 11:18     ` Wolfgang Denk
  0 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-01-16 10:05 UTC (permalink / raw)
  To: u-boot

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>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
  2012-01-16 10:05   ` Mike Frysinger
@ 2012-01-16 11:18     ` Wolfgang Denk
  2012-01-16 19:59       ` Mike Frysinger
  0 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Denk @ 2012-01-16 11:18 UTC (permalink / raw)
  To: u-boot

Dear Mike Frysinger,

In message <201201160505.17834.vapier@gentoo.org> you wrote:
>
> > 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.

For example, the "bdinfo" command prints it; see common/cmd_bdinfo.c

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
I can't understand it. I can't even understand  the  people  who  can
understand it.                    - Queen Juliana of the Netherlands.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize
  2012-01-16 11:18     ` Wolfgang Denk
@ 2012-01-16 19:59       ` Mike Frysinger
  0 siblings, 0 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-01-16 19:59 UTC (permalink / raw)
  To: u-boot

On Monday 16 January 2012 06:18:26 Wolfgang Denk wrote:
> Mike Frysinger wrote:
> > > 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.
> 
> For example, the "bdinfo" command prints it; see common/cmd_bdinfo.c

which i documented as the *only* place where the member gets read:
	common/cmd_bdinfo.c: the value of bi_ip_addr gets displayed

and that would be absolutely trivial to replace with getenv("ipaddr")
-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/dd8d8390/attachment.pgp>

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr
  2012-01-15 23:32 [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize Mike Frysinger
  2012-01-16  2:28 ` Thomas Chou
  2012-01-16  8:03 ` Wolfgang Denk
@ 2012-01-17  2:10 ` Mike Frysinger
  2012-01-17  2:10   ` [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize Mike Frysinger
  2012-04-04 14:21   ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Joe Hershberger
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
  3 siblings, 2 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-01-17  2:10 UTC (permalink / raw)
  To: u-boot

This field gets read in one place (by "bdinfo"), and we can replace
that with getenv("ipaddr").  After all, the bi_ip_addr field is kept
up-to-date implicitly with the value of the ipaddr env var.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/arm/include/asm/u-boot.h        |    1 -
 arch/arm/lib/board.c                 |    3 ---
 arch/avr32/include/asm/u-boot.h      |    1 -
 arch/avr32/lib/board.c               |    2 --
 arch/blackfin/include/asm/u-boot.h   |    1 -
 arch/blackfin/lib/board.c            |    3 ---
 arch/m68k/include/asm/u-boot.h       |    1 -
 arch/m68k/lib/board.c                |    9 ---------
 arch/microblaze/include/asm/u-boot.h |    1 -
 arch/microblaze/lib/board.c          |    3 ---
 arch/mips/include/asm/u-boot.h       |    1 -
 arch/mips/lib/board.c                |    3 ---
 arch/nds32/include/asm/u-boot.h      |    1 -
 arch/nds32/lib/board.c               |    3 ---
 arch/nios2/include/asm/u-boot.h      |    1 -
 arch/nios2/lib/board.c               |    2 --
 arch/openrisc/include/asm/u-boot.h   |    1 -
 arch/powerpc/include/asm/u-boot.h    |    1 -
 arch/powerpc/lib/board.c             |    3 ---
 arch/sandbox/include/asm/u-boot.h    |    1 -
 arch/sandbox/lib/board.c             |    3 ---
 arch/sh/include/asm/u-boot.h         |    1 -
 arch/sh/lib/board.c                  |   11 -----------
 arch/sparc/include/asm/u-boot.h      |    1 -
 arch/sparc/lib/board.c               |    2 --
 arch/x86/include/asm/u-boot.h        |    1 -
 arch/x86/lib/board.c                 |    6 ------
 board/esd/cpci405/cpci405.c          |    9 ++++-----
 common/cmd_bdinfo.c                  |   28 ++++++++++++++--------------
 common/cmd_nvedit.c                  |   16 +---------------
 net/net.c                            |    2 --
 31 files changed, 19 insertions(+), 103 deletions(-)

diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index f30b9fc..e6b3e46 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -38,7 +38,6 @@
 
 typedef struct bd_info {
     int			bi_baudrate;	/* serial console baudrate */
-    unsigned long	bi_ip_addr;	/* IP Address */
     ulong	        bi_arch_number;	/* unique id for this board */
     ulong	        bi_boot_params;	/* where this board expects params */
     struct				/* RAM configuration */
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 3d78274..e611ada 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");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/avr32/include/asm/u-boot.h b/arch/avr32/include/asm/u-boot.h
index ff1ed23..1d2959a 100644
--- a/arch/avr32/include/asm/u-boot.h
+++ b/arch/avr32/include/asm/u-boot.h
@@ -24,7 +24,6 @@
 
 typedef struct bd_info {
 	unsigned long		bi_baudrate;
-	unsigned long		bi_ip_addr;
 	unsigned char		bi_phy_id[4];
 	unsigned long		bi_board_number;
 	void			*bi_boot_params;
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 63fe297..be5da90 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -304,8 +304,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	stdio_init();
 	jumptable_init();
 	console_init_r();
diff --git a/arch/blackfin/include/asm/u-boot.h b/arch/blackfin/include/asm/u-boot.h
index 9712fc0..df81183 100644
--- a/arch/blackfin/include/asm/u-boot.h
+++ b/arch/blackfin/include/asm/u-boot.h
@@ -30,7 +30,6 @@
 
 typedef struct bd_info {
 	int bi_baudrate;		/* serial console baudrate */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned long bi_boot_params;	/* where this board expects params */
 	unsigned long bi_memstart;	/* start of DRAM memory */
 	phys_size_t bi_memsize;		/* size  of DRAM memory in bytes */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index e3ee4cd..5d9d448 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -86,7 +86,6 @@ static void display_global_data(void)
 	printf(" |-jt(%p): %p\n", gd->jt, *(gd->jt));
 	printf(" \\-bd: %p\n", gd->bd);
 	printf("   |-bi_baudrate: %x\n", bd->bi_baudrate);
-	printf("   |-bi_ip_addr: %lx\n", bd->bi_ip_addr);
 	printf("   |-bi_boot_params: %lx\n", bd->bi_boot_params);
 	printf("   |-bi_memstart: %lx\n", bd->bi_memstart);
 	printf("   |-bi_memsize: %lx\n", bd->bi_memsize);
@@ -299,8 +298,6 @@ static void board_net_init_r(bd_t *bd)
 	if ((s = getenv("bootfile")) != NULL)
 		copy_filename(BootFile, s, sizeof(BootFile));
 
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 #endif
diff --git a/arch/m68k/include/asm/u-boot.h b/arch/m68k/include/asm/u-boot.h
index 0a48bbd..973c9ee 100644
--- a/arch/m68k/include/asm/u-boot.h
+++ b/arch/m68k/include/asm/u-boot.h
@@ -47,7 +47,6 @@ typedef struct bd_info {
 	unsigned long bi_mbar_base;	/* base of internal registers */
 	unsigned long bi_bootflags;	/* boot / reboot flag (for LynxOS) */
 	unsigned long bi_boot_params;	/* where this board expects params */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned short bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 259b71c..e80d853 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -507,15 +507,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate ();
 
-	/*
-	 * Fill in missing fields of bd_info.
-	 * We do this here, where we have "normal" access to the
-	 * environment; we used to do this still running from ROM,
-	 * where had to use getenv_f(), which can be pretty slow when
-	 * the environment is in EEPROM.
-	 */
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 
 #if defined(CONFIG_PCI)
diff --git a/arch/microblaze/include/asm/u-boot.h b/arch/microblaze/include/asm/u-boot.h
index 21c72d5..a0b1dbf 100644
--- a/arch/microblaze/include/asm/u-boot.h
+++ b/arch/microblaze/include/asm/u-boot.h
@@ -40,7 +40,6 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 9828b76..beb406d 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -176,9 +176,6 @@ void board_init (void)
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #if defined(CONFIG_CMD_NET)
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 
diff --git a/arch/mips/include/asm/u-boot.h b/arch/mips/include/asm/u-boot.h
index edb87bb..590649a 100644
--- a/arch/mips/include/asm/u-boot.h
+++ b/arch/mips/include/asm/u-boot.h
@@ -33,7 +33,6 @@
 
 typedef struct bd_info {
 	int		bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index d998f0e..2f45562 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -316,9 +316,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate();
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
diff --git a/arch/nds32/include/asm/u-boot.h b/arch/nds32/include/asm/u-boot.h
index 9a69750..eabbf38 100644
--- a/arch/nds32/include/asm/u-boot.h
+++ b/arch/nds32/include/asm/u-boot.h
@@ -40,7 +40,6 @@
 
 typedef struct bd_info {
 	int		bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned char	bi_enetaddr[6]; /* Ethernet adress */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 66e4537..46f022a 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -368,9 +368,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	nds32_pci_init();
 #endif
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/nios2/include/asm/u-boot.h b/arch/nios2/include/asm/u-boot.h
index f7c70ff..315ef8b 100644
--- a/arch/nios2/include/asm/u-boot.h
+++ b/arch/nios2/include/asm/u-boot.h
@@ -39,7 +39,6 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
index 65de26e..ca8a3e5 100644
--- a/arch/nios2/lib/board.c
+++ b/arch/nios2/lib/board.c
@@ -143,8 +143,6 @@ void board_init (void)
 	WATCHDOG_RESET ();
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 	stdio_init();
 	jumptable_init();
diff --git a/arch/openrisc/include/asm/u-boot.h b/arch/openrisc/include/asm/u-boot.h
index 2913994..76b8132 100644
--- a/arch/openrisc/include/asm/u-boot.h
+++ b/arch/openrisc/include/asm/u-boot.h
@@ -33,7 +33,6 @@
 
 typedef struct bd_info {
 	unsigned long	bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h
index b2fa2b5..1552054 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -63,7 +63,6 @@ typedef struct bd_info {
 	unsigned long   bi_vcofreq;     /* VCO Freq, in MHz */
 #endif
 	unsigned long	bi_bootflags;	/* boot / reboot flag (Unused) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned char	bi_enetaddr[6];	/* OLD: see README.enetaddr */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index ff5888e..d4cbb4d 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -877,9 +877,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 #endif /* CONFIG_CMD_NET */
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	WATCHDOG_RESET();
 
 #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
diff --git a/arch/sandbox/include/asm/u-boot.h b/arch/sandbox/include/asm/u-boot.h
index 166ef14..de8120a 100644
--- a/arch/sandbox/include/asm/u-boot.h
+++ b/arch/sandbox/include/asm/u-boot.h
@@ -45,7 +45,6 @@ typedef struct bd_info {
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
 	unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long	bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
index b7997e9..a71b1ba 100644
--- a/arch/sandbox/lib/board.c
+++ b/arch/sandbox/lib/board.c
@@ -226,9 +226,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/sh/include/asm/u-boot.h b/arch/sh/include/asm/u-boot.h
index 4574512..6c04daf 100644
--- a/arch/sh/include/asm/u-boot.h
+++ b/arch/sh/include/asm/u-boot.h
@@ -33,7 +33,6 @@ typedef struct bd_info {
 	unsigned long   bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long   bi_sramstart;   /* start of SRAM memory */
 	unsigned long   bi_sramsize;    /* size  of SRAM memory */
-	unsigned long   bi_ip_addr;     /* IP Address */
 	unsigned long   bi_baudrate;    /* Console Baudrate */
 	unsigned long	bi_boot_params; /* where this board expects params */
 } bd_t;
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index d9c0c22..cb34c0b 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -99,14 +99,6 @@ static int sh_mem_env_init(void)
 	return 0;
 }
 
-#if defined(CONFIG_CMD_NET)
-static int sh_net_init(void)
-{
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_CMD_MMC)
 static int sh_mmc_init(void)
 {
@@ -144,9 +136,6 @@ init_fnc_t *init_sequence[] =
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init,
 #endif
-#if defined(CONFIG_CMD_NET)
-	sh_net_init,		/* SH specific eth init */
-#endif
 #if defined(CONFIG_CMD_MMC)
 	sh_mmc_init,
 #endif
diff --git a/arch/sparc/include/asm/u-boot.h b/arch/sparc/include/asm/u-boot.h
index 1d94087..8d01118 100644
--- a/arch/sparc/include/asm/u-boot.h
+++ b/arch/sparc/include/asm/u-boot.h
@@ -51,7 +51,6 @@ typedef struct bd_info {
 	unsigned long bi_sramstart;	/* start of SRAM memory */
 	unsigned long bi_sramsize;	/* size  of SRAM memory */
 	unsigned long bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned short bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 519a4fb..cd5cd52 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -333,8 +333,6 @@ void board_init_f(ulong bootflag)
 	mac_read_from_eeprom();
 #endif
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 26450eb..da667c5 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -45,7 +45,6 @@ typedef struct bd_info {
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
 	unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long	bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index d742fec..a0c22b1 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -321,12 +321,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	env_relocate();
 	show_boot_progress(0x26);
 
-
-#ifdef CONFIG_CMD_NET
-	/* IP Address */
-	bd_data.bi_ip_addr = getenv_IPaddr("ipaddr");
-#endif
-
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index 41b5ba0..1441b10 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -730,12 +730,11 @@ int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		/*
 		 * Update whole ip-addr
 		 */
-		bd->bi_ip_addr = ipaddr;
 		sprintf(str, "%ld.%ld.%ld.%ld",
-			(bd->bi_ip_addr & 0xff000000) >> 24,
-			(bd->bi_ip_addr & 0x00ff0000) >> 16,
-			(bd->bi_ip_addr & 0x0000ff00) >> 8,
-			(bd->bi_ip_addr & 0x000000ff));
+			(ipaddr & 0xff000000) >> 24,
+			(ipaddr & 0x00ff0000) >> 16,
+			(ipaddr & 0x0000ff00) >> 8,
+			(ipaddr & 0x000000ff));
 		setenv("ipaddr", str);
 		printf("Updated ip_addr from bp_eeprom to %s!\n", str);
 	}
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 97f2945..71a7337 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -139,7 +139,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_HERMES
 	print_mhz("ethspeed",		bd->bi_ethspeed);
 #endif
-	printf("IP addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("IP addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %6ld bps\n", bd->bi_baudrate);
 	print_num("relocaddr", gd->relocaddr);
 	return 0;
@@ -164,7 +164,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
@@ -188,7 +188,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
@@ -221,7 +221,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate               = %6ld bps\n", bd->bi_baudrate);
 	return 0;
@@ -267,7 +267,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(3);
 #endif
 
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
 
@@ -295,7 +295,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -315,7 +315,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -335,7 +335,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %lu bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -359,7 +359,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
@@ -386,7 +386,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
@@ -419,7 +419,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	print_mhz("ethspeed",	    bd->bi_ethspeed);
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
@@ -444,7 +444,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	print_num("FB base  ", gd->fb_base);
 	return 0;
@@ -468,7 +468,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
@@ -489,7 +489,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 63afc82..ca7d8e4 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -341,21 +341,7 @@ int _do_env_set(int flag, int argc, char * const argv[])
 	 * Some variables should be updated when the corresponding
 	 * entry in the environment is changed
 	 */
-	if (strcmp(name, "ipaddr") == 0) {
-		char *s = argv[2];	/* always use only one arg */
-		char *e;
-		unsigned long addr;
-		bd->bi_ip_addr = 0;
-		for (addr = 0, i = 0; i < 4; ++i) {
-			ulong val = s ? simple_strtoul(s, &e, 10) : 0;
-			addr <<= 8;
-			addr  |= val & 0xFF;
-			if (s)
-				s = *e ? e + 1 : e;
-		}
-		bd->bi_ip_addr = htonl(addr);
-		return 0;
-	} else if (strcmp(argv[1], "loadaddr") == 0) {
+	if (strcmp(argv[1], "loadaddr") == 0) {
 		load_addr = simple_strtoul(argv[2], NULL, 16);
 		return 0;
 	}
diff --git a/net/net.c b/net/net.c
index 045405b..3f08669 100644
--- a/net/net.c
+++ b/net/net.c
@@ -342,13 +342,11 @@ void net_auto_load(void)
 static void NetInitLoop(enum proto_t protocol)
 {
 	static int env_changed_id;
-	bd_t *bd = gd->bd;
 	int env_id = get_env_id();
 
 	/* update only when the environment has changed */
 	if (env_changed_id != env_id) {
 		NetOurIP = getenv_IPaddr("ipaddr");
-		NetCopyIP(&bd->bi_ip_addr, &NetOurIP);
 		NetOurGatewayIP = getenv_IPaddr("gatewayip");
 		NetOurSubnetMask = getenv_IPaddr("netmask");
 		NetServerIP = getenv_IPaddr("serverip");
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize
  2012-01-17  2:10 ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Mike Frysinger
@ 2012-01-17  2:10   ` Mike Frysinger
  2012-04-04 14:22     ` Joe Hershberger
  2012-04-04 14:21   ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Joe Hershberger
  1 sibling, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-01-17  2:10 UTC (permalink / raw)
  To: u-boot

All arches init this the same way, so move the logic into the core
net code to avoid duplicating it everywhere else.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
 arch/arm/lib/board.c        |    8 --------
 arch/avr32/lib/board.c      |    3 ---
 arch/blackfin/lib/board.c   |    7 +------
 arch/m68k/lib/board.c       |    5 -----
 arch/microblaze/lib/board.c |    4 ----
 arch/mips/lib/board.c       |    8 --------
 arch/nds32/lib/board.c      |    6 ------
 arch/powerpc/lib/board.c    |    8 --------
 arch/sh/lib/board.c         |   11 ++---------
 arch/sparc/lib/board.c      |    5 -----
 arch/x86/lib/board.c        |    6 ------
 net/eth.c                   |   10 ++++++++++
 12 files changed, 13 insertions(+), 68 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index e611ada..2c4276b 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -573,14 +573,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init();
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index be5da90..4bc3c8a 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -315,9 +315,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s)
-		copy_filename(BootFile, s, sizeof(BootFile));
 	puts("Net:   ");
 	eth_initialize(gd->bd);
 #endif
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 5d9d448..1ee7e22 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -293,13 +293,8 @@ static void board_net_init_r(bd_t *bd)
 	bb_miiphy_init();
 #endif
 #ifdef CONFIG_CMD_NET
-	char *s;
-
-	if ((s = getenv("bootfile")) != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-
 	printf("Net:   ");
-	eth_initialize(gd->bd);
+	eth_initialize(bd);
 #endif
 }
 
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index e80d853..b3dca77 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -559,11 +559,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv ("bootfile")) != NULL) {
-		copy_filename (BootFile, s, sizeof (BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET ();
 
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index beb406d..f3679d5 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -182,10 +182,6 @@ void board_init (void)
 	uchar enetaddr[6];
 	eth_getenv_enetaddr("ethaddr", enetaddr);
 	printf("MAC:   %pM\n", enetaddr);
-
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
 	/* main_loop */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 2f45562..6b36a98 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -335,14 +335,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_CMD_SPI
 	puts("SPI:   ");
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 46f022a..446e0fd 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -398,12 +398,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
-#if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-#endif
-
 #ifdef BOARD_LATE_INIT
 	board_late_init();
 #endif
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index d4cbb4d..931b098 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -932,14 +932,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET();
 
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index cb34c0b..e1a5739 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -189,15 +189,8 @@ void sh_generic_init(void)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	{
-		char *s;
-		puts("Net:   ");
-		eth_initialize(gd->bd);
-
-		s = getenv("bootfile");
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
+	puts("Net:   ");
+	eth_initialize(gd->bd);
 #endif /* CONFIG_CMD_NET */
 
 	while (1) {
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index cd5cd52..a36f165 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -357,11 +357,6 @@ void board_init_f(ulong bootflag)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv("bootfile")) != NULL) {
-		copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif /* CONFIG_CMD_NET */
 
 	WATCHDOG_RESET();
 
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index a0c22b1..595b3c9 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -367,12 +367,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-#endif
 
 	WATCHDOG_RESET();
 
diff --git a/net/eth.c b/net/eth.c
index f3a55ba..83ad814 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -224,6 +224,14 @@ int eth_register(struct eth_device *dev)
 	return 0;
 }
 
+static void eth_env_init(bd_t *bis)
+{
+	const char *s;
+
+	if ((s = getenv("bootfile")) != NULL)
+		copy_filename(BootFile, s, sizeof(BootFile));
+}
+
 int eth_initialize(bd_t *bis)
 {
 	int num_devices = 0;
@@ -239,6 +247,8 @@ int eth_initialize(bd_t *bis)
 	phy_init();
 #endif
 
+	eth_env_init(bis);
+
 	/*
 	 * If board-specific initialization exists, call it.
 	 * If not, call a CPU-specific one
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr
  2012-01-17  2:10 ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Mike Frysinger
  2012-01-17  2:10   ` [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize Mike Frysinger
@ 2012-04-04 14:21   ` Joe Hershberger
  1 sibling, 0 replies; 21+ messages in thread
From: Joe Hershberger @ 2012-04-04 14:21 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Mon, Jan 16, 2012 at 8:10 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> This field gets read in one place (by "bdinfo"), and we can replace
> that with getenv("ipaddr"). ?After all, the bi_ip_addr field is kept
> up-to-date implicitly with the value of the ipaddr env var.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Please rebase.

Thanks,
-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize
  2012-01-17  2:10   ` [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize Mike Frysinger
@ 2012-04-04 14:22     ` Joe Hershberger
  0 siblings, 0 replies; 21+ messages in thread
From: Joe Hershberger @ 2012-04-04 14:22 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Mon, Jan 16, 2012 at 8:10 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> All arches init this the same way, so move the logic into the core
> net code to avoid duplicating it everywhere else.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>

Please rebase.

Thanks,
-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr
  2012-01-15 23:32 [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize Mike Frysinger
                   ` (2 preceding siblings ...)
  2012-01-17  2:10 ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Mike Frysinger
@ 2012-04-05  4:53 ` Mike Frysinger
  2012-04-05  4:53   ` [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize Mike Frysinger
                     ` (3 more replies)
  3 siblings, 4 replies; 21+ messages in thread
From: Mike Frysinger @ 2012-04-05  4:53 UTC (permalink / raw)
  To: u-boot

This field gets read in one place (by "bdinfo"), and we can replace
that with getenv("ipaddr").  After all, the bi_ip_addr field is kept
up-to-date implicitly with the value of the ipaddr env var.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
	- rebased onto mainline

 arch/arm/include/asm/u-boot.h        |    1 -
 arch/arm/lib/board.c                 |    3 ---
 arch/avr32/include/asm/u-boot.h      |    1 -
 arch/avr32/lib/board.c               |    2 --
 arch/blackfin/include/asm/u-boot.h   |    1 -
 arch/blackfin/lib/board.c            |    3 ---
 arch/m68k/include/asm/u-boot.h       |    1 -
 arch/m68k/lib/board.c                |    9 ---------
 arch/microblaze/include/asm/u-boot.h |    1 -
 arch/microblaze/lib/board.c          |    3 ---
 arch/mips/include/asm/u-boot.h       |    1 -
 arch/mips/lib/board.c                |    3 ---
 arch/nds32/include/asm/u-boot.h      |    1 -
 arch/nds32/lib/board.c               |    3 ---
 arch/nios2/include/asm/u-boot.h      |    1 -
 arch/nios2/lib/board.c               |    2 --
 arch/openrisc/include/asm/u-boot.h   |    1 -
 arch/powerpc/include/asm/u-boot.h    |    1 -
 arch/powerpc/lib/board.c             |    3 ---
 arch/sandbox/include/asm/u-boot.h    |    1 -
 arch/sandbox/lib/board.c             |    3 ---
 arch/sh/include/asm/u-boot.h         |    1 -
 arch/sh/lib/board.c                  |   11 -----------
 arch/sparc/include/asm/u-boot.h      |    1 -
 arch/sparc/lib/board.c               |    2 --
 arch/x86/include/asm/init_helpers.h  |    1 -
 arch/x86/include/asm/u-boot.h        |    1 -
 arch/x86/lib/board.c                 |    3 ---
 arch/x86/lib/init_helpers.c          |    8 --------
 board/esd/cpci405/cpci405.c          |    9 ++++-----
 common/cmd_bdinfo.c                  |   28 ++++++++++++++--------------
 common/cmd_nvedit.c                  |   16 +---------------
 net/net.c                            |    2 --
 33 files changed, 19 insertions(+), 109 deletions(-)

diff --git a/arch/arm/include/asm/u-boot.h b/arch/arm/include/asm/u-boot.h
index 20e1653..eac3800 100644
--- a/arch/arm/include/asm/u-boot.h
+++ b/arch/arm/include/asm/u-boot.h
@@ -38,7 +38,6 @@
 
 typedef struct bd_info {
     int			bi_baudrate;	/* serial console baudrate */
-    unsigned long	bi_ip_addr;	/* IP Address */
     ulong	        bi_arch_number;	/* unique id for this board */
     ulong	        bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_arm_freq; /* arm frequency */
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 5270c11..66dfb13 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -555,9 +555,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");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/avr32/include/asm/u-boot.h b/arch/avr32/include/asm/u-boot.h
index ff1ed23..1d2959a 100644
--- a/arch/avr32/include/asm/u-boot.h
+++ b/arch/avr32/include/asm/u-boot.h
@@ -24,7 +24,6 @@
 
 typedef struct bd_info {
 	unsigned long		bi_baudrate;
-	unsigned long		bi_ip_addr;
 	unsigned char		bi_phy_id[4];
 	unsigned long		bi_board_number;
 	void			*bi_boot_params;
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index d626c29..3c2d0fb 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -316,8 +316,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	stdio_init();
 	jumptable_init();
 	console_init_r();
diff --git a/arch/blackfin/include/asm/u-boot.h b/arch/blackfin/include/asm/u-boot.h
index 9712fc0..df81183 100644
--- a/arch/blackfin/include/asm/u-boot.h
+++ b/arch/blackfin/include/asm/u-boot.h
@@ -30,7 +30,6 @@
 
 typedef struct bd_info {
 	int bi_baudrate;		/* serial console baudrate */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned long bi_boot_params;	/* where this board expects params */
 	unsigned long bi_memstart;	/* start of DRAM memory */
 	phys_size_t bi_memsize;		/* size  of DRAM memory in bytes */
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index e3ee4cd..5d9d448 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -86,7 +86,6 @@ static void display_global_data(void)
 	printf(" |-jt(%p): %p\n", gd->jt, *(gd->jt));
 	printf(" \\-bd: %p\n", gd->bd);
 	printf("   |-bi_baudrate: %x\n", bd->bi_baudrate);
-	printf("   |-bi_ip_addr: %lx\n", bd->bi_ip_addr);
 	printf("   |-bi_boot_params: %lx\n", bd->bi_boot_params);
 	printf("   |-bi_memstart: %lx\n", bd->bi_memstart);
 	printf("   |-bi_memsize: %lx\n", bd->bi_memsize);
@@ -299,8 +298,6 @@ static void board_net_init_r(bd_t *bd)
 	if ((s = getenv("bootfile")) != NULL)
 		copy_filename(BootFile, s, sizeof(BootFile));
 
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 #endif
diff --git a/arch/m68k/include/asm/u-boot.h b/arch/m68k/include/asm/u-boot.h
index 0a48bbd..973c9ee 100644
--- a/arch/m68k/include/asm/u-boot.h
+++ b/arch/m68k/include/asm/u-boot.h
@@ -47,7 +47,6 @@ typedef struct bd_info {
 	unsigned long bi_mbar_base;	/* base of internal registers */
 	unsigned long bi_bootflags;	/* boot / reboot flag (for LynxOS) */
 	unsigned long bi_boot_params;	/* where this board expects params */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned short bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index 1526967..ffd91a8 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -507,15 +507,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate ();
 
-	/*
-	 * Fill in missing fields of bd_info.
-	 * We do this here, where we have "normal" access to the
-	 * environment; we used to do this still running from ROM,
-	 * where had to use getenv_f(), which can be pretty slow when
-	 * the environment is in EEPROM.
-	 */
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 
 #if defined(CONFIG_PCI)
diff --git a/arch/microblaze/include/asm/u-boot.h b/arch/microblaze/include/asm/u-boot.h
index 21c72d5..a0b1dbf 100644
--- a/arch/microblaze/include/asm/u-boot.h
+++ b/arch/microblaze/include/asm/u-boot.h
@@ -40,7 +40,6 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index 9828b76..beb406d 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -176,9 +176,6 @@ void board_init (void)
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
 #if defined(CONFIG_CMD_NET)
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	printf("Net:   ");
 	eth_initialize(gd->bd);
 
diff --git a/arch/mips/include/asm/u-boot.h b/arch/mips/include/asm/u-boot.h
index edb87bb..590649a 100644
--- a/arch/mips/include/asm/u-boot.h
+++ b/arch/mips/include/asm/u-boot.h
@@ -33,7 +33,6 @@
 
 typedef struct bd_info {
 	int		bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index d998f0e..2f45562 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -316,9 +316,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* relocate environment function pointers etc. */
 	env_relocate();
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
diff --git a/arch/nds32/include/asm/u-boot.h b/arch/nds32/include/asm/u-boot.h
index 9a69750..eabbf38 100644
--- a/arch/nds32/include/asm/u-boot.h
+++ b/arch/nds32/include/asm/u-boot.h
@@ -40,7 +40,6 @@
 
 typedef struct bd_info {
 	int		bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned char	bi_enetaddr[6]; /* Ethernet adress */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 074aabf..50ea30d 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -369,9 +369,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	nds32_pci_init();
 #endif
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/nios2/include/asm/u-boot.h b/arch/nios2/include/asm/u-boot.h
index f7c70ff..315ef8b 100644
--- a/arch/nios2/include/asm/u-boot.h
+++ b/arch/nios2/include/asm/u-boot.h
@@ -39,7 +39,6 @@ typedef struct bd_info {
 	unsigned long	bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_baudrate;	/* Console Baudrate */
 } bd_t;
 
diff --git a/arch/nios2/lib/board.c b/arch/nios2/lib/board.c
index 65de26e..ca8a3e5 100644
--- a/arch/nios2/lib/board.c
+++ b/arch/nios2/lib/board.c
@@ -143,8 +143,6 @@ void board_init (void)
 	WATCHDOG_RESET ();
 	env_relocate();
 
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-
 	WATCHDOG_RESET ();
 	stdio_init();
 	jumptable_init();
diff --git a/arch/openrisc/include/asm/u-boot.h b/arch/openrisc/include/asm/u-boot.h
index 2913994..76b8132 100644
--- a/arch/openrisc/include/asm/u-boot.h
+++ b/arch/openrisc/include/asm/u-boot.h
@@ -33,7 +33,6 @@
 
 typedef struct bd_info {
 	unsigned long	bi_baudrate;	/* serial console baudrate */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned long	bi_arch_number;	/* unique id for this board */
 	unsigned long	bi_boot_params;	/* where this board expects params */
 	unsigned long	bi_memstart;	/* start of DRAM memory */
diff --git a/arch/powerpc/include/asm/u-boot.h b/arch/powerpc/include/asm/u-boot.h
index b2fa2b5..1552054 100644
--- a/arch/powerpc/include/asm/u-boot.h
+++ b/arch/powerpc/include/asm/u-boot.h
@@ -63,7 +63,6 @@ typedef struct bd_info {
 	unsigned long   bi_vcofreq;     /* VCO Freq, in MHz */
 #endif
 	unsigned long	bi_bootflags;	/* boot / reboot flag (Unused) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned char	bi_enetaddr[6];	/* OLD: see README.enetaddr */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index d5b75e5..7daffce 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -877,9 +877,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 #endif
 #endif /* CONFIG_CMD_NET */
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	WATCHDOG_RESET();
 
 #if defined(CONFIG_PCI) && !defined(CONFIG_SYS_EARLY_PCI_INIT)
diff --git a/arch/sandbox/include/asm/u-boot.h b/arch/sandbox/include/asm/u-boot.h
index 166ef14..de8120a 100644
--- a/arch/sandbox/include/asm/u-boot.h
+++ b/arch/sandbox/include/asm/u-boot.h
@@ -45,7 +45,6 @@ typedef struct bd_info {
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
 	unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long	bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/sandbox/lib/board.c b/arch/sandbox/lib/board.c
index 306d1ec..c173bf9 100644
--- a/arch/sandbox/lib/board.c
+++ b/arch/sandbox/lib/board.c
@@ -235,9 +235,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* initialize environment */
 	env_relocate();
 
-	/* IP Address */
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-
 	stdio_init();	/* get the devices list going. */
 
 	jumptable_init();
diff --git a/arch/sh/include/asm/u-boot.h b/arch/sh/include/asm/u-boot.h
index 4574512..6c04daf 100644
--- a/arch/sh/include/asm/u-boot.h
+++ b/arch/sh/include/asm/u-boot.h
@@ -33,7 +33,6 @@ typedef struct bd_info {
 	unsigned long   bi_flashoffset; /* reserved area for startup monitor */
 	unsigned long   bi_sramstart;   /* start of SRAM memory */
 	unsigned long   bi_sramsize;    /* size  of SRAM memory */
-	unsigned long   bi_ip_addr;     /* IP Address */
 	unsigned long   bi_baudrate;    /* Console Baudrate */
 	unsigned long	bi_boot_params; /* where this board expects params */
 } bd_t;
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index eb021e8..d71cca4 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -100,14 +100,6 @@ static int sh_mem_env_init(void)
 	return 0;
 }
 
-#if defined(CONFIG_CMD_NET)
-static int sh_net_init(void)
-{
-	gd->bd->bi_ip_addr = getenv_IPaddr("ipaddr");
-	return 0;
-}
-#endif
-
 #if defined(CONFIG_CMD_MMC)
 static int sh_mmc_init(void)
 {
@@ -145,9 +137,6 @@ init_fnc_t *init_sequence[] =
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init,
 #endif
-#if defined(CONFIG_CMD_NET)
-	sh_net_init,		/* SH specific eth init */
-#endif
 #if defined(CONFIG_CMD_MMC)
 	sh_mmc_init,
 #endif
diff --git a/arch/sparc/include/asm/u-boot.h b/arch/sparc/include/asm/u-boot.h
index 1d94087..8d01118 100644
--- a/arch/sparc/include/asm/u-boot.h
+++ b/arch/sparc/include/asm/u-boot.h
@@ -51,7 +51,6 @@ typedef struct bd_info {
 	unsigned long bi_sramstart;	/* start of SRAM memory */
 	unsigned long bi_sramsize;	/* size  of SRAM memory */
 	unsigned long bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long bi_ip_addr;	/* IP Address */
 	unsigned short bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index c0d2608..9faf88b 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -333,8 +333,6 @@ void board_init_f(ulong bootflag)
 	mac_read_from_eeprom();
 #endif
 
-	/* IP Address */
-	bd->bi_ip_addr = getenv_IPaddr("ipaddr");
 #if defined(CONFIG_PCI)
 	/*
 	 * Do pci configuration
diff --git a/arch/x86/include/asm/init_helpers.h b/arch/x86/include/asm/init_helpers.h
index 192f18e..8d2e0ba 100644
--- a/arch/x86/include/asm/init_helpers.h
+++ b/arch/x86/include/asm/init_helpers.h
@@ -36,7 +36,6 @@ int set_reloc_flag_r(void);
 int mem_malloc_init_r(void);
 int init_bd_struct_r(void);
 int flash_init_r(void);
-int init_ip_address_r(void);
 int status_led_set_r(void);
 int set_bootfile_r(void);
 int set_load_addr_r(void);
diff --git a/arch/x86/include/asm/u-boot.h b/arch/x86/include/asm/u-boot.h
index 26450eb..da667c5 100644
--- a/arch/x86/include/asm/u-boot.h
+++ b/arch/x86/include/asm/u-boot.h
@@ -45,7 +45,6 @@ typedef struct bd_info {
 	unsigned long	bi_sramstart;	/* start of SRAM memory */
 	unsigned long	bi_sramsize;	/* size	 of SRAM memory */
 	unsigned long	bi_bootflags;	/* boot / reboot flag (for LynxOS) */
-	unsigned long	bi_ip_addr;	/* IP Address */
 	unsigned short	bi_ethspeed;	/* Ethernet speed in Mbps */
 	unsigned long	bi_intfreq;	/* Internal Freq, in MHz */
 	unsigned long	bi_busfreq;	/* Bus Freq, in MHz */
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 5f0b62c..15b4ae2 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -157,9 +157,6 @@ init_fnc_t *init_sequence_r[] = {
 	flash_init_r,
 #endif
 	env_relocate_r,
-#ifdef CONFIG_CMD_NET
-	init_ip_address_r,
-#endif
 #ifdef CONFIG_PCI
 	pci_init_r,
 #endif
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index 9f4dee0..a8741d0 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -179,14 +179,6 @@ int flash_init_r(void)
 }
 #endif
 
-int init_ip_address_r(void)
-{
-	/* IP Address */
-	bd_data.bi_ip_addr = getenv_IPaddr("ipaddr");
-
-	return 0;
-}
-
 #ifdef CONFIG_STATUS_LED
 int status_led_set_r(void)
 {
diff --git a/board/esd/cpci405/cpci405.c b/board/esd/cpci405/cpci405.c
index 41b5ba0..1441b10 100644
--- a/board/esd/cpci405/cpci405.c
+++ b/board/esd/cpci405/cpci405.c
@@ -730,12 +730,11 @@ int do_get_bpip(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 		/*
 		 * Update whole ip-addr
 		 */
-		bd->bi_ip_addr = ipaddr;
 		sprintf(str, "%ld.%ld.%ld.%ld",
-			(bd->bi_ip_addr & 0xff000000) >> 24,
-			(bd->bi_ip_addr & 0x00ff0000) >> 16,
-			(bd->bi_ip_addr & 0x0000ff00) >> 8,
-			(bd->bi_ip_addr & 0x000000ff));
+			(ipaddr & 0xff000000) >> 24,
+			(ipaddr & 0x00ff0000) >> 16,
+			(ipaddr & 0x0000ff00) >> 8,
+			(ipaddr & 0x000000ff));
 		setenv("ipaddr", str);
 		printf("Updated ip_addr from bp_eeprom to %s!\n", str);
 	}
diff --git a/common/cmd_bdinfo.c b/common/cmd_bdinfo.c
index 5359a47..802b510 100644
--- a/common/cmd_bdinfo.c
+++ b/common/cmd_bdinfo.c
@@ -139,7 +139,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #ifdef CONFIG_HERMES
 	print_mhz("ethspeed",		bd->bi_ethspeed);
 #endif
-	printf("IP addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("IP addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %6ld bps\n", bd->bi_baudrate);
 	print_num("relocaddr", gd->relocaddr);
 	return 0;
@@ -164,7 +164,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
@@ -188,7 +188,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 #endif
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
@@ -221,7 +221,7 @@ int do_bdinfo(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate               = %6ld bps\n", bd->bi_baudrate);
 	return 0;
@@ -267,7 +267,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_eth(3);
 #endif
 
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
 
@@ -295,7 +295,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -315,7 +315,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -335,7 +335,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 	print_num("flashoffset",	(ulong)bd->bi_flashoffset);
 
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	printf("baudrate    = %lu bps\n", bd->bi_baudrate);
 
 	return 0;
@@ -359,7 +359,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 #if !(defined(CONFIG_SYS_ICACHE_OFF) && defined(CONFIG_SYS_DCACHE_OFF))
@@ -395,7 +395,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %ld bps\n", (ulong)bd->bi_baudrate);
 	return 0;
@@ -428,7 +428,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 	print_mhz("ethspeed",	    bd->bi_ethspeed);
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
@@ -453,7 +453,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	print_num("FB base  ", gd->fb_base);
 	return 0;
@@ -477,7 +477,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 	printf("baudrate    = %d bps\n", bd->bi_baudrate);
 
@@ -498,7 +498,7 @@ int do_bdinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
 
 #if defined(CONFIG_CMD_NET)
 	print_eth(0);
-	printf("ip_addr     = %pI4\n", &bd->bi_ip_addr);
+	printf("ip_addr     = %s\n", getenv("ipaddr"));
 #endif
 
 	printf("baudrate    = %ld bps\n", bd->bi_baudrate);
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index b1494dc..5d772e4 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -342,21 +342,7 @@ int _do_env_set(int flag, int argc, char * const argv[])
 	 * Some variables should be updated when the corresponding
 	 * entry in the environment is changed
 	 */
-	if (strcmp(name, "ipaddr") == 0) {
-		char *s = argv[2];	/* always use only one arg */
-		char *e;
-		unsigned long addr;
-		bd->bi_ip_addr = 0;
-		for (addr = 0, i = 0; i < 4; ++i) {
-			ulong val = s ? simple_strtoul(s, &e, 10) : 0;
-			addr <<= 8;
-			addr  |= val & 0xFF;
-			if (s)
-				s = *e ? e + 1 : e;
-		}
-		bd->bi_ip_addr = htonl(addr);
-		return 0;
-	} else if (strcmp(argv[1], "loadaddr") == 0) {
+	if (strcmp(argv[1], "loadaddr") == 0) {
 		load_addr = simple_strtoul(argv[2], NULL, 16);
 		return 0;
 	}
diff --git a/net/net.c b/net/net.c
index c5acf8f..73d23eb 100644
--- a/net/net.c
+++ b/net/net.c
@@ -342,13 +342,11 @@ void net_auto_load(void)
 static void NetInitLoop(enum proto_t protocol)
 {
 	static int env_changed_id;
-	bd_t *bd = gd->bd;
 	int env_id = get_env_id();
 
 	/* update only when the environment has changed */
 	if (env_changed_id != env_id) {
 		NetOurIP = getenv_IPaddr("ipaddr");
-		NetCopyIP(&bd->bi_ip_addr, &NetOurIP);
 		NetOurGatewayIP = getenv_IPaddr("gatewayip");
 		NetOurSubnetMask = getenv_IPaddr("netmask");
 		NetServerIP = getenv_IPaddr("serverip");
-- 
1.7.8.5

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
@ 2012-04-05  4:53   ` Mike Frysinger
  2012-05-15 23:01     ` Joe Hershberger
  2012-05-15 23:00   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Joe Hershberger
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 21+ messages in thread
From: Mike Frysinger @ 2012-04-05  4:53 UTC (permalink / raw)
  To: u-boot

All arches init this the same way, so move the logic into the core
net code to avoid duplicating it everywhere else.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
v2
	- rebased onto mainline

 arch/arm/lib/board.c                |    8 --------
 arch/avr32/lib/board.c              |    3 ---
 arch/blackfin/lib/board.c           |    7 +------
 arch/m68k/lib/board.c               |    5 -----
 arch/microblaze/lib/board.c         |    4 ----
 arch/mips/lib/board.c               |    8 --------
 arch/nds32/lib/board.c              |    6 ------
 arch/powerpc/lib/board.c            |    8 --------
 arch/sh/lib/board.c                 |   11 ++---------
 arch/sparc/lib/board.c              |    5 -----
 arch/x86/include/asm/init_helpers.h |    1 -
 arch/x86/lib/board.c                |    3 ---
 arch/x86/lib/init_helpers.c         |   12 ------------
 net/eth.c                           |   10 ++++++++++
 14 files changed, 13 insertions(+), 78 deletions(-)

diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index 66dfb13..024646c 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -592,14 +592,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_BOARD_LATE_INIT
 	board_late_init();
diff --git a/arch/avr32/lib/board.c b/arch/avr32/lib/board.c
index 3c2d0fb..b390a6c 100644
--- a/arch/avr32/lib/board.c
+++ b/arch/avr32/lib/board.c
@@ -327,9 +327,6 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s)
-		copy_filename(BootFile, s, sizeof(BootFile));
 	puts("Net:   ");
 	eth_initialize(gd->bd);
 #endif
diff --git a/arch/blackfin/lib/board.c b/arch/blackfin/lib/board.c
index 5d9d448..1ee7e22 100644
--- a/arch/blackfin/lib/board.c
+++ b/arch/blackfin/lib/board.c
@@ -293,13 +293,8 @@ static void board_net_init_r(bd_t *bd)
 	bb_miiphy_init();
 #endif
 #ifdef CONFIG_CMD_NET
-	char *s;
-
-	if ((s = getenv("bootfile")) != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-
 	printf("Net:   ");
-	eth_initialize(gd->bd);
+	eth_initialize(bd);
 #endif
 }
 
diff --git a/arch/m68k/lib/board.c b/arch/m68k/lib/board.c
index ffd91a8..65a8595 100644
--- a/arch/m68k/lib/board.c
+++ b/arch/m68k/lib/board.c
@@ -559,11 +559,6 @@ void board_init_r (gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv ("bootfile")) != NULL) {
-		copy_filename (BootFile, s, sizeof (BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET ();
 
diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
index beb406d..f3679d5 100644
--- a/arch/microblaze/lib/board.c
+++ b/arch/microblaze/lib/board.c
@@ -182,10 +182,6 @@ void board_init (void)
 	uchar enetaddr[6];
 	eth_getenv_enetaddr("ethaddr", enetaddr);
 	printf("MAC:   %pM\n", enetaddr);
-
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
 #endif
 
 	/* main_loop */
diff --git a/arch/mips/lib/board.c b/arch/mips/lib/board.c
index 2f45562..6b36a98 100644
--- a/arch/mips/lib/board.c
+++ b/arch/mips/lib/board.c
@@ -335,14 +335,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 #ifdef CONFIG_CMD_SPI
 	puts("SPI:   ");
diff --git a/arch/nds32/lib/board.c b/arch/nds32/lib/board.c
index 50ea30d..7121313 100644
--- a/arch/nds32/lib/board.c
+++ b/arch/nds32/lib/board.c
@@ -399,12 +399,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
 
-#if defined(CONFIG_CMD_NET)
-	s = getenv("bootfile");
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-#endif
-
 #ifdef BOARD_LATE_INIT
 	board_late_init();
 #endif
diff --git a/arch/powerpc/lib/board.c b/arch/powerpc/lib/board.c
index 7daffce..fea310e 100644
--- a/arch/powerpc/lib/board.c
+++ b/arch/powerpc/lib/board.c
@@ -932,14 +932,6 @@ void board_init_r(gd_t *id, ulong dest_addr)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	{
-		char *s = getenv("bootfile");
-
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif
 
 	WATCHDOG_RESET();
 
diff --git a/arch/sh/lib/board.c b/arch/sh/lib/board.c
index d71cca4..34d7881 100644
--- a/arch/sh/lib/board.c
+++ b/arch/sh/lib/board.c
@@ -190,15 +190,8 @@ void sh_generic_init(void)
 	bb_miiphy_init();
 #endif
 #if defined(CONFIG_CMD_NET)
-	{
-		char *s;
-		puts("Net:   ");
-		eth_initialize(gd->bd);
-
-		s = getenv("bootfile");
-		if (s != NULL)
-			copy_filename(BootFile, s, sizeof(BootFile));
-	}
+	puts("Net:   ");
+	eth_initialize(gd->bd);
 #endif /* CONFIG_CMD_NET */
 
 	while (1) {
diff --git a/arch/sparc/lib/board.c b/arch/sparc/lib/board.c
index 9faf88b..7e48775 100644
--- a/arch/sparc/lib/board.c
+++ b/arch/sparc/lib/board.c
@@ -357,11 +357,6 @@ void board_init_f(ulong bootflag)
 
 	/* Initialize from environment */
 	load_addr = getenv_ulong("loadaddr", 16, load_addr);
-#if defined(CONFIG_CMD_NET)
-	if ((s = getenv("bootfile")) != NULL) {
-		copy_filename(BootFile, s, sizeof(BootFile));
-	}
-#endif /* CONFIG_CMD_NET */
 
 	WATCHDOG_RESET();
 
diff --git a/arch/x86/include/asm/init_helpers.h b/arch/x86/include/asm/init_helpers.h
index 8d2e0ba..8afb443 100644
--- a/arch/x86/include/asm/init_helpers.h
+++ b/arch/x86/include/asm/init_helpers.h
@@ -37,7 +37,6 @@ int mem_malloc_init_r(void);
 int init_bd_struct_r(void);
 int flash_init_r(void);
 int status_led_set_r(void);
-int set_bootfile_r(void);
 int set_load_addr_r(void);
 
 #endif	/* !_INIT_HELPERS_H_ */
diff --git a/arch/x86/lib/board.c b/arch/x86/lib/board.c
index 15b4ae2..90cf7fc 100644
--- a/arch/x86/lib/board.c
+++ b/arch/x86/lib/board.c
@@ -177,9 +177,6 @@ init_fnc_t *init_sequence_r[] = {
 	status_led_set_r,
 #endif
 	set_load_addr_r,
-#if defined(CONFIG_CMD_NET)
-	set_bootfile_r,
-#endif
 #if defined(CONFIG_CMD_IDE)
 	ide_init_r,
 #endif
diff --git a/arch/x86/lib/init_helpers.c b/arch/x86/lib/init_helpers.c
index a8741d0..9ec34ff 100644
--- a/arch/x86/lib/init_helpers.c
+++ b/arch/x86/lib/init_helpers.c
@@ -188,18 +188,6 @@ int status_led_set_r(void)
 }
 #endif
 
-int set_bootfile_r(void)
-{
-	char *s;
-
-	s = getenv("bootfile");
-
-	if (s != NULL)
-		copy_filename(BootFile, s, sizeof(BootFile));
-
-	return 0;
-}
-
 int set_load_addr_r(void)
 {
 	/* Initialize from environment */
diff --git a/net/eth.c b/net/eth.c
index aabb343..0a55a7b 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -250,6 +250,14 @@ int eth_unregister(struct eth_device *dev)
 	return 0;
 }
 
+static void eth_env_init(bd_t *bis)
+{
+	const char *s;
+
+	if ((s = getenv("bootfile")) != NULL)
+		copy_filename(BootFile, s, sizeof(BootFile));
+}
+
 int eth_initialize(bd_t *bis)
 {
 	int num_devices = 0;
@@ -265,6 +273,8 @@ int eth_initialize(bd_t *bis)
 	phy_init();
 #endif
 
+	eth_env_init(bis);
+
 	/*
 	 * If board-specific initialization exists, call it.
 	 * If not, call a CPU-specific one
-- 
1.7.8.5

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
  2012-04-05  4:53   ` [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize Mike Frysinger
@ 2012-05-15 23:00   ` Joe Hershberger
  2012-05-21  7:13   ` [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd' Wolfgang Denk
  2012-08-27 19:29   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Anatolij Gustschin
  3 siblings, 0 replies; 21+ messages in thread
From: Joe Hershberger @ 2012-05-15 23:00 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Wed, Apr 4, 2012 at 11:53 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> This field gets read in one place (by "bdinfo"), and we can replace
> that with getenv("ipaddr"). ?After all, the bi_ip_addr field is kept
> up-to-date implicitly with the value of the ipaddr env var.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v2
> ? ? ? ?- rebased onto mainline
>
> ?arch/arm/include/asm/u-boot.h ? ? ? ?| ? ?1 -
> ?arch/arm/lib/board.c ? ? ? ? ? ? ? ? | ? ?3 ---
> ?arch/avr32/include/asm/u-boot.h ? ? ?| ? ?1 -
> ?arch/avr32/lib/board.c ? ? ? ? ? ? ? | ? ?2 --
> ?arch/blackfin/include/asm/u-boot.h ? | ? ?1 -
> ?arch/blackfin/lib/board.c ? ? ? ? ? ?| ? ?3 ---
> ?arch/m68k/include/asm/u-boot.h ? ? ? | ? ?1 -
> ?arch/m68k/lib/board.c ? ? ? ? ? ? ? ?| ? ?9 ---------
> ?arch/microblaze/include/asm/u-boot.h | ? ?1 -
> ?arch/microblaze/lib/board.c ? ? ? ? ?| ? ?3 ---
> ?arch/mips/include/asm/u-boot.h ? ? ? | ? ?1 -
> ?arch/mips/lib/board.c ? ? ? ? ? ? ? ?| ? ?3 ---
> ?arch/nds32/include/asm/u-boot.h ? ? ?| ? ?1 -
> ?arch/nds32/lib/board.c ? ? ? ? ? ? ? | ? ?3 ---
> ?arch/nios2/include/asm/u-boot.h ? ? ?| ? ?1 -
> ?arch/nios2/lib/board.c ? ? ? ? ? ? ? | ? ?2 --
> ?arch/openrisc/include/asm/u-boot.h ? | ? ?1 -
> ?arch/powerpc/include/asm/u-boot.h ? ?| ? ?1 -
> ?arch/powerpc/lib/board.c ? ? ? ? ? ? | ? ?3 ---
> ?arch/sandbox/include/asm/u-boot.h ? ?| ? ?1 -
> ?arch/sandbox/lib/board.c ? ? ? ? ? ? | ? ?3 ---
> ?arch/sh/include/asm/u-boot.h ? ? ? ? | ? ?1 -
> ?arch/sh/lib/board.c ? ? ? ? ? ? ? ? ?| ? 11 -----------
> ?arch/sparc/include/asm/u-boot.h ? ? ?| ? ?1 -
> ?arch/sparc/lib/board.c ? ? ? ? ? ? ? | ? ?2 --
> ?arch/x86/include/asm/init_helpers.h ?| ? ?1 -
> ?arch/x86/include/asm/u-boot.h ? ? ? ?| ? ?1 -
> ?arch/x86/lib/board.c ? ? ? ? ? ? ? ? | ? ?3 ---
> ?arch/x86/lib/init_helpers.c ? ? ? ? ?| ? ?8 --------
> ?board/esd/cpci405/cpci405.c ? ? ? ? ?| ? ?9 ++++-----
> ?common/cmd_bdinfo.c ? ? ? ? ? ? ? ? ?| ? 28 ++++++++++++++--------------
> ?common/cmd_nvedit.c ? ? ? ? ? ? ? ? ?| ? 16 +---------------
> ?net/net.c ? ? ? ? ? ? ? ? ? ? ? ? ? ?| ? ?2 --
> ?33 files changed, 19 insertions(+), 109 deletions(-)

Applied... thanks.

-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize
  2012-04-05  4:53   ` [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize Mike Frysinger
@ 2012-05-15 23:01     ` Joe Hershberger
  0 siblings, 0 replies; 21+ messages in thread
From: Joe Hershberger @ 2012-05-15 23:01 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Wed, Apr 4, 2012 at 11:53 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> All arches init this the same way, so move the logic into the core
> net code to avoid duplicating it everywhere else.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v2
> ? ? ? ?- rebased onto mainline
>
> ?arch/arm/lib/board.c ? ? ? ? ? ? ? ?| ? ?8 --------
> ?arch/avr32/lib/board.c ? ? ? ? ? ? ?| ? ?3 ---
> ?arch/blackfin/lib/board.c ? ? ? ? ? | ? ?7 +------
> ?arch/m68k/lib/board.c ? ? ? ? ? ? ? | ? ?5 -----
> ?arch/microblaze/lib/board.c ? ? ? ? | ? ?4 ----
> ?arch/mips/lib/board.c ? ? ? ? ? ? ? | ? ?8 --------
> ?arch/nds32/lib/board.c ? ? ? ? ? ? ?| ? ?6 ------
> ?arch/powerpc/lib/board.c ? ? ? ? ? ?| ? ?8 --------
> ?arch/sh/lib/board.c ? ? ? ? ? ? ? ? | ? 11 ++---------
> ?arch/sparc/lib/board.c ? ? ? ? ? ? ?| ? ?5 -----
> ?arch/x86/include/asm/init_helpers.h | ? ?1 -
> ?arch/x86/lib/board.c ? ? ? ? ? ? ? ?| ? ?3 ---
> ?arch/x86/lib/init_helpers.c ? ? ? ? | ? 12 ------------
> ?net/eth.c ? ? ? ? ? ? ? ? ? ? ? ? ? | ? 10 ++++++++++
> ?14 files changed, 13 insertions(+), 78 deletions(-)

Applied... thanks.

-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
  2012-04-05  4:53   ` [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize Mike Frysinger
  2012-05-15 23:00   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Joe Hershberger
@ 2012-05-21  7:13   ` Wolfgang Denk
  2012-05-21 20:49     ` Joe Hershberger
  2012-08-27 19:29   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Anatolij Gustschin
  3 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Denk @ 2012-05-21  7:13 UTC (permalink / raw)
  To: u-boot

Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
Fix it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Mike Frysinger <vapier@gentoo.org>
---
 common/cmd_nvedit.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 5999cb8..2712002 100644
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -204,7 +204,6 @@ static int do_env_grep(cmd_tbl_t *cmdtp, int flag,
  */
 int _do_env_set(int flag, int argc, char * const argv[])
 {
-	bd_t  *bd = gd->bd;
 	int   i, len;
 	int   console = -1;
 	char  *name, *value, *s;
-- 
1.7.7.6

^ permalink raw reply related	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-05-21  7:13   ` [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd' Wolfgang Denk
@ 2012-05-21 20:49     ` Joe Hershberger
  2012-05-21 21:55       ` Wolfgang Denk
  0 siblings, 1 reply; 21+ messages in thread
From: Joe Hershberger @ 2012-05-21 20:49 UTC (permalink / raw)
  To: u-boot

On Mon, May 21, 2012 at 2:13 AM, Wolfgang Denk <wd@denx.de> wrote:
> Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
> Fix it.
>
> Signed-off-by: Wolfgang Denk <wd@denx.de>
> Cc: Mike Frysinger <vapier@gentoo.org>

Applied, thanks.

-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-05-21 20:49     ` Joe Hershberger
@ 2012-05-21 21:55       ` Wolfgang Denk
  2012-05-21 21:56         ` Joe Hershberger
  0 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Denk @ 2012-05-21 21:55 UTC (permalink / raw)
  To: u-boot

Dear Joe Hershberger,

In message <CANr=Z=bVYVDM_qoUngpEUz0x4S1P4bZYPbypU_P2grzvARnKXQ@mail.gmail.com> you wrote:
> On Mon, May 21, 2012 at 2:13 AM, Wolfgang Denk <wd@denx.de> wrote:
> > Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
> > Fix it.
> >
> > Signed-off-by: Wolfgang Denk <wd@denx.de>
> > Cc: Mike Frysinger <vapier@gentoo.org>
> 
> Applied, thanks.

Umm... how comes?

This falls not into your bailiwick...

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
When the ax entered the forest, the trees said, "The handle is one of
us!"                                               -- Turkish proverb

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-05-21 21:55       ` Wolfgang Denk
@ 2012-05-21 21:56         ` Joe Hershberger
  2012-05-21 22:01           ` Wolfgang Denk
  0 siblings, 1 reply; 21+ messages in thread
From: Joe Hershberger @ 2012-05-21 21:56 UTC (permalink / raw)
  To: u-boot

On Mon, May 21, 2012 at 4:55 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Joe Hershberger,
>
> In message <CANr=Z=bVYVDM_qoUngpEUz0x4S1P4bZYPbypU_P2grzvARnKXQ@mail.gmail.com> you wrote:
>> On Mon, May 21, 2012 at 2:13 AM, Wolfgang Denk <wd@denx.de> wrote:
>> > Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
>> > Fix it.
>> >
>> > Signed-off-by: Wolfgang Denk <wd@denx.de>
>> > Cc: Mike Frysinger <vapier@gentoo.org>
>>
>> Applied, thanks.
>
> Umm... how comes?
>
> This falls not into your bailiwick...

Only because the break came through me.

-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-05-21 21:56         ` Joe Hershberger
@ 2012-05-21 22:01           ` Wolfgang Denk
  2012-05-21 22:02             ` Joe Hershberger
  0 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Denk @ 2012-05-21 22:01 UTC (permalink / raw)
  To: u-boot

Dear Joe Hershberger,

In message <CANr=Z=aDCq+E2yeDpPXLxtoRyN3G3tOs7v0h=q4_of_ybkH8Hw@mail.gmail.com> you wrote:
> On Mon, May 21, 2012 at 4:55 PM, Wolfgang Denk <wd@denx.de> wrote:
> > Dear Joe Hershberger,
> >
> > In message <CANr=Z=bVYVDM_qoUngpEUz0x4S1P4bZYPbypU_P2grzvARnKXQ@mail.gmail.com> you wrote:
> >> On Mon, May 21, 2012 at 2:13 AM, Wolfgang Denk <wd@denx.de> wrote:
> >> > Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
> >> > Fix it.
> >> >
> >> > Signed-off-by: Wolfgang Denk <wd@denx.de>
> >> > Cc: Mike Frysinger <vapier@gentoo.org>
> >>
> >> Applied, thanks.
> >
> > Umm... how comes?
> >
> > This falls not into your bailiwick...
> 
> Only because the break came through me.

This is a common file that is unrelated with network code.  It shuld
not go through the net repo.  [If you want to go ahead, you can pull
it into the stagiung repo, and send a pull reqest fot that - but for a
single patch that makes little sense.]

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
In a survey taken several years ago, all  incoming  freshmen  at  MIT
were  asked  if  they  expected  to graduate in the top half of their
class. Ninety-seven percent responded that they did.

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd'
  2012-05-21 22:01           ` Wolfgang Denk
@ 2012-05-21 22:02             ` Joe Hershberger
  0 siblings, 0 replies; 21+ messages in thread
From: Joe Hershberger @ 2012-05-21 22:02 UTC (permalink / raw)
  To: u-boot

Hi Wolfgang,

On Mon, May 21, 2012 at 5:01 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Joe Hershberger,
>
> In message <CANr=Z=aDCq+E2yeDpPXLxtoRyN3G3tOs7v0h=q4_of_ybkH8Hw@mail.gmail.com> you wrote:
>> On Mon, May 21, 2012 at 4:55 PM, Wolfgang Denk <wd@denx.de> wrote:
>> > Dear Joe Hershberger,
>> >
>> > In message <CANr=Z=bVYVDM_qoUngpEUz0x4S1P4bZYPbypU_P2grzvARnKXQ@mail.gmail.com> you wrote:
>> >> On Mon, May 21, 2012 at 2:13 AM, Wolfgang Denk <wd@denx.de> wrote:
>> >> > Commit 50a47d0 "net: punt bd->bi_ip_addr" introduced a build warning.
>> >> > Fix it.
>> >> >
>> >> > Signed-off-by: Wolfgang Denk <wd@denx.de>
>> >> > Cc: Mike Frysinger <vapier@gentoo.org>
>> >>
>> >> Applied, thanks.
>> >
>> > Umm... how comes?
>> >
>> > This falls not into your bailiwick...
>>
>> Only because the break came through me.
>
> This is a common file that is unrelated with network code. ?It shuld
> not go through the net repo. ?[If you want to go ahead, you can pull
> it into the stagiung repo, and send a pull reqest fot that - but for a
> single patch that makes little sense.]

Sounds good... I'll drop it.  You can apply it directly.

Thanks,
-Joe

^ permalink raw reply	[flat|nested] 21+ messages in thread

* [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr
  2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
                     ` (2 preceding siblings ...)
  2012-05-21  7:13   ` [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd' Wolfgang Denk
@ 2012-08-27 19:29   ` Anatolij Gustschin
  3 siblings, 0 replies; 21+ messages in thread
From: Anatolij Gustschin @ 2012-08-27 19:29 UTC (permalink / raw)
  To: u-boot

Hi Mike,

On Thu,  5 Apr 2012 00:53:40 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> This field gets read in one place (by "bdinfo"), and we can replace
> that with getenv("ipaddr").  After all, the bi_ip_addr field is kept
> up-to-date implicitly with the value of the ipaddr env var.

unfortunately this patch breaks compatibility with older v2.4
kernels. bd_t struct passed to the kernel has different offsets
of the fields after bi_ip_addr. As a result older powerpc kernels
setup wrong bus clock configurations and serial console
baudrate. If the kernel still boots somehow, mounting nfs rootfs
doesn't seem to work, etc. We need to fix the offsets at least.

Thanks,
Anatolij

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2012-08-27 19:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-15 23:32 [U-Boot] [PATCH] net: move bootfile/ipaddr init into eth_initialize Mike Frysinger
2012-01-16  2:28 ` Thomas Chou
2012-01-16  8:03 ` Wolfgang Denk
2012-01-16 10:05   ` Mike Frysinger
2012-01-16 11:18     ` Wolfgang Denk
2012-01-16 19:59       ` Mike Frysinger
2012-01-17  2:10 ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Mike Frysinger
2012-01-17  2:10   ` [U-Boot] [PATCH 2/2] net: move bootfile init into eth_initialize Mike Frysinger
2012-04-04 14:22     ` Joe Hershberger
2012-04-04 14:21   ` [U-Boot] [PATCH 1/2] net: punt bd->bi_ip_addr Joe Hershberger
2012-04-05  4:53 ` [U-Boot] [PATCH 1/2 v2] " Mike Frysinger
2012-04-05  4:53   ` [U-Boot] [PATCH 2/2 v2] net: move bootfile init into eth_initialize Mike Frysinger
2012-05-15 23:01     ` Joe Hershberger
2012-05-15 23:00   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Joe Hershberger
2012-05-21  7:13   ` [U-Boot] [PATCH] Fix cmd_nvedit.c: warning: unused variable 'bd' Wolfgang Denk
2012-05-21 20:49     ` Joe Hershberger
2012-05-21 21:55       ` Wolfgang Denk
2012-05-21 21:56         ` Joe Hershberger
2012-05-21 22:01           ` Wolfgang Denk
2012-05-21 22:02             ` Joe Hershberger
2012-08-27 19:29   ` [U-Boot] [PATCH 1/2 v2] net: punt bd->bi_ip_addr Anatolij Gustschin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox