Lines Matching refs:this
178 struct nand_chip *this = mtd->priv; in read_bbt() local
188 from = ((loff_t)page) << this->page_shift; in read_bbt()
191 len = min(totlen, (size_t)(1 << this->bbt_erase_shift)); in read_bbt()
227 this->bbt_erase_shift); in read_bbt()
228 bbt_mark_entry(this, offs + act, in read_bbt()
239 this->bbt_erase_shift); in read_bbt()
242 bbt_mark_entry(this, offs + act, in read_bbt()
245 bbt_mark_entry(this, offs + act, in read_bbt()
269 struct nand_chip *this = mtd->priv; in read_abs_bbt() local
274 for (i = 0; i < this->numchips; i++) { in read_abs_bbt()
277 this->chipsize >> this->bbt_erase_shift, in read_abs_bbt()
281 offs += this->chipsize >> this->bbt_erase_shift; in read_abs_bbt()
285 mtd->size >> this->bbt_erase_shift, td, 0); in read_abs_bbt()
394 struct nand_chip *this = mtd->priv; in read_abs_bbts() local
398 scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift, in read_abs_bbts()
407 scan_read(mtd, buf, (loff_t)md->pages[0] << this->page_shift, in read_abs_bbts()
460 struct nand_chip *this = mtd->priv; in create_bbt() local
473 numblocks = mtd->size >> this->bbt_erase_shift; in create_bbt()
477 if (chip >= this->numchips) { in create_bbt()
479 chip + 1, this->numchips); in create_bbt()
482 numblocks = this->chipsize >> this->bbt_erase_shift; in create_bbt()
485 from = (loff_t)startblock << this->bbt_erase_shift; in create_bbt()
488 if (this->bbt_options & NAND_BBT_SCANLASTPAGE) in create_bbt()
501 bbt_mark_entry(this, i, BBT_BLOCK_FACTORY_BAD); in create_bbt()
507 from += (1 << this->bbt_erase_shift); in create_bbt()
529 struct nand_chip *this = mtd->priv; in search_bbt() local
534 int blocktopage = this->bbt_erase_shift - this->page_shift; in search_bbt()
538 startblock = (mtd->size >> this->bbt_erase_shift) - 1; in search_bbt()
547 chips = this->numchips; in search_bbt()
548 bbtblocks = this->chipsize >> this->bbt_erase_shift; in search_bbt()
552 bbtblocks = mtd->size >> this->bbt_erase_shift; in search_bbt()
563 loff_t offs = (loff_t)actblock << this->bbt_erase_shift; in search_bbt()
576 startblock += this->chipsize >> this->bbt_erase_shift; in search_bbt()
624 struct nand_chip *this = mtd->priv; in write_bbt() local
644 numblocks = (int)(this->chipsize >> this->bbt_erase_shift); in write_bbt()
647 nrchips = this->numchips; in write_bbt()
653 numblocks = (int)(mtd->size >> this->bbt_erase_shift); in write_bbt()
684 switch (bbt_get_entry(this, block)) { in write_bbt()
690 (this->bbt_erase_shift - this->page_shift); in write_bbt()
718 to = ((loff_t)page) << this->page_shift; in write_bbt()
723 to &= ~((loff_t)((1 << this->bbt_erase_shift) - 1)); in write_bbt()
724 len = 1 << this->bbt_erase_shift; in write_bbt()
734 ops.ooblen = (len >> this->page_shift) * mtd->oobsize; in write_bbt()
741 pageoffs = page - (int)(to >> this->page_shift); in write_bbt()
742 offs = pageoffs << this->page_shift; in write_bbt()
769 (len >> this->page_shift)* mtd->oobsize); in write_bbt()
783 dat = bbt_get_entry(this, chip * numblocks + i); in write_bbt()
791 einfo.len = 1 << this->bbt_erase_shift; in write_bbt()
825 struct nand_chip *this = mtd->priv; in nand_memory_bbt() local
827 return create_bbt(mtd, this->buffers->databuf, bd, -1); in nand_memory_bbt()
844 struct nand_chip *this = mtd->priv; in check_create() local
845 struct nand_bbt_descr *td = this->bbt_td; in check_create()
846 struct nand_bbt_descr *md = this->bbt_md; in check_create()
851 chips = this->numchips; in check_create()
900 if (!(this->bbt_options & NAND_BBT_CREATE_EMPTY)) in check_create()
968 struct nand_chip *this = mtd->priv; in mark_bbt_region() local
974 chips = this->numchips; in mark_bbt_region()
975 nrblocks = (int)(this->chipsize >> this->bbt_erase_shift); in mark_bbt_region()
978 nrblocks = (int)(mtd->size >> this->bbt_erase_shift); in mark_bbt_region()
986 block = td->pages[i] >> (this->bbt_erase_shift - this->page_shift); in mark_bbt_region()
987 oldval = bbt_get_entry(this, block); in mark_bbt_region()
988 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
992 this->bbt_erase_shift); in mark_bbt_region()
1001 oldval = bbt_get_entry(this, block); in mark_bbt_region()
1002 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
1014 this->bbt_erase_shift); in mark_bbt_region()
1028 struct nand_chip *this = mtd->priv; in verify_bbt_descr() local
1039 BUG_ON((this->bbt_options & NAND_BBT_NO_OOB) && in verify_bbt_descr()
1040 !(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1047 BUG_ON(!(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1048 BUG_ON(!(this->bbt_options & NAND_BBT_NO_OOB)); in verify_bbt_descr()
1056 table_size = this->chipsize >> this->bbt_erase_shift; in verify_bbt_descr()
1058 table_size = mtd->size >> this->bbt_erase_shift; in verify_bbt_descr()
1063 BUG_ON(table_size > (1 << this->bbt_erase_shift)); in verify_bbt_descr()
1080 struct nand_chip *this = mtd->priv; in nand_scan_bbt() local
1083 struct nand_bbt_descr *td = this->bbt_td; in nand_scan_bbt()
1084 struct nand_bbt_descr *md = this->bbt_md; in nand_scan_bbt()
1086 len = mtd->size >> (this->bbt_erase_shift + 2); in nand_scan_bbt()
1091 this->bbt = kzalloc(len, GFP_KERNEL); in nand_scan_bbt()
1092 if (!this->bbt) in nand_scan_bbt()
1102 kfree(this->bbt); in nand_scan_bbt()
1103 this->bbt = NULL; in nand_scan_bbt()
1111 len = (1 << this->bbt_erase_shift); in nand_scan_bbt()
1112 len += (len >> this->page_shift) * mtd->oobsize; in nand_scan_bbt()
1115 kfree(this->bbt); in nand_scan_bbt()
1116 this->bbt = NULL; in nand_scan_bbt()
1148 struct nand_chip *this = mtd->priv; in nand_update_bbt() local
1152 struct nand_bbt_descr *td = this->bbt_td; in nand_update_bbt()
1153 struct nand_bbt_descr *md = this->bbt_md; in nand_update_bbt()
1155 if (!this->bbt || !td) in nand_update_bbt()
1159 len = (1 << this->bbt_erase_shift); in nand_update_bbt()
1160 len += (len >> this->page_shift) * mtd->oobsize; in nand_update_bbt()
1167 chip = (int)(offs >> this->chip_shift); in nand_update_bbt()
1254 static int nand_create_badblock_pattern(struct nand_chip *this) in nand_create_badblock_pattern() argument
1257 if (this->badblock_pattern) { in nand_create_badblock_pattern()
1264 bd->options = this->bbt_options & BADBLOCK_SCAN_MASK; in nand_create_badblock_pattern()
1265 bd->offs = this->badblockpos; in nand_create_badblock_pattern()
1266 bd->len = (this->options & NAND_BUSWIDTH_16) ? 2 : 1; in nand_create_badblock_pattern()
1269 this->badblock_pattern = bd; in nand_create_badblock_pattern()
1282 struct nand_chip *this = mtd->priv; in nand_default_bbt() local
1286 if (this->bbt_options & NAND_BBT_USE_FLASH) { in nand_default_bbt()
1288 if (!this->bbt_td) { in nand_default_bbt()
1289 if (this->bbt_options & NAND_BBT_NO_OOB) { in nand_default_bbt()
1290 this->bbt_td = &bbt_main_no_oob_descr; in nand_default_bbt()
1291 this->bbt_md = &bbt_mirror_no_oob_descr; in nand_default_bbt()
1293 this->bbt_td = &bbt_main_descr; in nand_default_bbt()
1294 this->bbt_md = &bbt_mirror_descr; in nand_default_bbt()
1298 this->bbt_td = NULL; in nand_default_bbt()
1299 this->bbt_md = NULL; in nand_default_bbt()
1302 if (!this->badblock_pattern) { in nand_default_bbt()
1303 ret = nand_create_badblock_pattern(this); in nand_default_bbt()
1308 return nand_scan_bbt(mtd, this->badblock_pattern); in nand_default_bbt()
1318 struct nand_chip *this = mtd->priv; in nand_isreserved_bbt() local
1321 block = (int)(offs >> this->bbt_erase_shift); in nand_isreserved_bbt()
1322 return bbt_get_entry(this, block) == BBT_BLOCK_RESERVED; in nand_isreserved_bbt()
1333 struct nand_chip *this = mtd->priv; in nand_isbad_bbt() local
1336 block = (int)(offs >> this->bbt_erase_shift); in nand_isbad_bbt()
1337 res = bbt_get_entry(this, block); in nand_isbad_bbt()
1360 struct nand_chip *this = mtd->priv; in nand_markbad_bbt() local
1363 block = (int)(offs >> this->bbt_erase_shift); in nand_markbad_bbt()
1366 bbt_mark_entry(this, block, BBT_BLOCK_WORN); in nand_markbad_bbt()
1369 if (this->bbt_options & NAND_BBT_USE_FLASH) in nand_markbad_bbt()