
In message 200412041407.32014.mail@stefan-roese.de Stefan Roese wrote:
On Saturday 04 December 2004 13:51, jack W wrote:
i am a newer i have a question about flash , i have a nor flash and
its type is SST39VF160 . I don't know how to set the CFG_MAX_FLASH_SECT.
Jack: there is a standard way of finding out thing one doesn't know: RTFM!!!
In this case the Manual is the SST39VF160 datasheet, which can easily be found (first hit when googeling for "SST39VF160"). It's at http://www.sst.com/downloads/datasheet/S71145.pdf
the flash's sector is 2k .and i think that the CFG_MAX_FLASH_SECT is 4096/2=2148 right?
No. This flash can be operated in sector mode, with a uniform sector size of 2 KWords, or in block mode, with a uniform block size of 32 KWords. The datasheet uses "x16" or 16 bit "words". So one sector is 4 KiB (Kibibyte - to use the official SI unit), and the size of one block is 64 KiB. Given a total size of 2 MiB or 2048 KiB, there are 512 sectors or 32 blocks on the chip.
So any number between 32 and 512 may be correct for your system...
Depending on how you want to use your flash device you can either decide to use sectors (fine grid; advantage: low cut, disadvantage: many sectors to erase, thus long erase times), or blocks, or any combination of it.
I'd recommend to use blocks normally, but secors for one block (using one or more sectors to store the U-Boot envrionment). For such a configuration, CFG_MAX_FLASH_SECT = 47 would be correct.
No! You have to configure the maxmium sector count with this define (and _not_ the sector-size!). Most of the time I set this to 256. This should sufficient for most flash's.
Stefan: as you can see, this is actually a bad advice, as it would be wrong here.
Best regards,
Wolfgang Denk