From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] auto-save environment if using default environment?
Date: Tue, 25 Mar 2008 16:24:57 +0100 [thread overview]
Message-ID: <20080325152457.GA7015@game.jcrosoft.org> (raw)
In-Reply-To: <47E90DE8.15445.1113A3A@w.wegner.astro-kom.de>
On 14:36 Tue 25 Mar , w.wegner at astro-kom.de wrote:
> Hi,
>
> I just had the problem of fw_{print,save}env not being able to access
> the environment because I was using the default (builtin) environment
> after flashing U-Boot.
> I wonder if I am the only one having this problem, or is it common
> practice to flash the environment together with U-Boot during production?
>
> I just made this small patch to auto-save the environment if it is
> not found in flash but am wondering if
> - I missed something and such a possibility does already exist?
> (I could not find a possibility to check from the command-line if
> the current environment comes from flash or is the built-in default
> environment, else it would be easier to make a script check and
> call saveenv before booting.)
> - this small change is enough?
> - something similar might be worth considering as a new regular feature?
>
> Best regards,
> Wolfgang
>
>
> 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
If you want to add an autosave you may need to add a pre-save and
post-save mecanism
and I'll prefer CONFIG_ENV_AUTOSAVE than CFG_ENV_AUTOSAVE.
Best Regards,
J.
next prev parent reply other threads:[~2008-03-25 15:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-25 13:36 [U-Boot-Users] auto-save environment if using default environment? w.wegner at astro-kom.de
2008-03-25 15:24 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2008-03-25 15:36 ` w.wegner at astro-kom.de
2008-03-25 16:00 ` Markus Klotzbücher
2008-03-25 16:18 ` w.wegner at astro-kom.de
2008-03-25 20:23 ` Wolfgang Denk
2008-03-25 20:16 ` Wolfgang Denk
2008-03-25 23:15 ` Wolfgang Wegner
2008-03-25 23:49 ` Aras Vaichas
2008-03-26 7:28 ` Markus Klotzbücher
2008-03-26 4:51 ` Mike Frysinger
2008-03-26 7:30 ` Wolfgang Denk
2008-03-26 14:49 ` Mike Frysinger
2008-03-26 15:01 ` Wolfgang Denk
2008-03-30 20:28 ` Mike Frysinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080325152457.GA7015@game.jcrosoft.org \
--to=plagnioj@jcrosoft.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox