From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wolfgang Denk Date: Tue, 20 Jul 2010 22:09:08 +0200 Subject: [U-Boot] [PATCH 5/5] New implementation for internal handling of environment variables. In-Reply-To: <20100720190112.3F435153A7F@gemini.denx.de> References: <1279395948-25864-1-git-send-email-wd@denx.de> <1279395948-25864-6-git-send-email-wd@denx.de> <20100719193825.120ebf29.kim.phillips@freescale.com> <20100720094023.61DD111D94C@gemini.denx.de> <20100720133648.cbb95a9f.kim.phillips@freescale.com> <20100720190112.3F435153A7F@gemini.denx.de> Message-ID: <20100720200908.40958153780@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Kim, In message <20100720190112.3F435153A7F@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.