Lines Matching refs:this
87 static void doc200x_hwcontrol(struct nand_chip *this, int cmd,
89 static void doc200x_select_chip(struct nand_chip *this, int chip);
294 static void doc2000_write_byte(struct nand_chip *this, u_char datum) in doc2000_write_byte() argument
296 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_write_byte()
305 static u_char doc2000_read_byte(struct nand_chip *this) in doc2000_read_byte() argument
307 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_read_byte()
319 static void doc2000_writebuf(struct nand_chip *this, const u_char *buf, in doc2000_writebuf() argument
322 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_writebuf()
336 static void doc2000_readbuf(struct nand_chip *this, u_char *buf, int len) in doc2000_readbuf() argument
338 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_readbuf()
349 static void doc2000_readbuf_dword(struct nand_chip *this, u_char *buf, int len) in doc2000_readbuf_dword() argument
351 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_readbuf_dword()
371 struct nand_chip *this = mtd_to_nand(mtd); in doc200x_ident_chip() local
372 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_ident_chip()
375 doc200x_select_chip(this, nr); in doc200x_ident_chip()
376 doc200x_hwcontrol(this, NAND_CMD_READID, in doc200x_ident_chip()
378 doc200x_hwcontrol(this, 0, NAND_CTRL_ALE | NAND_CTRL_CHANGE); in doc200x_ident_chip()
379 doc200x_hwcontrol(this, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); in doc200x_ident_chip()
386 ret = this->legacy.read_byte(this) << 8; in doc200x_ident_chip()
387 ret |= this->legacy.read_byte(this); in doc200x_ident_chip()
397 doc200x_hwcontrol(this, NAND_CMD_READID, in doc200x_ident_chip()
399 doc200x_hwcontrol(this, 0, NAND_CTRL_ALE | NAND_CTRL_CHANGE); in doc200x_ident_chip()
400 doc200x_hwcontrol(this, NAND_CMD_NONE, in doc200x_ident_chip()
408 this->legacy.read_buf = &doc2000_readbuf_dword; in doc200x_ident_chip()
417 struct nand_chip *this = mtd_to_nand(mtd); in doc2000_count_chips() local
418 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_count_chips()
437 static int doc200x_wait(struct nand_chip *this) in doc200x_wait() argument
439 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_wait()
444 nand_status_op(this, NULL); in doc200x_wait()
446 status = (int)this->legacy.read_byte(this); in doc200x_wait()
451 static void doc2001_write_byte(struct nand_chip *this, u_char datum) in doc2001_write_byte() argument
453 struct doc_priv *doc = nand_get_controller_data(this); in doc2001_write_byte()
461 static u_char doc2001_read_byte(struct nand_chip *this) in doc2001_read_byte() argument
463 struct doc_priv *doc = nand_get_controller_data(this); in doc2001_read_byte()
474 static void doc2001_writebuf(struct nand_chip *this, const u_char *buf, int len) in doc2001_writebuf() argument
476 struct doc_priv *doc = nand_get_controller_data(this); in doc2001_writebuf()
486 static void doc2001_readbuf(struct nand_chip *this, u_char *buf, int len) in doc2001_readbuf() argument
488 struct doc_priv *doc = nand_get_controller_data(this); in doc2001_readbuf()
502 static u_char doc2001plus_read_byte(struct nand_chip *this) in doc2001plus_read_byte() argument
504 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_read_byte()
516 static void doc2001plus_writebuf(struct nand_chip *this, const u_char *buf, int len) in doc2001plus_writebuf() argument
518 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_writebuf()
533 static void doc2001plus_readbuf(struct nand_chip *this, u_char *buf, int len) in doc2001plus_readbuf() argument
535 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_readbuf()
563 static void doc2001plus_select_chip(struct nand_chip *this, int chip) in doc2001plus_select_chip() argument
565 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_select_chip()
583 nand_reset_op(this); in doc2001plus_select_chip()
589 static void doc200x_select_chip(struct nand_chip *this, int chip) in doc200x_select_chip() argument
591 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_select_chip()
605 doc200x_hwcontrol(this, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE); in doc200x_select_chip()
610 doc200x_hwcontrol(this, NAND_CMD_NONE, NAND_NCE | NAND_CTRL_CHANGE); in doc200x_select_chip()
618 static void doc200x_hwcontrol(struct nand_chip *this, int cmd, in doc200x_hwcontrol() argument
621 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_hwcontrol()
635 doc2000_write_byte(this, cmd); in doc200x_hwcontrol()
637 doc2001_write_byte(this, cmd); in doc200x_hwcontrol()
641 static void doc2001plus_command(struct nand_chip *this, unsigned command, in doc2001plus_command() argument
644 struct mtd_info *mtd = nand_to_mtd(this); in doc2001plus_command()
645 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_command()
684 if (this->options & NAND_BUSWIDTH_16 && in doc2001plus_command()
692 if (this->options & NAND_ROW_ADDR_3) { in doc2001plus_command()
719 if (this->legacy.dev_ready) in doc2001plus_command()
721 udelay(this->legacy.chip_delay); in doc2001plus_command()
725 while (!(this->legacy.read_byte(this) & 0x40)) ; in doc2001plus_command()
734 if (!this->legacy.dev_ready) { in doc2001plus_command()
735 udelay(this->legacy.chip_delay); in doc2001plus_command()
744 while (!this->legacy.dev_ready(this)) ; in doc2001plus_command()
747 static int doc200x_dev_ready(struct nand_chip *this) in doc200x_dev_ready() argument
749 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_dev_ready()
779 static int doc200x_block_bad(struct nand_chip *this, loff_t ofs) in doc200x_block_bad() argument
786 static void doc200x_enable_hwecc(struct nand_chip *this, int mode) in doc200x_enable_hwecc() argument
788 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_enable_hwecc()
804 static void doc2001plus_enable_hwecc(struct nand_chip *this, int mode) in doc2001plus_enable_hwecc() argument
806 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_enable_hwecc()
823 static int doc200x_calculate_ecc(struct nand_chip *this, const u_char *dat, in doc200x_calculate_ecc() argument
826 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_calculate_ecc()
882 static int doc200x_correct_data(struct nand_chip *this, u_char *dat, in doc200x_correct_data() argument
886 struct doc_priv *doc = nand_get_controller_data(this); in doc200x_correct_data()
987 struct nand_chip *this = mtd_to_nand(mtd); in find_media_headers() local
988 struct doc_priv *doc = nand_get_controller_data(this); in find_media_headers()
1004 doc->mh0_page = offs >> this->page_shift; in find_media_headers()
1009 doc->mh1_page = offs >> this->page_shift; in find_media_headers()
1018 offs = doc->mh0_page << this->page_shift; in find_media_headers()
1030 struct nand_chip *this = mtd_to_nand(mtd); in nftl_partscan() local
1031 struct doc_priv *doc = nand_get_controller_data(this); in nftl_partscan()
1036 const unsigned psize = 1 << this->page_shift; in nftl_partscan()
1041 memorg = nanddev_get_memorg(&this->base); in nftl_partscan()
1064 blocks = mtd->size >> this->phys_erase_shift; in nftl_partscan()
1088 this->bbt_erase_shift += (0xff - mh->UnitSizeFactor); in nftl_partscan()
1092 blocks = mtd->size >> this->bbt_erase_shift; in nftl_partscan()
1103 offs <<= this->page_shift; in nftl_partscan()
1115 parts[numparts].size = (mh->NumEraseUnits - numheaders) << this->bbt_erase_shift; in nftl_partscan()
1136 struct nand_chip *this = mtd_to_nand(mtd); in inftl_partscan() local
1137 struct doc_priv *doc = nand_get_controller_data(this); in inftl_partscan()
1149 end -= (INFTL_BBT_RESERVED_BLOCKS << this->phys_erase_shift); in inftl_partscan()
1158 doc->mh1_page = doc->mh0_page + (4096 >> this->page_shift); in inftl_partscan()
1186 vshift = this->phys_erase_shift + mh->BlockMultiplierBits; in inftl_partscan()
1194 blocks = doc->chips_per_floor << (this->chip_shift - this->phys_erase_shift); in inftl_partscan()
1256 struct nand_chip *this = mtd_to_nand(mtd); in nftl_scan_bbt() local
1257 struct doc_priv *doc = nand_get_controller_data(this); in nftl_scan_bbt()
1266 this->bbt_td->options = NAND_BBT_ABSPAGE | NAND_BBT_8BIT | in nftl_scan_bbt()
1269 this->bbt_td->veroffs = 7; in nftl_scan_bbt()
1270 this->bbt_td->pages[0] = doc->mh0_page + 1; in nftl_scan_bbt()
1272 this->bbt_md->options = NAND_BBT_ABSPAGE | NAND_BBT_8BIT | in nftl_scan_bbt()
1275 this->bbt_md->veroffs = 7; in nftl_scan_bbt()
1276 this->bbt_md->pages[0] = doc->mh1_page + 1; in nftl_scan_bbt()
1278 this->bbt_md = NULL; in nftl_scan_bbt()
1281 ret = nand_create_bbt(this); in nftl_scan_bbt()
1291 struct nand_chip *this = mtd_to_nand(mtd); in inftl_scan_bbt() local
1292 struct doc_priv *doc = nand_get_controller_data(this); in inftl_scan_bbt()
1295 if (nanddev_ntargets(&this->base) > doc->chips_per_floor) { in inftl_scan_bbt()
1301 this->bbt_td->options = NAND_BBT_2BIT | NAND_BBT_ABSPAGE; in inftl_scan_bbt()
1303 this->bbt_td->options |= NAND_BBT_WRITE; in inftl_scan_bbt()
1304 this->bbt_td->pages[0] = 2; in inftl_scan_bbt()
1305 this->bbt_md = NULL; in inftl_scan_bbt()
1307 this->bbt_td->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT | NAND_BBT_VERSION; in inftl_scan_bbt()
1309 this->bbt_td->options |= NAND_BBT_WRITE; in inftl_scan_bbt()
1310 this->bbt_td->offs = 8; in inftl_scan_bbt()
1311 this->bbt_td->len = 8; in inftl_scan_bbt()
1312 this->bbt_td->veroffs = 7; in inftl_scan_bbt()
1313 this->bbt_td->maxblocks = INFTL_BBT_RESERVED_BLOCKS; in inftl_scan_bbt()
1314 this->bbt_td->reserved_block_code = 0x01; in inftl_scan_bbt()
1315 this->bbt_td->pattern = "MSYS_BBT"; in inftl_scan_bbt()
1317 this->bbt_md->options = NAND_BBT_LASTBLOCK | NAND_BBT_8BIT | NAND_BBT_VERSION; in inftl_scan_bbt()
1319 this->bbt_md->options |= NAND_BBT_WRITE; in inftl_scan_bbt()
1320 this->bbt_md->offs = 8; in inftl_scan_bbt()
1321 this->bbt_md->len = 8; in inftl_scan_bbt()
1322 this->bbt_md->veroffs = 7; in inftl_scan_bbt()
1323 this->bbt_md->maxblocks = INFTL_BBT_RESERVED_BLOCKS; in inftl_scan_bbt()
1324 this->bbt_md->reserved_block_code = 0x01; in inftl_scan_bbt()
1325 this->bbt_md->pattern = "TBB_SYSM"; in inftl_scan_bbt()
1328 ret = nand_create_bbt(this); in inftl_scan_bbt()
1344 struct nand_chip *this = mtd_to_nand(mtd); in doc2000_init() local
1345 struct doc_priv *doc = nand_get_controller_data(this); in doc2000_init()
1347 this->legacy.read_byte = doc2000_read_byte; in doc2000_init()
1348 this->legacy.write_buf = doc2000_writebuf; in doc2000_init()
1349 this->legacy.read_buf = doc2000_readbuf; in doc2000_init()
1360 struct nand_chip *this = mtd_to_nand(mtd); in doc2001_init() local
1361 struct doc_priv *doc = nand_get_controller_data(this); in doc2001_init()
1363 this->legacy.read_byte = doc2001_read_byte; in doc2001_init()
1364 this->legacy.write_buf = doc2001_writebuf; in doc2001_init()
1365 this->legacy.read_buf = doc2001_readbuf; in doc2001_init()
1390 struct nand_chip *this = mtd_to_nand(mtd); in doc2001plus_init() local
1391 struct doc_priv *doc = nand_get_controller_data(this); in doc2001plus_init()
1393 this->legacy.read_byte = doc2001plus_read_byte; in doc2001plus_init()
1394 this->legacy.write_buf = doc2001plus_writebuf; in doc2001plus_init()
1395 this->legacy.read_buf = doc2001plus_readbuf; in doc2001plus_init()
1397 this->legacy.cmd_ctrl = NULL; in doc2001plus_init()
1398 this->legacy.select_chip = doc2001plus_select_chip; in doc2001plus_init()
1399 this->legacy.cmdfunc = doc2001plus_command; in doc2001plus_init()
1400 this->ecc.hwctl = doc2001plus_enable_hwecc; in doc2001plus_init()