* Patch by Gary Jennejohn, 11 Sep 2003:
- allow for longer timeouts for USB mass storage devices
* Patch by Denis Peter, 11 Sep 2003:
- fix USB data pointer assignment for bulk only transfer.
- prevent to display erased directories in FAT filesystem.
* Change output format for NAND flash - make it look like for other
memory, too
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 60cdd8e..0e49e9f 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -38,7 +38,7 @@
int eccvalid_pos; /* position of ECC valid flag inside oob -1 = inactive */
} oob_config = { {0}, 0, 0};
-#define NAND_DEBUG
+#undef NAND_DEBUG
#undef PSYCHO_DEBUG
/* ****************** WARNING *********************
@@ -734,7 +734,9 @@
/* If there are none at all that we recognise, bail */
if (!nand->numchips) {
+#ifdef NAND_DEBUG
puts ("No NAND flash chips recognised.\n");
+#endif
return;
}
@@ -1408,7 +1410,7 @@
return 0;
}
-void nand_probe(unsigned long physadr)
+unsigned long nand_probe(unsigned long physadr)
{
struct nand_chip *nand = NULL;
int i = 0, ChipID = 1;
@@ -1434,10 +1436,12 @@
for (i=0; i<CFG_MAX_NAND_DEVICE; i++) {
if (nand_dev_desc[i].ChipID == NAND_ChipID_UNKNOWN) {
- nand = nand_dev_desc + i;
+ nand = &nand_dev_desc[i];
break;
}
}
+ if (!nand)
+ return (0);
memset((char *)nand, 0, sizeof(struct nand_chip));
@@ -1449,7 +1453,7 @@
/* no chips found, clean up and quit */
memset((char *)nand, 0, sizeof(struct nand_chip));
nand->ChipID = NAND_ChipID_UNKNOWN;
- return;
+ return (0);
}
nand->ChipID = ChipID;
@@ -1459,8 +1463,10 @@
nand->data_buf = malloc (nand->oobblock + nand->oobsize);
if (!nand->data_buf) {
puts ("Cannot allocate memory for data structures.\n");
- return;
+ return (0);
}
+
+ return (nand->totlen);
}
#ifdef CONFIG_MTD_NAND_ECC