Lines Matching refs:nand

37 	struct nand_device *nand = spinand_to_nand(spinand);  in spinand_cache_op_adjust_colum()  local
40 if (nand->memorg.planes_per_lun < 2) in spinand_cache_op_adjust_colum()
44 shift = fls(nand->memorg.pagesize); in spinand_cache_op_adjust_colum()
78 struct nand_device *nand = spinand_to_nand(spinand); in spinand_get_cfg() local
81 spinand->cur_target >= nand->memorg.ntargets)) in spinand_get_cfg()
90 struct nand_device *nand = spinand_to_nand(spinand); in spinand_set_cfg() local
94 spinand->cur_target >= nand->memorg.ntargets)) in spinand_set_cfg()
144 struct nand_device *nand = spinand_to_nand(spinand); in spinand_select_target() local
147 if (WARN_ON(target >= nand->memorg.ntargets)) in spinand_select_target()
153 if (nand->memorg.ntargets == 1) { in spinand_select_target()
168 struct nand_device *nand = spinand_to_nand(spinand); in spinand_init_cfg_cache() local
175 nand->memorg.ntargets, in spinand_init_cfg_cache()
180 for (target = 0; target < nand->memorg.ntargets; target++) { in spinand_init_cfg_cache()
231 struct nand_device *nand = spinand_to_nand(spinand); in spinand_load_page_op() local
232 unsigned int row = nanddev_pos_to_row(nand, &req->pos); in spinand_load_page_op()
242 struct nand_device *nand = spinand_to_nand(spinand); in spinand_read_from_cache_op() local
243 struct mtd_info *mtd = nanddev_to_mtd(nand); in spinand_read_from_cache_op()
251 adjreq.datalen = nanddev_page_size(nand); in spinand_read_from_cache_op()
259 adjreq.ooblen = nanddev_per_page_oobsize(nand); in spinand_read_from_cache_op()
262 nbytes += nanddev_per_page_oobsize(nand); in spinand_read_from_cache_op()
265 column = nanddev_page_size(nand); in spinand_read_from_cache_op()
315 struct nand_device *nand = spinand_to_nand(spinand); in spinand_write_to_cache_op() local
316 struct mtd_info *mtd = nanddev_to_mtd(nand); in spinand_write_to_cache_op()
324 nanddev_page_size(nand) + in spinand_write_to_cache_op()
325 nanddev_per_page_oobsize(nand)); in spinand_write_to_cache_op()
331 adjreq.datalen = nanddev_page_size(nand); in spinand_write_to_cache_op()
347 adjreq.ooblen = nanddev_per_page_oobsize(nand); in spinand_write_to_cache_op()
349 nbytes += nanddev_per_page_oobsize(nand); in spinand_write_to_cache_op()
352 column = nanddev_page_size(nand); in spinand_write_to_cache_op()
400 struct nand_device *nand = spinand_to_nand(spinand); in spinand_program_op() local
401 unsigned int row = nanddev_pos_to_row(nand, &req->pos); in spinand_program_op()
410 struct nand_device *nand = &spinand->base; in spinand_erase_op() local
411 unsigned int row = nanddev_pos_to_row(nand, pos); in spinand_erase_op()
481 struct nand_device *nand = spinand_to_nand(spinand); in spinand_check_ecc_status() local
496 return nand->eccreq.strength; in spinand_check_ecc_status()
562 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_mtd_read() local
576 nanddev_io_for_each_page(nand, from, ops, &iter) { in spinand_mtd_read()
615 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_mtd_write() local
627 nanddev_io_for_each_page(nand, to, ops, &iter) { in spinand_mtd_write()
651 static bool spinand_isbad(struct nand_device *nand, const struct nand_pos *pos) in spinand_isbad() argument
653 struct spinand_device *spinand = nand_to_spinand(nand); in spinand_isbad()
680 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_mtd_block_isbad() local
682 struct spinand_device *spinand = nand_to_spinand(nand); in spinand_mtd_block_isbad()
687 nanddev_offs_to_pos(nand, offs, &pos); in spinand_mtd_block_isbad()
691 ret = nanddev_isbad(nand, &pos); in spinand_mtd_block_isbad()
698 static int spinand_markbad(struct nand_device *nand, const struct nand_pos *pos) in spinand_markbad() argument
700 struct spinand_device *spinand = nand_to_spinand(nand); in spinand_markbad()
728 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_mtd_block_markbad() local
730 struct spinand_device *spinand = nand_to_spinand(nand); in spinand_mtd_block_markbad()
735 nanddev_offs_to_pos(nand, offs, &pos); in spinand_mtd_block_markbad()
739 ret = nanddev_markbad(nand, &pos); in spinand_mtd_block_markbad()
746 static int spinand_erase(struct nand_device *nand, const struct nand_pos *pos) in spinand_erase() argument
748 struct spinand_device *spinand = nand_to_spinand(nand); in spinand_erase()
795 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_mtd_block_isreserved() local
799 nanddev_offs_to_pos(nand, offs, &pos); in spinand_mtd_block_isreserved()
803 ret = nanddev_isreserved(nand, &pos); in spinand_mtd_block_isreserved()
876 struct nand_device *nand = spinand_to_nand(spinand); in spinand_select_op_variant() local
884 nbytes = nanddev_per_page_oobsize(nand) + in spinand_select_op_variant()
885 nanddev_page_size(nand); in spinand_select_op_variant()
925 struct nand_device *nand = spinand_to_nand(spinand); in spinand_match_and_init() local
935 nand->memorg = table[i].memorg; in spinand_match_and_init()
936 nand->eccreq = table[i].eccreq; in spinand_match_and_init()
967 struct nand_device *nand = spinand_to_nand(spinand); in spinand_detect() local
987 if (nand->memorg.ntargets > 1 && !spinand->select_target) { in spinand_detect()
997 nanddev_size(nand) >> 20, nanddev_eraseblock_size(nand) >> 10, in spinand_detect()
998 nanddev_page_size(nand), nanddev_per_page_oobsize(nand)); in spinand_detect()
1030 struct nand_device *nand = mtd_to_nanddev(mtd); in spinand_init() local
1050 spinand->databuf = kzalloc(nanddev_page_size(nand) + in spinand_init()
1051 nanddev_per_page_oobsize(nand), in spinand_init()
1058 spinand->oobbuf = spinand->databuf + nanddev_page_size(nand); in spinand_init()
1081 for (i = 0; i < nand->memorg.ntargets; i++) { in spinand_init()
1091 ret = nanddev_init(nand, &spinand_ops, THIS_MODULE); in spinand_init()
1120 nanddev_cleanup(nand); in spinand_init()
1133 struct nand_device *nand = spinand_to_nand(spinand); in spinand_cleanup() local
1135 nanddev_cleanup(nand); in spinand_cleanup()
1146 struct nand_device *nand = spinand_to_nand(spinand); in spinand_probe() local
1163 nand->mtd = mtd; in spinand_probe()
1164 mtd->priv = nand; in spinand_probe()