fsl_elbc_nand: implement support for flash-based BBT
[oweals/u-boot.git] / drivers / mtd / nand / nand_bbt.c
index acf1cf543397984930213fc193ef4d2ad699eabe..b3b740da64120ba75af72e7b064b86c850096c69 100644 (file)
@@ -53,9 +53,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_NAND) && !defined(CFG_NAND_LEGACY)
-
 #include <malloc.h>
 #include <linux/mtd/compat.h>
 #include <linux/mtd/mtd.h>
@@ -391,7 +388,7 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
        loff_t from;
        size_t readlen;
 
-       printk(KERN_INFO "Scanning device for bad blocks\n");
+       MTDDEBUG (MTD_DEBUG_LEVEL0, "Scanning device for bad blocks\n");
 
        if (bd->options & NAND_BBT_SCANALLPAGES)
                len = 1 << (this->bbt_erase_shift - this->page_shift);
@@ -444,8 +441,9 @@ static int create_bbt(struct mtd_info *mtd, uint8_t *buf,
 
                if (ret) {
                        this->bbt[i >> 3] |= 0x03 << (i & 0x6);
-                       printk(KERN_WARNING "Bad eraseblock %d at 0x%08x\n",
-                              i >> 1, (unsigned int)from);
+                       MTDDEBUG (MTD_DEBUG_LEVEL0,
+                                 "Bad eraseblock %d at 0x%08x\n",
+                                 i >> 1, (unsigned int)from);
                        mtd->ecc_stats.badblocks++;
                }
 
@@ -1236,5 +1234,3 @@ int nand_isbad_bbt(struct mtd_info *mtd, loff_t offs, int allowbbt)
 EXPORT_SYMBOL(nand_scan_bbt);
 EXPORT_SYMBOL(nand_default_bbt);
 #endif
-
-#endif