From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sascha Hauer Date: Mon, 23 Mar 2009 08:15:41 +0100 Subject: [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM In-Reply-To: <9e4733910903222001h54568fao2f96dcbdc8925df5@mail.gmail.com> References: <20090321135934.12464.65400.stgit@localhost> <20090321195213.17AA7832E406@gemini.denx.de> <9e4733910903211308v63878fabx19f3327371db56c6@mail.gmail.com> <20090321202405.A557B832E406@gemini.denx.de> <20090322225904.GD20099@pengutronix.de> <9e4733910903222001h54568fao2f96dcbdc8925df5@mail.gmail.com> Message-ID: <20090323071541.GF20099@pengutronix.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Sun, Mar 22, 2009 at 11:01:09PM -0400, Jon Smirl wrote: > On Sun, Mar 22, 2009 at 6:59 PM, Sascha Hauer wrote: > > 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. > > What is your fix for mainline? I have none. 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 |