[PATCH v2 6/7] mtd: cfi_cmdset_0002: add CFI detection for SST 39VF{16, 32}xx chips

Guillaume LECERF glecerf at gmail.com
Fri Apr 16 06:17:19 EDT 2010


2010/4/12 Wolfram Sang <w.sang at pengutronix.de>:
>> > +     * one eraseblock-length per physical memory region
>> > +     * we pretend the part said it had just one region ;)
>> > +     **/
>> > +   cfi->cfiq->NumEraseRegions = 1;
>> > +   cfi->cfiq->EraseRegionInfo[0] = cfi->cfiq->EraseRegionInfo[1];
>>
>> Why is this last line needed? The comment says they are the same?
>
> Okay, my remark was rubbish, yet the comment in the source was a bit confusing,
> too. It is correct, though maybe the term 'region' is a bit overloaded. What
> about replacing both comments with something a bit simpler like this:
>
> /*
>  * These flashes report two seperate eraseblock regions based on the
>  * sector_erase-size and block_erase-size, although they both operate on the
>  * same memory. This is not allowed according to CFI, so we just pick the
>  * sector_erase-size.
>  */
>
> This is according to the datasheets. You pick the block-data size here
> (ususally using command 0x50). Why is that? I tried sector_size on a
> SST39WF1601 and it works fine so far, testing with mtd_stresstest. (Sidenote: I
> have to use JEDEC-probing though, as my flashes don't report 0x701 but 0x002
> (AMD standard) as their primary command set. But they still need their custom
> unlock address :( )

The 39VF3201 chip I use is on a brcm63xx board, running OpenWRT. It
reports 2 erase regions (as indicated in the datasheet):

Number of Erase Block Regions: 2
  Erase Region #0: BlockSize 0x1000 bytes, 1024 blocks
  Erase Region #1: BlockSize 0x10000 bytes, 64 blocks

But the function parse_cfe_partitions() in
drivers/mtd/maps/bcm963xx-flash.c [1] tries to read the partition
table at $(master->erasesize) (cf. line 67).
If I use the sector_erase-size, parse_cfe_partitions() tries to read
at 0x1000, and fails because the partition table is actually at
0x10000 on my flash.


[1] https://dev.openwrt.org/browser/trunk/target/linux/brcm63xx/patches-2.6.32/040-bcm963xx_flashmap.patch
-- 
Guillaume LECERF
GeeXboX developer - www.geexbox.org



More information about the linux-mtd mailing list