Lines Matching defs:mtd

16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/rawnand.h>
518 /* Sector size. There are few sectors per mtd->writesize */
1217 struct mtd_info *mtd = nand_to_mtd(chip);
1239 last_sec_size = mtd->writesize + mtd->oobsize;
1242 offset = mtd->writesize + cdns_chip->bbm_offs;
1402 struct mtd_info *mtd = nand_to_mtd(chip);
1415 mtd->oobsize,
1433 struct mtd_info *mtd = nand_to_mtd(chip);
1442 mtd->writesize
1451 memset(cdns_ctrl->buf + mtd->writesize, 0xFF,
1459 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1466 oob = cdns_ctrl->buf + mtd->writesize;
1471 mtd->writesize,
1484 memcpy(cdns_ctrl->buf + mtd->writesize, chip->oob_poi,
1488 memcpy(cdns_ctrl->buf, buf, mtd->writesize);
1495 mtd->writesize
1503 struct mtd_info *mtd = nand_to_mtd(chip);
1505 memset(cdns_ctrl->buf, 0xFF, mtd->writesize);
1516 struct mtd_info *mtd = nand_to_mtd(chip);
1517 int writesize = mtd->writesize;
1518 int oobsize = mtd->oobsize;
1606 mtd->writesize +
1607 mtd->oobsize,
1622 struct mtd_info *mtd = nand_to_mtd(chip);
1631 mtd->writesize
1638 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1645 oob = cdns_ctrl->buf + mtd->writesize;
1651 mtd->writesize,
1660 NULL, mtd->writesize
1664 memcpy(buf, cdns_ctrl->buf, mtd->writesize);
1667 cdns_ctrl->buf + mtd->writesize,
1668 mtd->oobsize);
1673 mtd->ecc_stats.failed++;
1679 mtd->ecc_stats.corrected += ecc_err_count;
1709 struct mtd_info *mtd = nand_to_mtd(chip);
1711 int writesize = mtd->writesize;
1729 mtd->writesize
1730 + mtd->oobsize,
2281 static int cadence_nand_ooblayout_free(struct mtd_info *mtd, int section,
2284 struct nand_chip *chip = mtd_to_nand(mtd);
2297 static int cadence_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
2300 struct nand_chip *chip = mtd_to_nand(mtd);
2646 struct mtd_info *mtd = nand_to_mtd(chip);
2668 mtd->oobsize - cdns_chip->bbm_len);
2680 cdns_chip->sector_count = mtd->writesize / cdns_chip->sector_size;
2683 cdns_chip->avail_oob_size = mtd->oobsize - ecc_size;
2689 > mtd->oobsize)
2719 if ((mtd->writesize + mtd->oobsize) > cdns_ctrl->buf_size)
2720 cdns_ctrl->buf_size = mtd->writesize + mtd->oobsize;
2729 mtd_set_ooblayout(mtd, &cadence_nand_ooblayout_ops);
2744 struct mtd_info *mtd;
2796 mtd = nand_to_mtd(chip);
2797 mtd->dev.parent = cdns_ctrl->dev;
2811 ret = mtd_device_register(mtd, NULL, 0);
2814 "failed to register mtd device: %d\n", ret);