[U-Boot] U-boot common/environment.c

Detlev Zundel dzu at denx.de
Tue May 19 16:34:23 CEST 2009


Hi Deepak,

> im using u-boot-1.1.5_atmel_1.2 and want to add a new environment variable 

I doubt that you will get much support with this U-Boot version here on
the list.  Use latest code if you want to get help.

> for uboot version...my doubt --is it enough that i add this in the env_t 
> environment __PPCENV__ .

This all sounds very fishy - you're working on an ARM platform and you
change something with a tag __PPCENV__?  Well, let's see, oh it looks
like you're looking at what is common/env_embedded.c in latest code.

Note that this is only for board configuration which embed the
environment *inside* the text segment, because of unusal requirements of
the flash layout.  This is definitely not the norm - does your
configuration use CONFIG_ENV_IS_EMBEDDED?

> Also for each entry in this structure there is a macro defined, so if i 
> add version as a new env variable..so this is wat i have made change in 
> common/environment.c 
> line 179 where env_t environment __PPCENV__ is defined
>
> #ifdef U_BOOT_VERSION 
>         "u-boot_version=" U_BOOT_VERSION
> #endif
>
> is this enough...?

The environment is a dynamic data section which usually lives outside of
U-Boot code in its own data location.  Of course we can change the
environment in a running system, so the compiled in default environment
- or even the embedded environment is only relevant if the "normal"
environment is not accessible, e.g. when flashing a module for the first
time or after a complete erase operation.

Otherwise the "normal" envirnment will be used and even if you change
the compiled in set, you will not see much difference if you don't erase
the environment on an update.

Do you see the conceptual differences here?

Cheers
  Detlev

-- 
Q: Does that mean we also shouldn't be using IRQF_SAMPLE_RANDOM on
   interrupt [sources]?
A: Yes. The flag needs to be taken out and shot.
                            -- Matt Mackall <1239116251.14392.133.camel at calx>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list