public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] Make flash protection work, when the environment is in EEPROM
@ 2009-03-21 13:59 Jon
  2009-03-21 19:52 ` Wolfgang Denk
  2009-03-23  8:17 ` Wolfgang Denk
  0 siblings, 2 replies; 11+ messages in thread
From: Jon @ 2009-03-21 13:59 UTC (permalink / raw)
  To: u-boot

From: Eric Schumann <E.Schumann@phytec.de>

On the pcm030 the environment is located in the onboard EEPROM. But we want
to handle flash sector protection in a safe manner. So we must read the
unlock environment variable from EEPROM instead from flash.

This patch is required as long the evironment is saved into the EEPROM.

Signed-off-by: Eric Schumann <E.Schumann@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 0 files changed, 0 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c
index 391d169..1436131 100644
--- a/drivers/mtd/cfi_flash.c
+++ b/drivers/mtd/cfi_flash.c
@@ -2009,7 +2009,9 @@ unsigned long flash_init (void)
 #endif
 
 #ifdef CONFIG_SYS_FLASH_PROTECTION
-	char *s = getenv("unlock");
+	/* read environment from EEPROM */
+	char s[4];
+	getenv_r ("unlock", s, sizeof(s));
 #endif
 
 #define BANK_BASE(i)	(((phys_addr_t [CFI_MAX_FLASH_BANKS])CONFIG_SYS_FLASH_BANKS_LIST)[i])

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2009-03-23  8:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox