Lines Matching refs:mtd

16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/rawnand.h>
520 /* Sector size. There are few sectors per mtd->writesize */
1219 struct mtd_info *mtd = nand_to_mtd(chip);
1241 last_sec_size = mtd->writesize + mtd->oobsize;
1244 offset = mtd->writesize + cdns_chip->bbm_offs;
1404 struct mtd_info *mtd = nand_to_mtd(chip);
1417 mtd->oobsize,
1435 struct mtd_info *mtd = nand_to_mtd(chip);
1444 mtd->writesize
1453 memset(cdns_ctrl->buf + mtd->writesize, 0xFF,
1461 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1468 oob = cdns_ctrl->buf + mtd->writesize;
1473 mtd->writesize,
1486 memcpy(cdns_ctrl->buf + mtd->writesize, chip->oob_poi,
1490 memcpy(cdns_ctrl->buf, buf, mtd->writesize);
1497 mtd->writesize
1505 struct mtd_info *mtd = nand_to_mtd(chip);
1507 memset(cdns_ctrl->buf, 0xFF, mtd->writesize);
1518 struct mtd_info *mtd = nand_to_mtd(chip);
1519 int writesize = mtd->writesize;
1520 int oobsize = mtd->oobsize;
1608 mtd->writesize +
1609 mtd->oobsize,
1624 struct mtd_info *mtd = nand_to_mtd(chip);
1633 mtd->writesize
1640 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1647 oob = cdns_ctrl->buf + mtd->writesize;
1653 mtd->writesize,
1662 NULL, mtd->writesize
1666 memcpy(buf, cdns_ctrl->buf, mtd->writesize);
1669 cdns_ctrl->buf + mtd->writesize,
1670 mtd->oobsize);
1675 mtd->ecc_stats.failed++;
1681 mtd->ecc_stats.corrected += ecc_err_count;
1711 struct mtd_info *mtd = nand_to_mtd(chip);
1713 int writesize = mtd->writesize;
1731 mtd->writesize
1732 + mtd->oobsize,
2283 static int cadence_nand_ooblayout_free(struct mtd_info *mtd, int section,
2286 struct nand_chip *chip = mtd_to_nand(mtd);
2299 static int cadence_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
2302 struct nand_chip *chip = mtd_to_nand(mtd);
2648 struct mtd_info *mtd = nand_to_mtd(chip);
2670 mtd->oobsize - cdns_chip->bbm_len);
2682 cdns_chip->sector_count = mtd->writesize / cdns_chip->sector_size;
2685 cdns_chip->avail_oob_size = mtd->oobsize - ecc_size;
2691 > mtd->oobsize)
2721 if ((mtd->writesize + mtd->oobsize) > cdns_ctrl->buf_size)
2722 cdns_ctrl->buf_size = mtd->writesize + mtd->oobsize;
2731 mtd_set_ooblayout(mtd, &cadence_nand_ooblayout_ops);
2746 struct mtd_info *mtd;
2798 mtd = nand_to_mtd(chip);
2799 mtd->dev.parent = cdns_ctrl->dev;
2813 ret = mtd_device_register(mtd, NULL, 0);
2816 "failed to register mtd device: %d\n", ret);