Lines Matching full:bbt
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()
103 nand->bbt.version = version; in nanddev_read_bbt()
118 BITS_PER_LONG) * sizeof(*nand->bbt.cache); in nanddev_write_bbt()
127 BBT_DBG("write_bbt to blk=%d ver=%d\n", block, nand->bbt.version); in nanddev_write_bbt()
128 if (!nand->bbt.cache) in nanddev_write_bbt()
151 memcpy(data_buf, nand->bbt.cache, nbytes); in nanddev_write_bbt()
153 bbt_info->version = nand->bbt.version; in nanddev_write_bbt()
209 nand->bbt.version = 0; in nanddev_scan_bbt()
214 nand->bbt.option |= NANDDEV_BBT_SCANNED; in nanddev_scan_bbt()
216 if (nand->bbt.version == 0) { in nanddev_scan_bbt()
220 nand->bbt.option = 0; in nanddev_scan_bbt()
231 * nanddev_bbt_init() - Initialize the BBT (Bad Block Table)
234 * Initialize the in-memory BBT.
245 nand->bbt.cache = kcalloc(nwords, sizeof(*nand->bbt.cache), in nanddev_bbt_init()
247 if (!nand->bbt.cache) in nanddev_bbt_init()
255 * nanddev_bbt_cleanup() - Cleanup the BBT (Bad Block Table)
262 kfree(nand->bbt.cache); in nanddev_bbt_cleanup()
267 * nanddev_bbt_update() - Update a BBT
270 * Update the BBT. Currently a NOP function since on-flash bbt is not yet
278 if (nand->bbt.cache && in nanddev_bbt_update()
279 nand->bbt.option & NANDDEV_BBT_USE_FLASH) { in nanddev_bbt_update()
313 nand->bbt.version++; in nanddev_bbt_update()
340 * @entry: the BBT entry
343 * is bigger than the BBT size.
349 unsigned long *pos = nand->bbt.cache + in nanddev_bbt_get_block_status()
355 if (nand->bbt.option & NANDDEV_BBT_USE_FLASH && in nanddev_bbt_get_block_status()
356 !(nand->bbt.option & NANDDEV_BBT_SCANNED)) in nanddev_bbt_get_block_status()
373 * in-memory BBT
375 * @entry: the BBT entry to update
378 * Update an entry of the in-memory BBT. If you want to push the updated BBT
381 * Return: 0 in case of success or -%ERANGE if @entry is bigger than the BBT
388 unsigned long *pos = nand->bbt.cache + in nanddev_bbt_set_block_status()