提交 3a3baf3e 编写于 作者: E Eric Schumann 提交者: Stefan Roese

Make flash protection work, when the environment is in EEPROM

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.

Stefan: Additional change as suggested by Wolfgang, use bigger char array
(instead of 4).
Signed-off-by: NEric Schumann <E.Schumann@phytec.de>
Signed-off-by: NSascha Hauer <s.hauer@pengutronix.de>
Acked-by: NWolfgang Denk <wd@denx.de>
Signed-off-by: NStefan Roese <sr@denx.de>
上级 ee1702d7
...@@ -2009,7 +2009,9 @@ unsigned long flash_init (void) ...@@ -2009,7 +2009,9 @@ unsigned long flash_init (void)
#endif #endif
#ifdef CONFIG_SYS_FLASH_PROTECTION #ifdef CONFIG_SYS_FLASH_PROTECTION
char *s = getenv("unlock"); /* read environment from EEPROM */
char s[64];
getenv_r ("unlock", s, sizeof(s));
#endif #endif
#define BANK_BASE(i) (((phys_addr_t [CFI_MAX_FLASH_BANKS])CONFIG_SYS_FLASH_BANKS_LIST)[i]) #define BANK_BASE(i) (((phys_addr_t [CFI_MAX_FLASH_BANKS])CONFIG_SYS_FLASH_BANKS_LIST)[i])
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册