[U-Boot-Users] Problem using cfi_flash driver for s29GL512N flashes
Stefan Roese
sr at denx.de
Wed Nov 28 07:23:14 CET 2007
Hi Santi Gopal,
On Tuesday 27 November 2007, Santigopal Mondal wrote:
> Thanks for your help. The same problem remains with the upgraded version
> also.
>
> Is it something to do with the TEXT_BASE. The probelm is the data for
> environment is written to flash properly. But when it checks for crc in
> env_init() the crc32 function fails. the env_ptr->crc is correct.
>
> The environment sector when allocated in malloc area in main memory seems
> to get corrupted because the crc field does not seem to be correct.
>
>
> the Ram is 32 MB
> TEXT_BASE 21F00000
> CFG_GBL_DATA_SIZE 128
> CFG_ENV_ADDR (CFG_FLASH_BASE + 0x20000)
> CFG_ENV_SIZE 0x2000
> CFG_ENV_SECT_SIZE 0x20000
> CONFIG_STACKSIZE (32 * 1024)
> CFG_MALLOC_LEN (CFG_ENV_SIZE + 128*1024)
Here the CFI settings I currently use on some AMCC eval boards like
sequoia.h:
#define CFG_FLASH_BASE 0xfc000000 /* start of FLASH */
#define CFG_MONITOR_LEN (384 * 1024) /* Reserve 384 kB for Monitor */
/*-----------------------------------------------------------------------
* FLASH related
*----------------------------------------------------------------------*/
#define CFG_FLASH_CFI /* The flash is CFI compatible */
#define CFG_FLASH_CFI_DRIVER /* Use common CFI driver */
#define CFG_FLASH_BANKS_LIST { CFG_FLASH_BASE }
#define CFG_MAX_FLASH_BANKS 1 /* max number of memory banks */
#define CFG_MAX_FLASH_SECT 512 /* max number of sectors on one chip */
#define CFG_FLASH_ERASE_TOUT 120000 /* Timeout for Flash Erase (in ms) */
#define CFG_FLASH_WRITE_TOUT 500 /* Timeout for Flash Write (in ms) */
#define CFG_FLASH_USE_BUFFER_WRITE 1 /* use buffered writes (20x faster) */
#define CFG_FLASH_PROTECTION 1 /* use hardware flash protection */
#define CFG_FLASH_EMPTY_INFO /* print 'E' for empty sector on flinfo */
#ifdef CFG_ENV_IS_IN_FLASH
#define CFG_ENV_SECT_SIZE 0x20000 /* size of one complete sector */
#define CFG_ENV_ADDR ((-CFG_MONITOR_LEN)-CFG_ENV_SECT_SIZE)
#define CFG_ENV_SIZE 0x2000 /* Total Size of Environment Sector */
/* Address and size of Redundant Environment Sector */
#define CFG_ENV_ADDR_REDUND (CFG_ENV_ADDR-CFG_ENV_SECT_SIZE)
#define CFG_ENV_SIZE_REDUND (CFG_ENV_SIZE)
#endif
Please note that on these PPC4xx platforms, U-Boot is located at the *end*
of the FLASH, since the reset vector has to be at 0xfffffffc. So with an
U-Boot image size of 0x60000 the location is 0xfffa0000...0xffffffff.
Best regards,
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
=====================================================================
More information about the U-Boot
mailing list