Fix hang trying to protect flash sectors
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest0 of 1 patch 0 repliesNew
Patches in v1 No applies recorded yet
The patch the cover letter announces is not in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [U-Boot] [PATCH 0/1] Fix hang trying to protect flash sectors
Hi Mark,
Quoted 4 lines · On Tuesday 18 May 2010 07:26:34 Mark Tomlinson wrote:
Our hardware has part of the flash mapped in two address ranges. The
CONFIG_SYS_MONITOR_BASEis in the upper 'boot' area, whereas theCONFIG_SYS_FLASH_BANKS_LISThas the full flash available at a lower address.
Just to be sure: You have 2 FLASH chips? Mapped at which addresses? And where does CONFIG_SYS_MONITOR_BASE point to?
Quoted 4 lines
This all works fine until the code in cfi_flash.c:flash_init(), which uses
flash_get_info()to find theflash_info_tassociated with the monitor and environment. These are not in the probed flash range, soflash_get_info()returns NULL.
You mean that "flash_get_info(CONFIG_SYS_MONITOR_BASE)" returns NULL? Please explain again, why is this the case?
Quoted 7 lines
This is not checked and is passed
directly toflash_protect(). Sinceflash_protect()was not checking for this NULL pointer either, random memory would be clobbered causing the device to lock up.This patch changes
flash_protect()to check for the NULL, and the error goes unreported.
I would prefer to fix the real problem, that flash_get_info() returns NULL, instead.
Cheers,
Stefan
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office at denx.de