Dear all&Thomas, There is a bug in the way to identify nand chips. At the array nand_flash_ids[] of nand_ids.c, there is a line like that: {"NAND 4MiB 3,3V 8-bit", 0xd5, 512, 4, 0x2000, 0}, There is another line like that: {"NAND 2GiB 3,3V 8-bit", 0xD5, 0, 2048, 0, LP_OPTIONS}, Both Id is 0xd5. So for those chip with chip id=0xd5, for example K9LAG08U0,it will be identified as an old chip with page size=512 by the nand_get_flash_type() in nand_base.c like: /* Lookup the flash id */ for (i = 0; nand_flash_ids[i].name != NULL; i++) { if (dev_id == nand_flash_ids[i].id) { type = &nand_flash_ids[i]; break; } }
/* Newer devices have all the information in additional id bytes */ if (!type->pagesize) { ...
} else { /* * Old devices have chip data hardcoded in the device id table */ mtd->erasesize = type->erasesize; mtd->writesize = type->pagesize; mtd->oobsize = mtd->writesize / 32; busw = type->options & NAND_BUSWIDTH_16; } We should change the way to get page size, block size and so on. For the beginning some chips in nand_flash_ids[], it is not always reliable for us to get all information through only one ID byte.
Thanks Barry Song
|