From: Sascha Hauer <s.hauer@pengutronix.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
Date: Sun, 22 Mar 2009 23:59:04 +0100 [thread overview]
Message-ID: <20090322225904.GD20099@pengutronix.de> (raw)
In-Reply-To: <20090321202405.A557B832E406@gemini.denx.de>
Hi Wolgang,
On Sat, Mar 21, 2009 at 09:24:05PM +0100, Wolfgang Denk wrote:
> Dear Jon Smirl,
>
> In message <9e4733910903211308v63878fabx19f3327371db56c6@mail.gmail.com> you wrote:
> >
> > My guess is getenv() returns a pointer to the environment variable,
> > not a copy of the environment variable. getenv_r() returns a copy. How
> > can you return a pointer to the variable if the variable is in
> > something not directly addressable like EEPROM? Does
>
> The environment always gets copied to RAM. And it's a perfectly simple
> thing to return an adress pointing to some memory in RAM :-)
>
> > getenv("unlock"); do what you want when the environment is in EEPROM?
>
> getenv() always works that way, no matter which actual media is used
> for the persistent storage of the environment.
This is not quite true. In the PPC init sequence flash_init() is called
before env_relocate() and thus getenv is not available in flash_init().
Please note that this was just a quick way for us to make things work
and I never considered this a fix for mainline.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2009-03-22 22:59 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-21 13:59 [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM Jon
2009-03-21 19:52 ` Wolfgang Denk
2009-03-21 20:08 ` Jon Smirl
2009-03-21 20:24 ` Wolfgang Denk
2009-03-21 20:25 ` Jon Smirl
2009-03-22 22:59 ` Sascha Hauer [this message]
2009-03-23 3:01 ` Jon Smirl
2009-03-23 7:15 ` Sascha Hauer
2009-03-23 8:15 ` Wolfgang Denk
2009-03-23 8:17 ` Wolfgang Denk
2009-03-23 8:54 ` Stefan Roese
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=20090322225904.GD20099@pengutronix.de \
--to=s.hauer@pengutronix.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.