From mboxrd@z Thu Jan 1 00:00:00 1970 From: Angelos Manousarides Date: Mon, 26 Jun 2006 17:57:24 +0300 Subject: [U-Boot-Users] Dynamic location of the environment sector In-Reply-To: <449A78D5.1040607@inaccessnetworks.com> References: <20060622104442.BC2DF3525C5@atlas.denx.de> <449A78D5.1040607@inaccessnetworks.com> Message-ID: <449FF5D4.8050007@inaccessnetworks.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Angelos Manousarides wrote: > env_offset is defined at common/environment.c, and this is the defined > used by other boards as well. > BUT: > > $ arm-linux-objdump -d common/environment.o > > common/environment.o: file format elf32-littlearm > > Disassembly of section .text: > > 00000000 : > 0: 00 80 00 00 .... > > 00000004 : > 4: 85 6f 43 92 62 6f 6f 74 64 65 6c 61 79 3d 35 00 > .oC.bootdelay=5. > 14: 62 61 75 64 72 61 74 65 3d 31 31 35 32 30 30 00 > baudrate=115200. > ... > Well, I decided to change the linker script to : cpu/pxa/start.o (.text) . = 16 * 1024 - 4; common/environment.o (.text) *(.text) This way the environment will be alligned at the right address and I don't have to change the u-boot code. What is the story of the env_size variable? The tools tin tools/env/* do not use this variable, the environment size is retrieved from the configuration files. The only reference I found was in tools/envcrc.c: #ifdef ENV_IS_EMBEDDED extern unsigned int env_size; extern unsigned char environment; #endif /* ENV_IS_EMBEDDED */ These declarations though are not used anywhere on the code that follows! In the actual u-boot code (not the tools) there is no usage. Is it some kind of a legacy mechanism, leftover from older versions of u-boot? -- Angelos Manousaridis