[U-Boot-Users] ENV_IS_EMBEDDED functionality
J. William Campbell
jwilliamcampbell at comcast.net
Fri Jan 13 20:28:19 CET 2006
Hello Mr. Denk,
I have a question regarding the functionality provided by
ENV_IS_EMBEDDED. Currently, this value is computed only for the case
CFG_ENV_IS_IN_FLASH defined in environment.h, and is based on the flash
addresses of the environment being defined as inside the executing
addresses of u-boot. This seems to be designed for the case where u-boot
is executed out of flash and not copied into ram for execution. There is
an old configuration variable, CFG_ENV_IS_EMBEDDED, that appears to be
non-functional and deprecated. I am working with u-boot for the Analog
Devices Blackfin chip, which has not yet been submitted to mainstream
(AFAIK). The code directly defines ENV_IS_EMBEDDED to force that
functionality even though it is copied to ram for execution (and thereby
making the embedded determination in environment.h false). The linker
script is fixed up to force the environment data onto a flash sector
boundary, so everything works. It does however mean that u-boot cannot
be updated without destroying the old environment data. This approach is
also used for a serial flash on the spi bus using the env_eeprom module
and CFG_ENV_IS_IN_EEPROM. Normally ENV_IS_EMBEDDED could not be defined
in this case.
My question is: What is your opinion of this approach? It seems
to me that this makes ENV_IS_EMBEDDED a configuration parameter (again),
which provides some (useful?) functionality but may not be what you
envision. If ENV_IS_EMBEDDED is a configuration option, the name should
be changed to include CFG, shouldn't it? The main advantages I see of
allowing this are
1) CFG_ENV_OFFSET is fixed forever, u-boot growth will never collide
with it.
2) Some flash space can be saved because the sector alignment of the
environment data can be optimized as opposed to tacking it onto the end
(which may waste almost an entire flash sector).
Is this worth another configuration parameter? I do not want to
go too far down this road if it will not be acceptable to you in any
case. Thank you for your attention!
Best Regards,
Bill Campbell
More information about the U-Boot
mailing list