Lines Matching refs:this
173 struct nand_chip *this = mtd_to_nand(mtd); in read_bbt() local
183 from = ((loff_t)page) << this->page_shift; in read_bbt()
186 len = min(totlen, (size_t)(1 << this->bbt_erase_shift)); in read_bbt()
222 this->bbt_erase_shift); in read_bbt()
223 bbt_mark_entry(this, offs + act, in read_bbt()
234 this->bbt_erase_shift); in read_bbt()
237 bbt_mark_entry(this, offs + act, in read_bbt()
240 bbt_mark_entry(this, offs + act, in read_bbt()
264 struct nand_chip *this = mtd_to_nand(mtd); in read_abs_bbt() local
269 for (i = 0; i < this->numchips; i++) { in read_abs_bbt()
272 this->chipsize >> this->bbt_erase_shift, in read_abs_bbt()
276 offs += this->chipsize >> this->bbt_erase_shift; in read_abs_bbt()
280 mtd->size >> this->bbt_erase_shift, td, 0); in read_abs_bbt()
389 struct nand_chip *this = mtd_to_nand(mtd); in read_abs_bbts() local
393 scan_read(mtd, buf, (loff_t)td->pages[0] << this->page_shift, in read_abs_bbts()
402 scan_read(mtd, buf, (loff_t)md->pages[0] << this->page_shift, in read_abs_bbts()
455 struct nand_chip *this = mtd_to_nand(mtd); in create_bbt() local
468 numblocks = mtd->size >> this->bbt_erase_shift; in create_bbt()
472 if (chip >= this->numchips) { in create_bbt()
474 chip + 1, this->numchips); in create_bbt()
477 numblocks = this->chipsize >> this->bbt_erase_shift; in create_bbt()
480 from = (loff_t)startblock << this->bbt_erase_shift; in create_bbt()
483 if (this->bbt_options & NAND_BBT_SCANLASTPAGE) in create_bbt()
496 bbt_mark_entry(this, i, BBT_BLOCK_FACTORY_BAD); in create_bbt()
502 from += (1 << this->bbt_erase_shift); in create_bbt()
524 struct nand_chip *this = mtd_to_nand(mtd); in search_bbt() local
529 int blocktopage = this->bbt_erase_shift - this->page_shift; in search_bbt()
533 startblock = (mtd->size >> this->bbt_erase_shift) - 1; in search_bbt()
542 chips = this->numchips; in search_bbt()
543 bbtblocks = this->chipsize >> this->bbt_erase_shift; in search_bbt()
547 bbtblocks = mtd->size >> this->bbt_erase_shift; in search_bbt()
558 loff_t offs = (loff_t)actblock << this->bbt_erase_shift; in search_bbt()
571 startblock += this->chipsize >> this->bbt_erase_shift; in search_bbt()
619 struct nand_chip *this = mtd_to_nand(mtd); in write_bbt() local
639 numblocks = (int)(this->chipsize >> this->bbt_erase_shift); in write_bbt()
642 nrchips = this->numchips; in write_bbt()
648 numblocks = (int)(mtd->size >> this->bbt_erase_shift); in write_bbt()
679 switch (bbt_get_entry(this, block)) { in write_bbt()
685 (this->bbt_erase_shift - this->page_shift); in write_bbt()
713 to = ((loff_t)page) << this->page_shift; in write_bbt()
718 to &= ~(((loff_t)1 << this->bbt_erase_shift) - 1); in write_bbt()
719 len = 1 << this->bbt_erase_shift; in write_bbt()
729 ops.ooblen = (len >> this->page_shift) * mtd->oobsize; in write_bbt()
736 pageoffs = page - (int)(to >> this->page_shift); in write_bbt()
737 offs = pageoffs << this->page_shift; in write_bbt()
764 (len >> this->page_shift)* mtd->oobsize); in write_bbt()
778 dat = bbt_get_entry(this, chip * numblocks + i); in write_bbt()
786 einfo.len = 1 << this->bbt_erase_shift; in write_bbt()
820 struct nand_chip *this = mtd_to_nand(mtd); in nand_memory_bbt() local
822 return create_bbt(mtd, this->buffers->databuf, bd, -1); in nand_memory_bbt()
839 struct nand_chip *this = mtd_to_nand(mtd); in check_create() local
840 struct nand_bbt_descr *td = this->bbt_td; in check_create()
841 struct nand_bbt_descr *md = this->bbt_md; in check_create()
846 chips = this->numchips; in check_create()
895 if (!(this->bbt_options & NAND_BBT_CREATE_EMPTY)) in check_create()
963 struct nand_chip *this = mtd_to_nand(mtd); in mark_bbt_region() local
969 chips = this->numchips; in mark_bbt_region()
970 nrblocks = (int)(this->chipsize >> this->bbt_erase_shift); in mark_bbt_region()
973 nrblocks = (int)(mtd->size >> this->bbt_erase_shift); in mark_bbt_region()
981 block = td->pages[i] >> (this->bbt_erase_shift - this->page_shift); in mark_bbt_region()
982 oldval = bbt_get_entry(this, block); in mark_bbt_region()
983 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
987 this->bbt_erase_shift); in mark_bbt_region()
996 oldval = bbt_get_entry(this, block); in mark_bbt_region()
997 bbt_mark_entry(this, block, BBT_BLOCK_RESERVED); in mark_bbt_region()
1009 this->bbt_erase_shift); in mark_bbt_region()
1023 struct nand_chip *this = mtd_to_nand(mtd); in verify_bbt_descr() local
1034 BUG_ON((this->bbt_options & NAND_BBT_NO_OOB) && in verify_bbt_descr()
1035 !(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1042 BUG_ON(!(this->bbt_options & NAND_BBT_USE_FLASH)); in verify_bbt_descr()
1043 BUG_ON(!(this->bbt_options & NAND_BBT_NO_OOB)); in verify_bbt_descr()
1051 table_size = this->chipsize >> this->bbt_erase_shift; in verify_bbt_descr()
1053 table_size = mtd->size >> this->bbt_erase_shift; in verify_bbt_descr()
1058 BUG_ON(table_size > (1 << this->bbt_erase_shift)); in verify_bbt_descr()
1075 struct nand_chip *this = mtd_to_nand(mtd); in nand_scan_bbt() local
1078 struct nand_bbt_descr *td = this->bbt_td; in nand_scan_bbt()
1079 struct nand_bbt_descr *md = this->bbt_md; in nand_scan_bbt()
1081 len = (mtd->size >> (this->bbt_erase_shift + 2)) ? : 1; in nand_scan_bbt()
1086 this->bbt = kzalloc(len, GFP_KERNEL); in nand_scan_bbt()
1087 if (!this->bbt) in nand_scan_bbt()
1105 len = (1 << this->bbt_erase_shift); in nand_scan_bbt()
1106 len += (len >> this->page_shift) * mtd->oobsize; in nand_scan_bbt()
1134 kfree(this->bbt); in nand_scan_bbt()
1135 this->bbt = NULL; in nand_scan_bbt()
1148 struct nand_chip *this = mtd_to_nand(mtd); 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_to_nand(mtd); 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_to_nand(mtd); 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_to_nand(mtd); 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_to_nand(mtd); 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()