• Home
  • Raw
  • Download

Lines Matching refs:mtd

82 static int fsl_elbc_ooblayout_ecc(struct mtd_info *mtd, int section,  in fsl_elbc_ooblayout_ecc()  argument
85 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_ooblayout_ecc()
100 static int fsl_elbc_ooblayout_free(struct mtd_info *mtd, int section, in fsl_elbc_ooblayout_free() argument
103 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_ooblayout_free()
111 if (mtd->writesize > 512) in fsl_elbc_ooblayout_free()
120 oobregion->length = mtd->oobsize - oobregion->offset; in fsl_elbc_ooblayout_free()
165 static void set_addr(struct mtd_info *mtd, int column, int page_addr, int oob) in set_addr() argument
167 struct nand_chip *chip = mtd_to_nand(mtd); in set_addr()
216 static int fsl_elbc_run_command(struct mtd_info *mtd) in fsl_elbc_run_command() argument
218 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_run_command()
265 if (elbc_fcm_ctrl->read_bytes == mtd->writesize + mtd->oobsize) { in fsl_elbc_run_command()
281 mtd->ecc_stats.corrected++; in fsl_elbc_run_command()
320 static void fsl_elbc_cmdfunc(struct mtd_info *mtd, unsigned int command, in fsl_elbc_cmdfunc() argument
323 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_cmdfunc()
349 set_addr(mtd, 0, page_addr, 0); in fsl_elbc_cmdfunc()
351 elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc()
355 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
364 out_be32(&lbc->fbcr, mtd->oobsize - column); in fsl_elbc_cmdfunc()
365 set_addr(mtd, column, page_addr, 1); in fsl_elbc_cmdfunc()
367 elbc_fcm_ctrl->read_bytes = mtd->writesize + mtd->oobsize; in fsl_elbc_cmdfunc()
370 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
389 set_addr(mtd, 0, 0, 0); in fsl_elbc_cmdfunc()
390 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
398 set_addr(mtd, 0, page_addr, 0); in fsl_elbc_cmdfunc()
421 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
435 if (column >= mtd->writesize) { in fsl_elbc_cmdfunc()
437 column -= mtd->writesize; in fsl_elbc_cmdfunc()
477 set_addr(mtd, column, page_addr, elbc_fcm_ctrl->oob); in fsl_elbc_cmdfunc()
492 elbc_fcm_ctrl->index != mtd->writesize + mtd->oobsize) in fsl_elbc_cmdfunc()
498 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
510 set_addr(mtd, 0, 0, 0); in fsl_elbc_cmdfunc()
513 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
526 fsl_elbc_run_command(mtd); in fsl_elbc_cmdfunc()
536 static void fsl_elbc_select_chip(struct mtd_info *mtd, int chip) in fsl_elbc_select_chip() argument
546 static void fsl_elbc_write_buf(struct mtd_info *mtd, const u8 *buf, int len) in fsl_elbc_write_buf() argument
548 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_write_buf()
551 unsigned int bufsize = mtd->writesize + mtd->oobsize; in fsl_elbc_write_buf()
584 static u8 fsl_elbc_read_byte(struct mtd_info *mtd) in fsl_elbc_read_byte() argument
586 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_read_byte()
601 static void fsl_elbc_read_buf(struct mtd_info *mtd, u8 *buf, int len) in fsl_elbc_read_buf() argument
603 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_read_buf()
626 static int fsl_elbc_wait(struct mtd_info *mtd, struct nand_chip *chip) in fsl_elbc_wait() argument
640 static int fsl_elbc_chip_init_tail(struct mtd_info *mtd) in fsl_elbc_chip_init_tail() argument
642 struct nand_chip *chip = mtd_to_nand(mtd); in fsl_elbc_chip_init_tail()
682 mtd->ooblayout); in fsl_elbc_chip_init_tail()
683 dev_dbg(priv->dev, "fsl_elbc_init: mtd->flags = %08x\n", mtd->flags); in fsl_elbc_chip_init_tail()
684 dev_dbg(priv->dev, "fsl_elbc_init: mtd->size = %lld\n", mtd->size); in fsl_elbc_chip_init_tail()
686 mtd->erasesize); in fsl_elbc_chip_init_tail()
688 mtd->writesize); in fsl_elbc_chip_init_tail()
690 mtd->oobsize); in fsl_elbc_chip_init_tail()
693 if (mtd->writesize == 512) { in fsl_elbc_chip_init_tail()
696 } else if (mtd->writesize == 2048) { in fsl_elbc_chip_init_tail()
702 mtd->writesize); in fsl_elbc_chip_init_tail()
709 static int fsl_elbc_read_page(struct mtd_info *mtd, struct nand_chip *chip, in fsl_elbc_read_page() argument
716 fsl_elbc_read_buf(mtd, buf, mtd->writesize); in fsl_elbc_read_page()
718 fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize); in fsl_elbc_read_page()
720 if (fsl_elbc_wait(mtd, chip) & NAND_STATUS_FAIL) in fsl_elbc_read_page()
721 mtd->ecc_stats.failed++; in fsl_elbc_read_page()
729 static int fsl_elbc_write_page(struct mtd_info *mtd, struct nand_chip *chip, in fsl_elbc_write_page() argument
732 fsl_elbc_write_buf(mtd, buf, mtd->writesize); in fsl_elbc_write_page()
733 fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); in fsl_elbc_write_page()
741 static int fsl_elbc_write_subpage(struct mtd_info *mtd, struct nand_chip *chip, in fsl_elbc_write_subpage() argument
745 fsl_elbc_write_buf(mtd, buf, mtd->writesize); in fsl_elbc_write_subpage()
746 fsl_elbc_write_buf(mtd, chip->oob_poi, mtd->oobsize); in fsl_elbc_write_subpage()
757 struct mtd_info *mtd = nand_to_mtd(chip); in fsl_elbc_chip_init() local
762 mtd->dev.parent = priv->dev; in fsl_elbc_chip_init()
796 mtd_set_ooblayout(mtd, &fsl_elbc_ooblayout_ops); in fsl_elbc_chip_init()
812 struct mtd_info *mtd = nand_to_mtd(&priv->chip); in fsl_elbc_chip_remove() local
814 nand_release(mtd); in fsl_elbc_chip_remove()
816 kfree(mtd->name); in fsl_elbc_chip_remove()
840 struct mtd_info *mtd; in fsl_elbc_nand_probe() local
902 mtd = nand_to_mtd(&priv->chip); in fsl_elbc_nand_probe()
903 mtd->name = kasprintf(GFP_KERNEL, "%llx.flash", (u64)res.start); in fsl_elbc_nand_probe()
913 ret = nand_scan_ident(mtd, 1, NULL); in fsl_elbc_nand_probe()
917 ret = fsl_elbc_chip_init_tail(mtd); in fsl_elbc_nand_probe()
921 ret = nand_scan_tail(mtd); in fsl_elbc_nand_probe()
927 mtd_device_parse_register(mtd, part_probe_types, NULL, in fsl_elbc_nand_probe()