NAND onfi detection
Hello Scott,
The present handling of ONFI devices requires that the device id to be put in "nand_flash_ids" table. I am pasting the code below to ease the discussion
In case the dev_id doesn't match with the one's present in the table type->name points to null and an error -ENODEV is returned. detect onfi is never called
if (!type)
type = nand_flash_ids;
for (; type->name != NULL; type++)
if (*dev_id == type->id)
break;
if (!type->name) {
/* supress warning if there is no nand */
if (*maf_id != 0x00 && *maf_id != 0xff &&
*dev_id != 0x00 && *dev_id != 0xff)
printk(KERN_INFO "%s: unknown NAND device: "
"Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n",
__func__, *maf_id, *dev_id);
return ERR_PTR(-ENODEV);
}
if (!mtd->name)
mtd->name = type->name;
chip->chipsize = (uint64_t)type->chipsize << 20;
chip->onfi_version = 0;
ret = nand_flash_detect_onfi(mtd, chip, &busw);
if (!ret)
nand_flash_detect_non_onfi(mtd, chip, type, &busw);Is the behavior expected ?
Am I missing something
Regards
Vipin
Quoted 35 lines · On Tue, 19 Jul 2011 12:01:58 +0530 Vipin Kumar <[email protected]> wrote:
Hello Scott,
The present handling of ONFI devices requires that the device id to be put in "
nand_flash_ids" table. I am pasting the code below to ease the discussionIn case the
dev_iddoesn't match with the one's present in the tabletype->namepoints to null and an error-ENODEVis returned. detect onfi is never calledif (!type) type = nand_flash_ids; for (; type->name != NULL; type++) if (*dev_id == type->id) break; if (!type->name) { /* supress warning if there is no nand */ if (*maf_id != 0x00 && *maf_id != 0xff && *dev_id != 0x00 && *dev_id != 0xff) printk(KERN_INFO "%s: unknown NAND device: " "Manufacturer ID: 0x%02x, Chip ID: 0x%02x\n", __func__, *maf_id, *dev_id); return ERR_PTR(-ENODEV); } if (!mtd->name) mtd->name = type->name; chip->chipsize = (uint64_t)type->chipsize << 20; chip->onfi_version = 0; ret = nand_flash_detect_onfi(mtd, chip, &busw); if (!ret) nand_flash_detect_non_onfi(mtd, chip, type, &busw);
Quoted 2 lines
Is the behavior expected ?
Am I missing something
Florian, any insight here? It looks like Linux behaves differently.
-Scott