Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
bbm.h File Reference

Go to the source code of this file.

Data Structures

struct  nand_bbt_descr
 
struct  bbm_info
 

Macros

#define NAND_MAX_CHIPS   8
 
#define NAND_BBT_NRBITS_MSK   0x0000000F
 
#define NAND_BBT_1BIT   0x00000001
 
#define NAND_BBT_2BIT   0x00000002
 
#define NAND_BBT_4BIT   0x00000004
 
#define NAND_BBT_8BIT   0x00000008
 
#define NAND_BBT_LASTBLOCK   0x00000010
 
#define NAND_BBT_ABSPAGE   0x00000020
 
#define NAND_BBT_PERCHIP   0x00000080
 
#define NAND_BBT_VERSION   0x00000100
 
#define NAND_BBT_CREATE   0x00000200
 
#define NAND_BBT_CREATE_EMPTY   0x00000400
 
#define NAND_BBT_SCANALLPAGES   0x00000800
 
#define NAND_BBT_SCANEMPTY   0x00001000
 
#define NAND_BBT_WRITE   0x00002000
 
#define NAND_BBT_SAVECONTENT   0x00004000
 
#define NAND_BBT_SCAN2NDPAGE   0x00008000
 
#define NAND_BBT_SCANLASTPAGE   0x00010000
 
#define NAND_BBT_USE_FLASH   0x00020000
 
#define NAND_BBT_NO_OOB   0x00040000
 
#define NAND_BBT_NO_OOB_BBM   0x00080000
 
#define NAND_BBT_DYNAMICSTRUCT   0x80000000
 
#define NAND_BBT_SCAN_MAXBLOCKS   4
 
#define NAND_SMALL_BADBLOCK_POS   5
 
#define NAND_LARGE_BADBLOCK_POS   0
 
#define ONENAND_BADBLOCK_POS   0
 
#define ONENAND_BBT_READ_ERROR   1
 
#define ONENAND_BBT_READ_ECC_ERROR   2
 
#define ONENAND_BBT_READ_FATAL_ERROR   4
 

Functions

int onenand_scan_bbt (struct mtd_info *mtd, struct nand_bbt_descr *bd)
 
int onenand_default_bbt (struct mtd_info *mtd)
 

Macro Definition Documentation

#define NAND_BBT_1BIT   0x00000001

Definition at line 73 of file bbm.h.

#define NAND_BBT_2BIT   0x00000002

Definition at line 74 of file bbm.h.

#define NAND_BBT_4BIT   0x00000004

Definition at line 75 of file bbm.h.

#define NAND_BBT_8BIT   0x00000008

Definition at line 76 of file bbm.h.

#define NAND_BBT_ABSPAGE   0x00000020

Definition at line 80 of file bbm.h.

#define NAND_BBT_CREATE   0x00000200

Definition at line 86 of file bbm.h.

#define NAND_BBT_CREATE_EMPTY   0x00000400

Definition at line 93 of file bbm.h.

#define NAND_BBT_DYNAMICSTRUCT   0x80000000

Definition at line 127 of file bbm.h.

#define NAND_BBT_LASTBLOCK   0x00000010

Definition at line 78 of file bbm.h.

#define NAND_BBT_NO_OOB   0x00040000

Definition at line 115 of file bbm.h.

#define NAND_BBT_NO_OOB_BBM   0x00080000

Definition at line 120 of file bbm.h.

#define NAND_BBT_NRBITS_MSK   0x0000000F

Definition at line 72 of file bbm.h.

#define NAND_BBT_PERCHIP   0x00000080

Definition at line 82 of file bbm.h.

#define NAND_BBT_SAVECONTENT   0x00004000

Definition at line 101 of file bbm.h.

#define NAND_BBT_SCAN2NDPAGE   0x00008000

Definition at line 103 of file bbm.h.

#define NAND_BBT_SCAN_MAXBLOCKS   4

Definition at line 130 of file bbm.h.

#define NAND_BBT_SCANALLPAGES   0x00000800

Definition at line 95 of file bbm.h.

#define NAND_BBT_SCANEMPTY   0x00001000

Definition at line 97 of file bbm.h.

#define NAND_BBT_SCANLASTPAGE   0x00010000

Definition at line 105 of file bbm.h.

#define NAND_BBT_USE_FLASH   0x00020000

Definition at line 110 of file bbm.h.

#define NAND_BBT_VERSION   0x00000100

Definition at line 84 of file bbm.h.

#define NAND_BBT_WRITE   0x00002000

Definition at line 99 of file bbm.h.

#define NAND_LARGE_BADBLOCK_POS   0

Definition at line 136 of file bbm.h.

#define NAND_MAX_CHIPS   8

Definition at line 32 of file bbm.h.

#define NAND_SMALL_BADBLOCK_POS   5

Definition at line 135 of file bbm.h.

#define ONENAND_BADBLOCK_POS   0

Definition at line 137 of file bbm.h.

#define ONENAND_BBT_READ_ECC_ERROR   2

Definition at line 143 of file bbm.h.

#define ONENAND_BBT_READ_ERROR   1

Definition at line 142 of file bbm.h.

#define ONENAND_BBT_READ_FATAL_ERROR   4

Definition at line 144 of file bbm.h.

Function Documentation

int onenand_default_bbt ( struct mtd_info mtd)

onenand_default_bbt - [OneNAND Interface] Select a default bad block table for the device

Parameters
mtdMTD device structure

This function selects the default bad block table support for the device and calls the onenand_scan_bbt function

Definition at line 234 of file onenand_bbt.c.

int onenand_scan_bbt ( struct mtd_info mtd,
struct nand_bbt_descr bd 
)

onenand_scan_bbt - [OneNAND Interface] scan, find, read and maybe create bad block table(s)

Parameters
mtdMTD device structure
bddescriptor for the good/bad block search pattern

The function checks, if a bad block table(s) is/are already available. If not it scans the device for manufacturer marked good / bad blocks and writes the bad block table(s) to the selected place.

The bad block table memory is allocated here. It is freed by the onenand_release function.

Definition at line 183 of file onenand_bbt.c.