Lines Matching refs:bbm
67 struct bbm_info *bbm = this->bbm; in create_bbt() local
87 numblocks = this->chipsize >> (bbm->bbt_erase_shift - 1); in create_bbt()
112 bbm->bbt[i >> 3] |= 0x03 << (i & 0x6); in create_bbt()
125 from += (1 << bbm->bbt_erase_shift); in create_bbt()
156 struct bbm_info *bbm = this->bbm; in onenand_isbad_bbt() local
162 res = (bbm->bbt[block >> 3] >> (block & 0x06)) & 0x03; in onenand_isbad_bbt()
196 struct bbm_info *bbm = this->bbm; in onenand_scan_bbt() local
201 bbm->bbt = malloc(len); in onenand_scan_bbt()
202 if (!bbm->bbt) in onenand_scan_bbt()
205 memset(bbm->bbt, 0x00, len); in onenand_scan_bbt()
208 bbm->badblockpos = ONENAND_BADBLOCK_POS; in onenand_scan_bbt()
211 bbm->bbt_erase_shift = this->erase_shift; in onenand_scan_bbt()
213 if (!bbm->isbad_bbt) in onenand_scan_bbt()
214 bbm->isbad_bbt = onenand_isbad_bbt; in onenand_scan_bbt()
220 free(bbm->bbt); in onenand_scan_bbt()
221 bbm->bbt = NULL; in onenand_scan_bbt()
250 struct bbm_info *bbm; in onenand_default_bbt() local
252 this->bbm = malloc(sizeof(struct bbm_info)); in onenand_default_bbt()
253 if (!this->bbm) in onenand_default_bbt()
256 bbm = this->bbm; in onenand_default_bbt()
258 memset(bbm, 0, sizeof(struct bbm_info)); in onenand_default_bbt()
261 if (!bbm->badblock_pattern) in onenand_default_bbt()
262 bbm->badblock_pattern = &largepage_memorybased; in onenand_default_bbt()
264 return onenand_scan_bbt(mtd, bbm->badblock_pattern); in onenand_default_bbt()