1 /****************************************************************************
2 ****************************************************************************
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
10 ****************************************************************************
11 ****************************************************************************/
12 #ifndef __LINUX_MTD_BBM_H
13 #define __LINUX_MTD_BBM_H
15 #define NAND_MAX_CHIPS 8
17 struct nand_bbt_descr {
19 int pages[NAND_MAX_CHIPS];
22 uint8_t version[NAND_MAX_CHIPS];
25 int reserved_block_code;
29 #define NAND_BBT_NRBITS_MSK 0x0000000F
30 #define NAND_BBT_1BIT 0x00000001
31 #define NAND_BBT_2BIT 0x00000002
32 #define NAND_BBT_4BIT 0x00000004
33 #define NAND_BBT_8BIT 0x00000008
35 #define NAND_BBT_LASTBLOCK 0x00000010
37 #define NAND_BBT_ABSPAGE 0x00000020
39 #define NAND_BBT_SEARCH 0x00000040
41 #define NAND_BBT_PERCHIP 0x00000080
43 #define NAND_BBT_VERSION 0x00000100
45 #define NAND_BBT_CREATE 0x00000200
47 #define NAND_BBT_SCANALLPAGES 0x00000400
49 #define NAND_BBT_SCANEMPTY 0x00000800
51 #define NAND_BBT_WRITE 0x00001000
53 #define NAND_BBT_SAVECONTENT 0x00002000
55 #define NAND_BBT_SCAN2NDPAGE 0x00004000
57 #define NAND_BBT_SCAN_MAXBLOCKS 4
59 #define ONENAND_BADBLOCK_POS 0
68 int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt);
70 struct nand_bbt_descr *badblock_pattern;