[U-Boot-Users] auto-save environment if using default environment?
w.wegner at astro-kom.de
w.wegner at astro-kom.de
Tue Mar 25 16:36:12 CET 2008
Hi,
On 25 Mar 2008 at 16:24, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > diff --git a/common/env_common.c b/common/env_common.c
> > index a494812..8acee8f 100644
> > --- a/common/env_common.c
> > +++ b/common/env_common.c
> > @@ -243,6 +243,11 @@ void env_relocate (void)
> > #endif
> > env_crc_update ();
> > gd->env_valid = 1;
> > +#ifdef CFG_ENV_AUTOSAVE
> > + gd->env_addr = (ulong)&(env_ptr->data);
> > + puts ("Saving environment\n");
> > + saveenv ();
> > +#endif
> > }
> > else {
> > env_relocate_spec ();
> >
>
> I'll point some problem that could appear with some flash that need to
> drive some pio before write or erase the flash due to VPP protection
that´s one of the reasons why I am asking - I only tested this with my
environment being in flash (handled by env_flash.c), and here my
impression was that all such mechanisms should be handled by
saveenv() internally (calling flash_sect_protect() etc.).
> If you want to add an autosave you may need to add a pre-save and
> post-save mecanism
Hmm... I just looked in cmd_nvedit.c, and there is nothing else visible
when saveenv() is called. How would these pre-save and post-save
things supposed to be handled from the regular command-line interface?
> and I'll prefer CONFIG_ENV_AUTOSAVE than CFG_ENV_AUTOSAVE.
Sorry for that, obviously you are correct, I was confused by the
CFG_REDUNDAND_ENVIRONMENT some lines above.
> Best Regards,
> J.
Regards,
Wolfgang
More information about the U-Boot
mailing list