Commit a40f7341 authored by Brian Norris's avatar Brian Norris Committed by Artem Bityutskiy
Browse files

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: default avatarBrian Norris <computersforpeace@gmail.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
parent 5fb1549d
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -572,7 +572,7 @@ static void board_select_chip (struct mtd_info *mtd, int chip)
			</para>
			<para>
				The simplest way to activate the FLASH based bad block table support 
				is to set the option NAND_USE_FLASH_BBT in the option field of
				is to set the option NAND_USE_FLASH_BBT in the bbt_option field of
				the nand chip structure before calling nand_scan(). For AG-AND
				chips is this done by default.
				This activates the default FLASH based bad block table functionality 
@@ -1158,9 +1158,6 @@ in this page</entry>
		These constants are defined in nand.h. They are ored together to describe
		the functionality.
     		<programlisting>
/* Use a flash based bad block table. This option is parsed by the
 * default bad block table function (nand_default_bbt). */
#define NAND_USE_FLASH_BBT	0x00010000
/* The hw ecc generator provides a syndrome instead a ecc value on read 
 * This can only work if we have the ecc bytes directly behind the 
 * data bytes. Applies for DOC and AG-AND Renesas HW Reed Solomon generators */
+1 −1
Original line number Diff line number Diff line
@@ -377,7 +377,7 @@ static struct davinci_nand_pdata da830_evm_nand_pdata = {
	.nr_parts	= ARRAY_SIZE(da830_evm_nand_partitions),
	.ecc_mode	= NAND_ECC_HW,
	.ecc_bits	= 4,
	.options	= NAND_USE_FLASH_BBT,
	.bbt_options	= NAND_USE_FLASH_BBT,
	.bbt_td		= &da830_evm_nand_bbt_main_descr,
	.bbt_md		= &da830_evm_nand_bbt_mirror_descr,
	.timing         = &da830_evm_nandflash_timing,
+1 −1
Original line number Diff line number Diff line
@@ -225,7 +225,7 @@ static struct davinci_nand_pdata da850_evm_nandflash_data = {
	.nr_parts	= ARRAY_SIZE(da850_evm_nandflash_partition),
	.ecc_mode	= NAND_ECC_HW,
	.ecc_bits	= 4,
	.options	= NAND_USE_FLASH_BBT,
	.bbt_options	= NAND_USE_FLASH_BBT,
	.timing		= &da850_evm_nandflash_timing,
};

+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
	.parts			= davinci_nand_partitions,
	.nr_parts		= ARRAY_SIZE(davinci_nand_partitions),
	.ecc_mode		= NAND_ECC_HW,
	.options		= NAND_USE_FLASH_BBT,
	.bbt_options		= NAND_USE_FLASH_BBT,
	.ecc_bits		= 4,
};

+1 −1
Original line number Diff line number Diff line
@@ -74,7 +74,7 @@ static struct davinci_nand_pdata davinci_nand_data = {
	.parts			= davinci_nand_partitions,
	.nr_parts		= ARRAY_SIZE(davinci_nand_partitions),
	.ecc_mode		= NAND_ECC_HW_SYNDROME,
	.options		= NAND_USE_FLASH_BBT,
	.bbt_options		= NAND_USE_FLASH_BBT,
};

static struct resource davinci_nand_resources[] = {
Loading