mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/1] Revert "nand_base: detect more ONFI flash"
@ 2013-05-07 20:21 Jean-Christophe PLAGNIOL-VILLARD
  2013-05-08  5:11 ` Sascha Hauer
  0 siblings, 1 reply; 9+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-05-07 20:21 UTC (permalink / raw)
  To: barebox

this brake the nand support on at91sam9x5ek
where we have a non compliant ONFI nand
NAND device: Manufacturer ID: 0xad, Chip ID: 0xda (Hynix NAND 256MiB 3,3V 8-bit), 256MiB, page size: 2048, OOB size: 64

This reverts commit 4c2bdc8728016b3412523e3264651651fe752860.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 drivers/mtd/nand/nand_base.c |   13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index e8103cf..67e913a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -1179,15 +1179,16 @@ static struct nand_flash_dev *nand_get_flash_type(struct mtd_info *mtd,
 		return ERR_PTR(-ENODEV);
 	}
 
-	if (!type)
-		type = nand_flash_ids;
-
-	for (; type->name != NULL; type++)
-		if (dev_id == type->id)
+	/* 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;
+		}
+	}
 
 	chip->onfi_version = 0;
-	if (!type->name || !type->pagesize) {
+	if (!type) {
 		/* Check is chip is ONFI compliant */
 		ret = nand_flash_detect_onfi(mtd, chip, &busw);
 		if (ret)
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

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

end of thread, other threads:[~2013-05-15  7:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 20:21 [PATCH 1/1] Revert "nand_base: detect more ONFI flash" Jean-Christophe PLAGNIOL-VILLARD
2013-05-08  5:11 ` Sascha Hauer
2013-05-08  7:30   ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-08 16:25     ` Eric Bénard
2013-05-08 16:36       ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-15  6:46       ` Re[2]: " Alexander Shiyan
2013-05-15  6:59         ` Sascha Hauer
2013-05-15  7:08           ` Re[2]: " Alexander Shiyan
2013-05-15  7:50             ` Re[3]: " Alexander Shiyan

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