aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorBrian Norris <computersforpeace@gmail.com>2011-05-31 19:31:22 -0400
committerArtem Bityutskiy <artem.bityutskiy@intel.com>2011-09-11 08:01:56 -0400
commita40f73419f02e40555f692785ea1c1813d5b4c12 (patch)
tree81f3eeb517d6480d8535ac769202eb8e26de53c4 /include/linux
parent5fb1549dfc40f3b589dae560ea21535cdc5f64e0 (diff)
mtd: nand: consolidate redundant flash-based BBT flags
This patch works with the following three flags from two headers (nand.h and bbm.h): (1) NAND_USE_FLASH_BBT (nand.h) (2) NAND_USE_FLASH_BBT_NO_OOB (nand.h) (3) NAND_BBT_NO_OOB (bbm.h) These flags are all related and interdependent, yet they were in different headers. Flag (2) is simply the combination of (1) and (3) and can be eliminated. This patch accomplishes the following: * eliminate NAND_USE_FLASH_BBT_NO_OOB (i.e., flag (2)) * move NAND_USE_FLASH_BBT (i.e., flag (1)) to bbm.h It's important to note that because (1) and (3) are now both found in bbm.h, they should NOT be used in the "nand_chip.options" field. I removed a small section from the mtdnand DocBook because it referes to NAND_USE_FLASH_BBT in nand.h, which has been moved to bbm.h. Signed-off-by: Brian Norris <computersforpeace@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/bbm.h9
-rw-r--r--include/linux/mtd/nand.h12
2 files changed, 9 insertions, 12 deletions
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h
index 08ffa2193c07..7929514781ea 100644
--- a/include/linux/mtd/bbm.h
+++ b/include/linux/mtd/bbm.h
@@ -100,8 +100,13 @@ struct nand_bbt_descr {
100#define NAND_BBT_SCANLASTPAGE 0x00008000 100#define NAND_BBT_SCANLASTPAGE 0x00008000
101/* The nand_bbt_descr was created dynamicaly and must be freed */ 101/* The nand_bbt_descr was created dynamicaly and must be freed */
102#define NAND_BBT_DYNAMICSTRUCT 0x00200000 102#define NAND_BBT_DYNAMICSTRUCT 0x00200000
103/* The bad block table does not OOB for marker */ 103/*
104#define NAND_BBT_NO_OOB 0x00400000 104 * Use a flash based bad block table. By default, OOB identifier is saved in
105 * OOB area. This option is passed to the default bad block table function.
106 */
107#define NAND_USE_FLASH_BBT 0x00040000
108/* Do not store flash based bad block table in OOB area; store it in-band */
109#define NAND_BBT_NO_OOB 0x00080000
105 110
106/* The maximum number of blocks to scan for a bbt */ 111/* The maximum number of blocks to scan for a bbt */
107#define NAND_BBT_SCAN_MAXBLOCKS 4 112#define NAND_BBT_SCAN_MAXBLOCKS 4
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 42f70e2d33af..8a086d2cacf4 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -219,11 +219,6 @@ typedef enum {
219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR) 219#define NAND_CHIPOPTIONS_MSK (0x0000ffff & ~NAND_NO_AUTOINCR)
220 220
221/* Non chip related options */ 221/* Non chip related options */
222/*
223 * Use a flash based bad block table. OOB identifier is saved in OOB area.
224 * This option is passed to the default bad block table function.
225 */
226#define NAND_USE_FLASH_BBT 0x00010000
227/* This option skips the bbt scan during initialization. */ 222/* This option skips the bbt scan during initialization. */
228#define NAND_SKIP_BBTSCAN 0x00020000 223#define NAND_SKIP_BBTSCAN 0x00020000
229/* 224/*
@@ -233,11 +228,6 @@ typedef enum {
233#define NAND_OWN_BUFFERS 0x00040000 228#define NAND_OWN_BUFFERS 0x00040000
234/* Chip may not exist, so silence any errors in scan */ 229/* Chip may not exist, so silence any errors in scan */
235#define NAND_SCAN_SILENT_NODEV 0x00080000 230#define NAND_SCAN_SILENT_NODEV 0x00080000
236/*
237 * If passed additionally to NAND_USE_FLASH_BBT then BBT code will not touch
238 * the OOB area.
239 */
240#define NAND_USE_FLASH_BBT_NO_OOB 0x00800000
241/* Create an empty BBT with no vendor information if the BBT is available */ 231/* Create an empty BBT with no vendor information if the BBT is available */
242#define NAND_CREATE_EMPTY_BBT 0x01000000 232#define NAND_CREATE_EMPTY_BBT 0x01000000
243 233
@@ -615,6 +605,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len,
615 * @partitions: mtd partition list 605 * @partitions: mtd partition list
616 * @chip_delay: R/B delay value in us 606 * @chip_delay: R/B delay value in us
617 * @options: Option flags, e.g. 16bit buswidth 607 * @options: Option flags, e.g. 16bit buswidth
608 * @bbt_options: BBT option flags, e.g. NAND_BBT_USE_FLASH
618 * @ecclayout: ecc layout info structure 609 * @ecclayout: ecc layout info structure
619 * @part_probe_types: NULL-terminated array of probe types 610 * @part_probe_types: NULL-terminated array of probe types
620 * @set_parts: platform specific function to set partitions 611 * @set_parts: platform specific function to set partitions
@@ -628,6 +619,7 @@ struct platform_nand_chip {
628 struct nand_ecclayout *ecclayout; 619 struct nand_ecclayout *ecclayout;
629 int chip_delay; 620 int chip_delay;
630 unsigned int options; 621 unsigned int options;
622 unsigned int bbt_options;
631 const char **part_probe_types; 623 const char **part_probe_types;
632 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip); 624 void (*set_parts)(uint64_t size, struct platform_nand_chip *chip);
633 void *priv; 625 void *priv;