All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephan Linz <linz@mazet.de>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] NIOS port at Stratix DevKit: distinctions between bdi and env
Date: Tue, 28 Oct 2003 10:18:07 +0100	[thread overview]
Message-ID: <03102810180700.02205@pcj86> (raw)
In-Reply-To: <1B1B671D73FED2119B1000A0C9B8A9600108ECC1@ORBNET>

Hi Scott,

Am Montag, 27. Oktober 2003 15:42 schrieb Scott McNutt:
> I'm glad to hear other Nios users are discovering u-boot :-)
> U-Boot and Nios is a great combination!

Yes, of course.

>
> > But now, I can't setup my network environment in expected way.
> > The u-boot environment vars "ethaddr", "iptable", "netmask", and
> > "serverip" are correct  in flash, but bdinfo shows me the default
> > values (compiled in) -- Why ?
>
> Looks like I screwed up the call sequence in lib_nios/board.c ... the
> code is calling getenv("ethaddr") prior to env_init() -- must have been
> a late night ;-)
>
> The fields that depend on an initialized environment should be
> initialized _after_ calling the routines in init_sequence ... which
> includes env_init(). Try moving bi_ip_addr and bi_enetaddr
> below the init_sequence loop.

Yes, that's the solution to my problem. I've moved the setup stuff of 
bi_enetaddr and bi_ip_addr far behind the whole init_sequence loop and the 
relocation env_relocate(). I think and hope, that will be save enough for the 
future development.

>
> I'm out-of-office so I can't work on a patch for a few days. If the
> changes work, please submit a patch to Wolfgang -- or we can
> work together off-line.

OK here is the patch (attechment). Wolfgang, could you put it into the CVS 
repository?


Regards,
Stephan
-- 
Mit freundlichen Gruessen
Stephan Linz



======================================================================
Stephan Linz
Softwareentwicklung

MAZeT GmbH                   Email: mailto:linz at mazet.de
G?schwitzer Str. 32          Tel. : (3641) 2809-55
D-07745 Jena                 Fax  : (3641) 2809-12

Besuchen Sie bitte unsere Web-Seiten: http://www.MAZeT.de
======================================================================
-------------- next part --------------
diff -Nru --exclude=CVS u-boot-20031024cvs/lib_nios/board.c u-boot-20031024cvs-bd_getenv_fix/lib_nios/board.c
--- u-boot-20031024cvs/lib_nios/board.c	Mon Oct 20 01:22:12 2003
+++ u-boot-20031024cvs-bd_getenv_fix/lib_nios/board.c	Mon Oct 27 18:00:31 2003
@@ -132,12 +132,6 @@
 	bd->bi_sramstart= CFG_SRAM_BASE;
 	bd->bi_sramsize	= CFG_SRAM_SIZE;
 	bd->bi_baudrate	= CONFIG_BAUDRATE;
-	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
-	s = getenv ("ethaddr");
-	for (i = 0; i < 6; ++i) {
-		bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
-		if (s) s = (*e) ? e + 1 : e;
-	}
 
 	for (init_fnc_ptr = init_sequence; *init_fnc_ptr; ++init_fnc_ptr) {
 		if ((*init_fnc_ptr) () != 0) {
@@ -150,6 +144,13 @@
 	mem_malloc_init();
 	malloc_bin_reloc();
 	env_relocate();
+
+	bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
+	s = getenv ("ethaddr");
+	for (i = 0; i < 6; ++i) {
+		bd->bi_enetaddr[i] = s ? simple_strtoul (s, &e, 16) : 0;
+		if (s) s = (*e) ? e + 1 : e;
+	}
 
 	devices_init();
 	jumptable_init();

  reply	other threads:[~2003-10-28  9:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27 14:42 [U-Boot-Users] NIOS port at Stratix DevKit: distinctions betw een bdi and env Scott McNutt
2003-10-28  9:18 ` Stephan Linz [this message]
2003-10-28  9:15   ` [U-Boot-Users] NIOS port at Stratix DevKit: distinctions between " Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2003-10-27 14:49 Stephan Linz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=03102810180700.02205@pcj86 \
    --to=linz@mazet.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.