Lines Matching refs:nand
268 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_cmd_ctrl() local
269 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_cmd_ctrl()
362 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_select_chip() local
363 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_select_chip()
409 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_read_buf() local
410 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_read_buf()
493 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_write_buf() local
494 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_write_buf()
554 static int mxs_nand_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand, in mxs_nand_ecc_read_page() argument
558 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_ecc_read_page()
690 memset(nand->oob_poi, 0xff, mtd->oobsize); in mxs_nand_ecc_read_page()
692 nand->oob_poi[0] = nand_info->oob_buf[0]; in mxs_nand_ecc_read_page()
706 struct nand_chip *nand, const uint8_t *buf, in mxs_nand_ecc_write_page() argument
709 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_ecc_write_page()
716 memcpy(nand_info->oob_buf, nand->oob_poi, mtd->oobsize); in mxs_nand_ecc_write_page()
882 static int mxs_nand_ecc_read_oob(struct mtd_info *mtd, struct nand_chip *nand, in mxs_nand_ecc_read_oob() argument
885 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_ecc_read_oob()
897 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob()
898 nand->read_buf(mtd, nand->oob_poi, mtd->oobsize); in mxs_nand_ecc_read_oob()
904 memset(nand->oob_poi, 0xff, mtd->oobsize); in mxs_nand_ecc_read_oob()
906 nand->cmdfunc(mtd, NAND_CMD_READ0, mtd->writesize, page); in mxs_nand_ecc_read_oob()
907 mxs_nand_read_buf(mtd, nand->oob_poi, 1); in mxs_nand_ecc_read_oob()
917 static int mxs_nand_ecc_write_oob(struct mtd_info *mtd, struct nand_chip *nand, in mxs_nand_ecc_write_oob() argument
920 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_ecc_write_oob()
938 nand->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); in mxs_nand_ecc_write_oob()
939 nand->write_buf(mtd, &block_mark, 1); in mxs_nand_ecc_write_oob()
940 nand->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1); in mxs_nand_ecc_write_oob()
943 if (nand->waitfunc(mtd, nand) & NAND_STATUS_FAIL) in mxs_nand_ecc_write_oob()
970 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_set_geometry() local
971 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_set_geometry()
1000 struct nand_chip *nand = mtd_to_nand(mtd); in mxs_nand_setup_ecc() local
1001 struct mxs_nand_info *nand_info = nand_get_controller_data(nand); in mxs_nand_setup_ecc()
1153 int mxs_nand_init_spl(struct nand_chip *nand) in mxs_nand_init_spl() argument
1181 nand_set_controller_data(nand, nand_info); in mxs_nand_init_spl()
1183 nand->options |= NAND_NO_SUBPAGE_WRITE; in mxs_nand_init_spl()
1185 nand->cmd_ctrl = mxs_nand_cmd_ctrl; in mxs_nand_init_spl()
1186 nand->dev_ready = mxs_nand_device_ready; in mxs_nand_init_spl()
1187 nand->select_chip = mxs_nand_select_chip; in mxs_nand_init_spl()
1189 nand->read_byte = mxs_nand_read_byte; in mxs_nand_init_spl()
1190 nand->read_buf = mxs_nand_read_buf; in mxs_nand_init_spl()
1192 nand->ecc.read_page = mxs_nand_ecc_read_page; in mxs_nand_init_spl()
1194 nand->ecc.mode = NAND_ECC_HW; in mxs_nand_init_spl()
1202 struct nand_chip *nand; in mxs_nand_init_ctrl() local
1205 nand = &nand_info->chip; in mxs_nand_init_ctrl()
1206 mtd = nand_to_mtd(nand); in mxs_nand_init_ctrl()
1218 nand->bbt_options |= NAND_BBT_USE_FLASH | NAND_BBT_NO_OOB; in mxs_nand_init_ctrl()
1221 nand_set_controller_data(nand, nand_info); in mxs_nand_init_ctrl()
1222 nand->options |= NAND_NO_SUBPAGE_WRITE; in mxs_nand_init_ctrl()
1225 nand->flash_node = dev_of_offset(nand_info->dev); in mxs_nand_init_ctrl()
1227 nand->cmd_ctrl = mxs_nand_cmd_ctrl; in mxs_nand_init_ctrl()
1229 nand->dev_ready = mxs_nand_device_ready; in mxs_nand_init_ctrl()
1230 nand->select_chip = mxs_nand_select_chip; in mxs_nand_init_ctrl()
1231 nand->block_bad = mxs_nand_block_bad; in mxs_nand_init_ctrl()
1233 nand->read_byte = mxs_nand_read_byte; in mxs_nand_init_ctrl()
1235 nand->read_buf = mxs_nand_read_buf; in mxs_nand_init_ctrl()
1236 nand->write_buf = mxs_nand_write_buf; in mxs_nand_init_ctrl()
1245 nand->ecc.read_page = mxs_nand_ecc_read_page; in mxs_nand_init_ctrl()
1246 nand->ecc.write_page = mxs_nand_ecc_write_page; in mxs_nand_init_ctrl()
1247 nand->ecc.read_oob = mxs_nand_ecc_read_oob; in mxs_nand_init_ctrl()
1248 nand->ecc.write_oob = mxs_nand_ecc_write_oob; in mxs_nand_init_ctrl()
1250 nand->ecc.layout = &fake_ecc_layout; in mxs_nand_init_ctrl()
1251 nand->ecc.mode = NAND_ECC_HW; in mxs_nand_init_ctrl()
1252 nand->ecc.size = nand_info->bch_geometry.ecc_chunk_size; in mxs_nand_init_ctrl()
1253 nand->ecc.strength = nand_info->bch_geometry.ecc_strength; in mxs_nand_init_ctrl()