[U-Boot-Users] Dynamic location of the environment sector
Angelos Manousarides
amanous at inaccessnetworks.com
Mon Jun 26 16:57:24 CEST 2006
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 <env_size>:
> 0: 00 80 00 00 ....
>
> 00000004 <environment>:
> 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
More information about the U-Boot
mailing list