mtd: rawnand: Always store info about bad block markers in chip struct

The information about where the manufacturer puts the bad block
markers inside the bad block and in the OOB data is stored in
different places. Let's move this information to nand_chip.options
and nand_chip.badblockpos.

As this chip-specific information is not directly related to the
bad block table (BBT), we also rename the flags to NAND_BBM_*.

Signed-off-by: Frieder Schrempf <frieder.schrempf@kontron.de>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
Frieder Schrempf
2019-04-17 12:36:34 +00:00
committed by Miquel Raynal
parent 39e01956e2
commit 04649ec133
11 changed files with 34 additions and 20 deletions

View File

@@ -169,6 +169,20 @@ enum nand_ecc_algo {
/* Macros to identify the above */
#define NAND_HAS_SUBPAGE_READ(chip) ((chip->options & NAND_SUBPAGE_READ))
/*
* There are different places where the manufacturer stores the factory bad
* block markers.
*
* Position within the block: Each of these pages needs to be checked for a
* bad block marking pattern.
*/
#define NAND_BBM_SECONDPAGE 0x02000000
#define NAND_BBM_LASTPAGE 0x04000000
/* Position within the OOB data of the page */
#define NAND_BBM_POS_SMALL 5
#define NAND_BBM_POS_LARGE 0
/* Non chip related options */
/* This option skips the bbt scan during initialization. */
#define NAND_SKIP_BBTSCAN 0x00010000
@@ -1055,7 +1069,7 @@ struct nand_chip {
int subpagesize;
int onfi_timing_mode_default;
int badblockpos;
unsigned int badblockpos;
int badblockbits;
struct nand_id id;