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 */
1209 struct mtd_info *mtd = nand_to_mtd(chip);
1231 last_sec_size = mtd->writesize + mtd->oobsize;
1234 offset = mtd->writesize + cdns_chip->bbm_offs;
1394 struct mtd_info *mtd = nand_to_mtd(chip);
1407 mtd->oobsize,
1425 struct mtd_info *mtd = nand_to_mtd(chip);
1434 mtd->writesize
1443 memset(cdns_ctrl->buf + mtd->writesize, 0xFF,
1451 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1458 oob = cdns_ctrl->buf + mtd->writesize;
1463 mtd->writesize,
1476 memcpy(cdns_ctrl->buf + mtd->writesize, chip->oob_poi,
1480 memcpy(cdns_ctrl->buf, buf, mtd->writesize);
1487 mtd->writesize
1495 struct mtd_info *mtd = nand_to_mtd(chip);
1497 memset(cdns_ctrl->buf, 0xFF, mtd->writesize);
1508 struct mtd_info *mtd = nand_to_mtd(chip);
1509 int writesize = mtd->writesize;
1510 int oobsize = mtd->oobsize;
1598 mtd->writesize +
1599 mtd->oobsize,
1614 struct mtd_info *mtd = nand_to_mtd(chip);
1623 mtd->writesize
1630 if (cadence_nand_dma_buf_ok(cdns_ctrl, buf, mtd->writesize) &&
1637 oob = cdns_ctrl->buf + mtd->writesize;
1643 mtd->writesize,
1652 NULL, mtd->writesize
1656 memcpy(buf, cdns_ctrl->buf, mtd->writesize);
1659 cdns_ctrl->buf + mtd->writesize,
1660 mtd->oobsize);
1665 mtd->ecc_stats.failed++;
1671 mtd->ecc_stats.corrected += ecc_err_count;
1701 struct mtd_info *mtd = nand_to_mtd(chip);
1703 int writesize = mtd->writesize;
1721 mtd->writesize
1722 + mtd->oobsize,
2238 static int cadence_nand_ooblayout_free(struct mtd_info *mtd, int section,
2241 struct nand_chip *chip = mtd_to_nand(mtd);
2254 static int cadence_nand_ooblayout_ecc(struct mtd_info *mtd, int section,
2257 struct nand_chip *chip = mtd_to_nand(mtd);
2603 struct mtd_info *mtd = nand_to_mtd(chip);
2625 mtd->oobsize - cdns_chip->bbm_len);
2637 cdns_chip->sector_count = mtd->writesize / cdns_chip->sector_size;
2640 cdns_chip->avail_oob_size = mtd->oobsize - ecc_size;
2646 > mtd->oobsize)
2676 if ((mtd->writesize + mtd->oobsize) > cdns_ctrl->buf_size)
2677 cdns_ctrl->buf_size = mtd->writesize + mtd->oobsize;
2686 mtd_set_ooblayout(mtd, &cadence_nand_ooblayout_ops);
2701 struct mtd_info *mtd;
2753 mtd = nand_to_mtd(chip);
2754 mtd->dev.parent = cdns_ctrl->dev;
2768 ret = mtd_device_register(mtd, NULL, 0);
2771 "failed to register mtd device: %d\n", ret);