| /OK3568_Linux_fs/u-boot/drivers/mtd/nand/ |
| H A D | bbt.c | 10 #define pr_fmt(fmt) "nand-bbt: " fmt 33 * nanddev_read_bbt() - Read the BBT (Bad Block Table) 35 * @block: bbt block address 36 * @update: true - get version and overwrite bbt.cache with new version; 37 * false - get bbt version only; 39 * Initialize the in-memory BBT. 48 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_read_bbt() 57 if (!nand->bbt.cache) in nanddev_read_bbt() 101 if (update && version > nand->bbt.version) { in nanddev_read_bbt() 102 memcpy(nand->bbt.cache, data_buf, nbytes); in nanddev_read_bbt() [all …]
|
| H A D | bbt.su | |
| H A D | Kconfig | 5 bool "Mtd Nand BBT using flash management strategy" 8 This is a simple flash BBT management strategy for Nand devices. 10 Say Y when you want to use BBT in flash.
|
| /OK3568_Linux_fs/kernel/drivers/rkflash/ |
| H A D | sfc_nand_mtd_bbt.c | 32 * nanddev_read_bbt() - Read the BBT (Bad Block Table) 34 * @block: bbt block address 35 * @update: true - get version and overwrite bbt.cache with new version; 36 * false - get bbt version only; 38 * Initialize the in-memory BBT. 47 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_read_bbt() 57 if (!nand->bbt.cache) in nanddev_read_bbt() 114 if (update && version > nand->bbt.version) { in nanddev_read_bbt() 115 memcpy(nand->bbt.cache, data_buf, nbytes); in nanddev_read_bbt() 116 nand->bbt.version = version; in nanddev_read_bbt() [all …]
|
| H A D | sfc_nand_mtd.h | 11 /* BBT related functions */ 26 /* The maximum number of blocks to scan for a bbt */ 40 struct snand_bbt bbt; member 52 return !!nand->bbt.cache; in snanddev_bbt_is_initialized()
|
| /OK3568_Linux_fs/kernel/drivers/mtd/nand/ |
| H A D | bbt.c | 10 #define pr_fmt(fmt) "nand-bbt: " fmt 16 * nanddev_bbt_init() - Initialize the BBT (Bad Block Table) 19 * Initialize the in-memory BBT. 30 nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache), in nanddev_bbt_init() 32 if (!nand->bbt.cache) in nanddev_bbt_init() 40 * nanddev_bbt_cleanup() - Cleanup the BBT (Bad Block Table) 47 kfree(nand->bbt.cache); in nanddev_bbt_cleanup() 52 * nanddev_bbt_update() - Update a BBT 55 * Update the BBT. Currently a NOP function since on-flash bbt is not yet 69 * @entry: the BBT entry [all …]
|
| H A D | bbt_store.c | 28 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_read_bbt() 37 if (!nand->bbt.cache) in nanddev_read_bbt() 80 if (update && version > nand->bbt.version) { in nanddev_read_bbt() 81 memcpy(nand->bbt.cache, data_buf, nbytes); in nanddev_read_bbt() 82 nand->bbt.version = version; in nanddev_read_bbt() 97 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_write_bbt() 106 BBT_DBG("write_bbt to blk=%d ver=%d\n", block, nand->bbt.version); in nanddev_write_bbt() 107 if (!nand->bbt.cache) in nanddev_write_bbt() 130 memcpy(data_buf, nand->bbt.cache, nbytes); in nanddev_write_bbt() 132 bbt_info->version = nand->bbt.version; in nanddev_write_bbt() [all …]
|
| H A D | Kconfig | 19 bool "Mtd Nand BBT using flash management strategy" 22 This is a simple flash BBT management strategy for Nand devices. 24 Say Y when you want to use BBT in flash.
|
| /OK3568_Linux_fs/kernel/include/linux/mtd/ |
| H A D | bbm.h | 4 * - Bad Block Table (BBT) implementation 21 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE 22 * when bbt is searched, then we store the found bbts pages here. 25 * @veroffs: offset of the bbt version counter in the oob are of the page 26 * @version: version read from the bbt page during scan 28 * @maxblocks: maximum number of blocks to search for a bbt. This number of 32 * bad) block in the stored bbt 55 /* The number of bits used per block in the bbt on the device */ 63 /* The bbt is at the given page, else we must scan for the bbt */ 65 /* bbt is stored per chip on multichip devices */ [all …]
|
| H A D | nand.h | 204 /* The maximum number of blocks to scan for a bbt */ 209 * @cache: in memory BBT cache 210 * @option: the option of BBT 211 * @version: current memory BBT cache version 318 * @bbt: bad block table info 336 struct nand_bbt bbt; member 899 /* BBT related functions */ 919 * nanddev_bbt_pos_to_entry() - Convert a NAND position into a BBT entry 921 * @pos: the NAND position we want to get BBT entry for 923 * Return the BBT entry used to store information about the eraseblock pointed [all …]
|
| /OK3568_Linux_fs/u-boot/include/linux/mtd/ |
| H A D | bbm.h | 5 * - Bad Block Table (BBT) implementation 27 * @pages: the page(s) where we find the bbt, used with option BBT_ABSPAGE 28 * when bbt is searched, then we store the found bbts pages here. 31 * @veroffs: offset of the bbt version counter in the oob are of the page 32 * @version: version read from the bbt page during scan 34 * @maxblocks: maximum number of blocks to search for a bbt. This number of 38 * bad) block in the stored bbt 61 /* The number of bits used per block in the bbt on the device */ 69 /* The bbt is at the given page, else we must scan for the bbt */ 71 /* bbt is stored per chip on multichip devices */ [all …]
|
| H A D | nand.h | 129 /* The maximum number of blocks to scan for a bbt */ 134 * @cache: in memory BBT cache 135 * @option: the option of BBT 136 * @version: current memory BBT cache version 174 * @bbt: bad block table info 192 struct nand_bbt bbt; member 693 /* BBT related functions */ 713 * nanddev_bbt_pos_to_entry() - Convert a NAND position into a BBT entry 715 * @pos: the NAND position we want to get BBT entry for 717 * Return the BBT entry used to store information about the eraseblock pointed [all …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/nand/raw/ |
| H A D | nand_bbt.c | 11 * depending on the options in the BBT descriptor(s). If no flash based BBT 13 * marked good / bad blocks. This information is used to create a memory BBT. 16 * If a flash based BBT is specified then the function first tries to find the 17 * BBT on flash. If a BBT is found then the contents are read and the memory 18 * based BBT is created. If a mirrored BBT is selected then the mirror is 20 * version number, then the mirror BBT is used to build the memory based BBT. 23 * If no BBT exists at all then the device is scanned for factory marked 27 * the BBT is searched and read but never created 46 * 10b: block is reserved (to protect the bbt area) 53 * - the space necessary for a bbt in FLASH does not exceed a block boundary [all …]
|
| /OK3568_Linux_fs/u-boot/drivers/mtd/nand/raw/ |
| H A D | nand_bbt.c | 14 * depending on the options in the BBT descriptor(s). If no flash based BBT 16 * marked good / bad blocks. This information is used to create a memory BBT. 19 * If a flash based BBT is specified then the function first tries to find the 20 * BBT on flash. If a BBT is found then the contents are read and the memory 21 * based BBT is created. If a mirrored BBT is selected then the mirror is 23 * version number, then the mirror BBT is used to build the memory based BBT. 26 * If no BBT exists at all then the device is scanned for factory marked 30 * the BBT is searched and read but never created 49 * 10b: block is reserved (to protect the bbt area) 56 * - the space necessary for a bbt in FLASH does not exceed a block boundary [all …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/tests/ |
| H A D | speedtest.c | 35 static unsigned char *bbt; variable 229 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_speedtest_init() 230 if (!bbt) in mtd_speedtest_init() 232 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init() 236 if (!bbt[i]) in mtd_speedtest_init() 240 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init() 248 if (bbt[i]) in mtd_speedtest_init() 266 if (bbt[i]) in mtd_speedtest_init() 280 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_speedtest_init() 288 if (bbt[i]) in mtd_speedtest_init() [all …]
|
| H A D | pagetest.c | 32 static unsigned char *bbt; variable 58 for (i = 0; i < ebcnt && bbt[i]; ++i) in verify_eraseblock() 62 for (i = 0; i < ebcnt && bbt[ebcnt - i - 1]; ++i) in verify_eraseblock() 85 if (addr <= addrn - pgsize - pgsize && !bbt[ebnum + 1]) { in verify_eraseblock() 126 for (i = 0; i < ebcnt && bbt[i]; ++i) in crosstest() 130 for (i = 0; i < ebcnt && bbt[ebcnt - i - 1]; ++i) in crosstest() 198 for (i = 0; i < ebcnt && bbt[i]; ++i) { in erasecrosstest() 204 while (ebnum2 && bbt[ebnum2]) in erasecrosstest() 276 for (i = 0; i < ebcnt && bbt[i]; ++i) { in erasetest() 372 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_pagetest_init() [all …]
|
| H A D | oobtest.c | 34 static unsigned char *bbt; variable 96 if (bbt[i]) in write_whole_device() 320 if (bbt[i]) in verify_all_eraseblocks() 385 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_oobtest_init() 386 if (!bbt) in mtd_oobtest_init() 389 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_oobtest_init() 401 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_oobtest_init() 421 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_oobtest_init() 434 if (bbt[i]) in mtd_oobtest_init() 454 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_oobtest_init() [all …]
|
| H A D | subpagetest.c | 29 static unsigned char *bbt; variable 252 if (bbt[i]) in verify_all_eraseblocks_ff() 317 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_subpagetest_init() 318 if (!bbt) in mtd_subpagetest_init() 321 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init() 325 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init() 332 if (bbt[i]) in mtd_subpagetest_init() 349 if (bbt[i]) in mtd_subpagetest_init() 363 err = mtdtest_erase_good_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_subpagetest_init() 375 if (bbt[i]) in mtd_subpagetest_init() [all …]
|
| H A D | stresstest.c | 35 static unsigned char *bbt; variable 51 if (bbt[eb]) in rand_eb() 81 if (bbt[eb + 1]) { in do_read() 106 if (bbt[eb + 1]) in do_write() 197 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_stresstest_init() 198 if (!bbt) in mtd_stresstest_init() 200 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_stresstest_init() 221 kfree(bbt); in mtd_stresstest_init()
|
| H A D | mtd_test.c | 41 int mtdtest_scan_for_bad_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, in mtdtest_scan_for_bad_eraseblocks() argument 51 bbt[i] = is_block_bad(mtd, eb + i) ? 1 : 0; in mtdtest_scan_for_bad_eraseblocks() 52 if (bbt[i]) in mtdtest_scan_for_bad_eraseblocks() 61 int mtdtest_erase_good_eraseblocks(struct mtd_info *mtd, unsigned char *bbt, in mtdtest_erase_good_eraseblocks() argument 68 if (bbt[i]) in mtdtest_erase_good_eraseblocks()
|
| H A D | readtest.c | 34 static unsigned char *bbt; variable 166 bbt = kzalloc(ebcnt, GFP_KERNEL); in mtd_readtest_init() 167 if (!bbt) in mtd_readtest_init() 169 err = mtdtest_scan_for_bad_eraseblocks(mtd, bbt, 0, ebcnt); in mtd_readtest_init() 180 if (bbt[i]) in mtd_readtest_init() 206 kfree(bbt); in mtd_readtest_init()
|
| /OK3568_Linux_fs/u-boot/spl/drivers/mtd/nand/ |
| H A D | bbt.su | |
| H A D | .bbt.o.cmd | |
| /OK3568_Linux_fs/u-boot/drivers/mtd/onenand/ |
| H A D | onenand_bbt.c | 10 * Split BBT core and chip specific BBT. 111 bbm->bbt[i >> 3] |= 0x03 << (i & 0x6); in create_bbt() 135 * The function creates a memory based bbt by scanning the device 161 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; in onenand_isbad_bbt() 163 pr_debug("onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", in onenand_isbad_bbt() 200 bbm->bbt = malloc(len); in onenand_scan_bbt() 201 if (!bbm->bbt) in onenand_scan_bbt() 204 memset(bbm->bbt, 0x00, len); in onenand_scan_bbt() 218 "onenand_scan_bbt: Can't scan flash and build the RAM-based BBT\n"); in onenand_scan_bbt() 219 free(bbm->bbt); in onenand_scan_bbt() [all …]
|
| /OK3568_Linux_fs/kernel/drivers/mtd/nand/onenand/ |
| H A D | onenand_bbt.c | 11 * Split BBT core and chip specific BBT. 103 bbm->bbt[i >> 3] |= 0x03 << (i & 0x6); in create_bbt() 128 * The function creates a memory based bbt by scanning the device 153 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; in onenand_isbad_bbt() 155 pr_debug("onenand_isbad_bbt: bbt info for offs 0x%08x: (block %d) 0x%02x\n", in onenand_isbad_bbt() 189 bbm->bbt = kzalloc(len, GFP_KERNEL); in onenand_scan_bbt() 190 if (!bbm->bbt) in onenand_scan_bbt() 201 printk(KERN_ERR "onenand_scan_bbt: Can't scan flash and build the RAM-based BBT\n"); in onenand_scan_bbt() 202 kfree(bbm->bbt); in onenand_scan_bbt() 203 bbm->bbt = NULL; in onenand_scan_bbt()
|