__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * NAND family Bad Block Management (BBM) header file * - Bad Block Table (BBT) implementation * * Copyright © 2005 Samsung Electronics * Kyungmin Park <[email protected]> * * Copyright © 2000-2005 * Thomas Gleixner <[email protected]> */ #ifndef __LINUX_MTD_BBM_H #define __LINUX_MTD_BBM_H /* The maximum number of NAND chips in an array */ #define NAND_MAX_CHIPS 8 /** * struct nand_bbt_descr - bad block table descriptor * @options: options for this descriptor * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE * when bbt is searched, then we store the found bbts pages here. * Its an array and supports up to 8 chips now * @offs: offset of the pattern in the oob area of the page * @veroffs: offset of the bbt version counter in the oob are of the page * @version: version read from the bbt page during scan * @len: length of the pattern, if 0 no pattern check is performed * @maxblocks: maximum number of blocks to search for a bbt. This number of * blocks is reserved at the end of the device where the tables are * written. * @reserved_block_code: if non-0, this pattern denotes a reserved (rather than * bad) block in the stored bbt * @pattern: pattern to identify bad block table or factory marked good / * bad blocks, can be NULL, if len = 0 * * Descriptor for the bad block table marker and the descriptor for the * pattern which identifies good and bad blocks. The assumption is made * that the pattern and the version count are always located in the oob area * of the first block. */ struct nand_bbt_descr { int options; int pages[NAND_MAX_CHIPS]; int offs; int veroffs; uint8_t version[NAND_MAX_CHIPS]; int len; int maxblocks; int reserved_block_code; uint8_t *pattern; }; /* Options for the bad block table descriptors */ /* The number of bits used per block in the bbt on the device */ #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 /* The bad block table is in the last good block of the device */ #define NAND_BBT_LASTBLOCK 0x00000010 /* The bbt is at the given page, else we must scan for the bbt */ #define NAND_BBT_ABSPAGE 0x00000020 /* bbt is stored per chip on multichip devices */ #define NAND_BBT_PERCHIP 0x00000080 /* bbt has a version counter at offset veroffs */ #define NAND_BBT_VERSION 0x00000100 /* Create a bbt if none exists */ #define NAND_BBT_CREATE 0x00000200 /* * Create an empty BBT with no vendor information. Vendor's information may be * unavailable, for example, if the NAND controller has a different data and OOB * layout or if this information is already purged. Must be used in conjunction * with NAND_BBT_CREATE. */ #define NAND_BBT_CREATE_EMPTY 0x00000400 /* Write bbt if neccecary */ #define NAND_BBT_WRITE 0x00002000 /* Read and write back block contents when writing bbt */ #define NAND_BBT_SAVECONTENT 0x00004000 /* * Use a flash based bad block table. By default, OOB identifier is saved in * OOB area. This option is passed to the default bad block table function. */ #define NAND_BBT_USE_FLASH 0x00020000 /* * Do not store flash based bad block table marker in the OOB area; store it * in-band. */ #define NAND_BBT_NO_OOB 0x00040000 /* * Do not write new bad block markers to OOB; useful, e.g., when ECC covers * entire spare area. Must be used with NAND_BBT_USE_FLASH. */ #define NAND_BBT_NO_OOB_BBM 0x00080000 /* * Flag set by nand_create_default_bbt_descr(), marking that the nand_bbt_descr * was allocated dynamicaly and must be freed in nand_cleanup(). Has no meaning * in nand_chip.bbt_options. */ #define NAND_BBT_DYNAMICSTRUCT 0x80000000 /* The maximum number of blocks to scan for a bbt */ #define NAND_BBT_SCAN_MAXBLOCKS 4 /* * Bad block scanning errors */ #define ONENAND_BBT_READ_ERROR 1 #define ONENAND_BBT_READ_ECC_ERROR 2 #define ONENAND_BBT_READ_FATAL_ERROR 4 /** * struct bbm_info - [GENERIC] Bad Block Table data structure * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry * @options: options for this descriptor * @bbt: [INTERN] bad block table pointer * @isbad_bbt: function to determine if a block is bad * @badblock_pattern: [REPLACEABLE] bad block scan pattern used for * initial bad block scan * @priv: [OPTIONAL] pointer to private bbm date */ struct bbm_info { int bbt_erase_shift; int options; uint8_t *bbt; int (*isbad_bbt)(struct mtd_info *mtd, loff_t ofs, int allowbbt); /* TODO Add more NAND specific fileds */ struct nand_bbt_descr *badblock_pattern; void *priv; }; /* OneNAND BBT interface */ extern int onenand_default_bbt(struct mtd_info *mtd); #endif /* __LINUX_MTD_BBM_H */
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| bbm.h | File | 4.71 KB | 0644 |
|
| blktrans.h | File | 2.62 KB | 0644 |
|
| cfi.h | File | 9.89 KB | 0644 |
|
| cfi_endian.h | File | 1.48 KB | 0644 |
|
| concat.h | File | 493 B | 0644 |
|
| doc2000.h | File | 5.38 KB | 0644 |
|
| flashchip.h | File | 2.44 KB | 0644 |
|
| ftl.h | File | 2.49 KB | 0644 |
|
| gen_probe.h | File | 615 B | 0644 |
|
| hyperbus.h | File | 2.83 KB | 0644 |
|
| inftl.h | File | 1.56 KB | 0644 |
|
| jedec.h | File | 1.93 KB | 0644 |
|
| lpc32xx_mlc.h | File | 348 B | 0644 |
|
| lpc32xx_slc.h | File | 348 B | 0644 |
|
| map.h | File | 12.71 KB | 0644 |
|
| mtd.h | File | 22.3 KB | 0644 |
|
| mtdram.h | File | 257 B | 0644 |
|
| nand-ecc-mtk.h | File | 1.18 KB | 0644 |
|
| nand-ecc-mxic.h | File | 1.32 KB | 0644 |
|
| nand-ecc-sw-bch.h | File | 2.07 KB | 0644 |
|
| nand-ecc-sw-hamming.h | File | 2.65 KB | 0644 |
|
| nand-gpio.h | File | 330 B | 0644 |
|
| nand-qpic-common.h | File | 14.06 KB | 0644 |
|
| nand.h | File | 33.59 KB | 0644 |
|
| ndfc.h | File | 2.02 KB | 0644 |
|
| nftl.h | File | 1.69 KB | 0644 |
|
| onenand.h | File | 7.79 KB | 0644 |
|
| onenand_regs.h | File | 7.05 KB | 0644 |
|
| onfi.h | File | 4.88 KB | 0644 |
|
| partitions.h | File | 3.85 KB | 0644 |
|
| pfow.h | File | 4.38 KB | 0644 |
|
| physmap.h | File | 808 B | 0644 |
|
| pismo.h | File | 271 B | 0644 |
|
| plat-ram.h | File | 668 B | 0644 |
|
| platnand.h | File | 2.49 KB | 0644 |
|
| qinfo.h | File | 2.49 KB | 0644 |
|
| rawnand.h | File | 52.65 KB | 0644 |
|
| sh_flctl.h | File | 5.79 KB | 0644 |
|
| sharpsl.h | File | 485 B | 0644 |
|
| spear_smi.h | File | 1.67 KB | 0644 |
|
| spi-nor.h | File | 16.34 KB | 0644 |
|
| spinand.h | File | 19.25 KB | 0644 |
|
| super.h | File | 578 B | 0644 |
|
| ubi.h | File | 9.79 KB | 0644 |
|
| xip.h | File | 2.5 KB | 0644 |
|