[U-Boot] [PATCH 5/5] New implementation for internal handling of environment variables.
Wolfgang Denk
wd at denx.de
Tue Jul 20 22:09:08 CEST 2010
Dear Kim,
In message <20100720190112.3F435153A7F at gemini.denx.de> I wrote:
>
> What we see here is in the pre-relocation phase, where we are still
> parsing the original, in-flash copy of the stringified environment.
> What is strange is that this seems to have worked when accessing
> "baudrate" (either because the environment was found, or because the
> default environment was used), but is stopping here.
I think the problem is that before relocation we have to use
getenv_r(), which is done for example to read the baudrate, see
arch/powerpc/lib/board.c: init_baudrate()
However, some boards also use getenv() before relocation. I just found
for example that the Sequoia board does this (before relocation):
"board/amcc/sequoia/sequoia.c":
330 int checkboard(void)
331 {
332 char *s = getenv("serial#");
333 u8 rev;
334 u32 clock = get_async_pci_freq();
335
336 #ifdef CONFIG_440EPX
337 printf("Board: Sequoia - AMCC PPC440EPx Evaluation Board");
338 #else
339 printf("Board: Rainier - AMCC PPC440GRx Evaluation Board");
340 #endif
...
and as one can expect the board crashes before printing the board
information.
I'm considering a way to eliminate getenv_r() (at the cost of
providing some static buffer in the global data area?).
[Comments? Ideas?]
However, I cannot see any gentenv() use before relocation for your
board, so the problem there is still unclear. I think I need your
help to debug this...
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
Human beings were created by water to transport it uphill.
More information about the U-Boot
mailing list