public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] NAND onfi detection
@ 2011-07-19  6:31 Vipin Kumar
  2011-07-19 18:38 ` Scott Wood
  0 siblings, 1 reply; 2+ messages in thread
From: Vipin Kumar @ 2011-07-19  6:31 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-19 18:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-19  6:31 [U-Boot] NAND onfi detection Vipin Kumar
2011-07-19 18:38 ` Scott Wood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox