Problems with cfi_cmdset_0002.c

Jonas Holmberg jonas.holmberg at axis.com
Mon Feb 12 07:08:55 EST 2001


Hi,

I'm working on a MTD driver for AMD compatible non-CFI flash chips. Since the command set for those chips is almost the same as the one in cfi_cmdset_0002.c I have been testing that code a lot lately. I have found two "bugs". Firstly the if-statement on line 63 (current in CVS) does not work for my flash chip (AM29LV160DT):

        /* Wheee. Bring me the head of someone at AMD. */
        if (bootloc == 3 && cfi->cfiq->NumEraseRegions > 1) {
                printk("Swapping erase regions for broken CFI table\n");

The expression is false, but the EraseRegionInfo should be swapped. I have no solution to that problem. Can you think of one?

Secondly, the if-statement on line 660:

	if (adr % (1<< cfi->chipshift) == ((regions[i].erasesize * regions[i].numblocks) %( 1<< cfi->chipshift)))

should be:

	if (adr % (1<< cfi->chipshift) == ((regions[i].offset + (regions[i].erasesize * regions[i].numblocks)) %( 1<< cfi->chipshift)))

Best regards
/Jonas Holmberg, Axis Communications


To unsubscribe, send "unsubscribe mtd" to majordomo at infradead.org



More information about the linux-mtd mailing list