Merge branch 'master' of rsync://rsync.denx.de/git/u-boot
[platform/kernel/u-boot.git] / drivers / nand / nand_base.c
index d6c84fb..b7a5d32 100644 (file)
@@ -71,9 +71,8 @@
 #endif
 
 #include <common.h>
-#ifdef CONFIG_NEW_NAND_CODE
 
-#if (CONFIG_COMMANDS & CFG_CMD_NAND)
+#if (CONFIG_COMMANDS & CFG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <watchdog.h>
@@ -864,10 +863,10 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *this, int state)
                                break;
                }
        }
-
-       /* XXX nand device 1 on dave (PPChameleonEVB) needs more time */
+#ifdef PPCHAMELON_NAND_TIMER_HACK
        reset_timer();
        while (get_timer(0) < 10);
+#endif /*  PPCHAMELON_NAND_TIMER_HACK */
 
        return this->read_byte(mtd);
 }
@@ -894,7 +893,7 @@ static int nand_write_page (struct mtd_info *mtd, struct nand_chip *this, int pa
        int     i, status;
        u_char  ecc_code[32];
        int     eccmode = oobsel->useecc ? this->eccmode : NAND_ECC_NONE;
-       int     *oob_config = oobsel->eccpos;
+       uint    *oob_config = oobsel->eccpos;
        int     datidx = 0, eccidx = 0, eccsteps = this->eccsteps;
        int     eccbytes = 0;
 
@@ -1116,7 +1115,8 @@ static int nand_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
        u_char ecc_calc[32];
        u_char ecc_code[32];
        int eccmode, eccsteps;
-       int     *oob_config, datidx;
+       unsigned *oob_config;
+       int     datidx;
        int     blockcheck = (1 << (this->phys_erase_shift - this->page_shift)) - 1;
        int     eccbytes;
        int     compareecc = 1;
@@ -2663,5 +2663,3 @@ void nand_release (struct mtd_info *mtd)
 }
 
 #endif
-#endif /* CONFIG_NEW_NAND_CODE */
-