]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - drivers/nand/nand_base.c
Merge with /home/wd/git/u-boot/testing-NAND/ to add new NAND handling.
[karo-tx-uboot.git] / drivers / nand / nand_base.c
index 9ec5af9d714559ad6c655c2006c7f183ff4cf44f..b039c3cd8c1b4ac1c8bdb2535c56b9963f3183dd 100644 (file)
@@ -71,6 +71,7 @@
 #endif
 
 #include <common.h>
+#ifdef CONFIG_NEW_NAND_CODE
 
 #if (CONFIG_COMMANDS & CFG_CMD_NAND)
 
@@ -847,11 +848,13 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
        else
                this->cmdfunc(mtd, NAND_CMD_STATUS, -1, -1);
 
-       reset_timer_masked();
+       reset_timer();
 
        while (1) {
-               if (get_timer_masked() > timeo)
+               if (get_timer(0) > timeo) {
+                       printf("Timeout!");
                        return 0;
+                       }
 
                if (this->dev_ready) {
                        if (this->dev_ready(mtd))
@@ -862,6 +865,10 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
                }
        }
 
+       /* XXX nand device 1 on dave (PPChameleonEVB) needs more time */
+       reset_timer();
+       while (get_timer(0) < 10);
+
        return this->read_byte(mtd);
 }
 #endif
@@ -2393,9 +2400,6 @@ int nand_scan (struct mtd_info *mtd, int maxchips)
                        if (nand_manuf_ids[j].id == nand_maf_id)
                                break;
                }
-               printk (KERN_INFO "NAND device: Manufacturer ID:"
-                       " 0x%02x, Chip ID: 0x%02x (%s %s)\n", nand_maf_id, nand_dev_id,
-                       nand_manuf_ids[j].name , nand_flash_ids[i].name);
                break;
        }
 
@@ -2656,3 +2660,5 @@ void nand_release (struct mtd_info *mtd)
 }
 
 #endif
+#endif /* CONFIG_NEW_NAND_CODE */
+