]> git.sur5r.net Git - u-boot/blobdiff - include/linux/mtd/bbm.h
Remove legacy NAND and disk on chip code.
[u-boot] / include / linux / mtd / bbm.h
index f194cf1b3be084a327d23dfc57e61cd0ec3e5066..7db25465df1a4a5c06b2ef0ead78d778cfbaad85 100644 (file)
 #define __LINUX_MTD_BBM_H
 
 /* The maximum number of NAND chips in an array */
-#ifndef NAND_MAX_CHIPS
-#define NAND_MAX_CHIPS         8
+#ifndef CONFIG_SYS_NAND_MAX_CHIPS
+#define CONFIG_SYS_NAND_MAX_CHIPS      1
 #endif
 
 /**
  * struct nand_bbt_descr - bad block table descriptor
  * @param options      options for this descriptor
  * @param pages                the page(s) where we find the bbt, used with
- *                     option BBT_ABSPAGE when bbt is searched,
- *                     then we store the found bbts pages here.
+ *                     option BBT_ABSPAGE when bbt is searched,
+ *                     then we store the found bbts pages here.
  *                     Its an array and supports up to 8 chips now
  * @param offs         offset of the pattern in the oob area of the page
  * @param veroffs      offset of the bbt version counter in the oob are of the page
  */
 struct nand_bbt_descr {
        int options;
-       int pages[NAND_MAX_CHIPS];
+       int pages[CONFIG_SYS_NAND_MAX_CHIPS];
        int offs;
        int veroffs;
-       uint8_t version[NAND_MAX_CHIPS];
+       uint8_t version[CONFIG_SYS_NAND_MAX_CHIPS];
        int len;
        int maxblocks;
        int reserved_block_code;
@@ -97,6 +97,13 @@ struct nand_bbt_descr {
  */
 #define ONENAND_BADBLOCK_POS   0
 
+/*
+ * Bad block scanning errors
+ */
+#define ONENAND_BBT_READ_ERROR          1
+#define ONENAND_BBT_READ_ECC_ERROR      2
+#define ONENAND_BBT_READ_FATAL_ERROR    4
+
 /**
  * struct bbt_info - [GENERIC] Bad Block Table data structure
  * @param bbt_erase_shift      [INTERN] number of address bits in a bbt entry