[U-Boot] [U-BOOT] cfi_flash.c fails to program NOR Flash SST39LF040

Po-Yu Chuang ratbert.chuang at gmail.com
Tue Apr 28 05:12:49 CEST 2009


Dear Stefan Roese,

2009/4/27 Stefan Roese <sr at denx.de>
> On Friday 24 April 2009, Po-Yu Chuang wrote:
> > I have a board on which there is a NOR Flash SST39LF040.
> > Previously, I copied flash.c from other boards.
> > Now I am trying to migrate NOR Flash driver to use CFI, but it fails
> > to program sectors which
> > are not on the 0x10000 boundaries.
> > I found that in function flash_write_cfiword()
> > @drivers/mtd/cfi_flash.c it issues command
> > with address relative to sector address.
> > However, according to SST39 series data sheet, it seems that we should
> > issue command
> > with address relative to flash base address?
> >
> > After I modified flash_write_cfiword() to issue command to sector 0,
> > everything works fine.
> >
> > Is it a bug?
> Did you define CONFIG_FLASH_CFI_LEGACY (and CONFIG_SYS_FLASH_LEGACY_512Kx8)?
> IIRC then the SST FLASH chips are not completely CFI compatible. So you need
> to enable the JEDEC framework.

Yes, I have defined the fallowing macros:

#define CONFIG_SYS_FLASH_CFI
#define CONFIG_FLASH_CFI_DRIVER
#define CONFIG_FLASH_CFI_LEGACY
#define CONFIG_SYS_FLASH_LEGACY_512Kx8

SST39LF040 use addr1=0x5555 and addr2=0x2AAA, however, each sector is
0x1000 bytes.

Thus, if we issue command to "sector base (0x41000) + offset(0x5555)",
it sends to 0x46555 and the chip fails to recognize that address.

I guess that SST39LF020 might suffer the same problem.


best regards,

Po-Yu Chuang


More information about the U-Boot mailing list