Lines Matching defs:mtd

16 #include <linux/mtd/mtd.h>
17 #include <linux/mtd/rawnand.h>
18 #include <linux/mtd/partitions.h>
28 #include <linux/mtd/lpc32xx_slc.h>
137 static int lpc32xx_ooblayout_ecc(struct mtd_info *mtd, int section,
149 static int lpc32xx_ooblayout_free(struct mtd_info *mtd, int section,
386 struct mtd_info *mtd = nand_to_mtd(chip);
388 return nand_read_oob_op(chip, page, 0, chip->oob_poi, mtd->oobsize);
396 struct mtd_info *mtd = nand_to_mtd(chip);
398 return nand_prog_page_op(chip, page, mtd->writesize, chip->oob_poi,
399 mtd->oobsize);
425 static int lpc32xx_xmit_dma(struct mtd_info *mtd, dma_addr_t dma,
428 struct nand_chip *chip = mtd_to_nand(mtd);
444 dev_err(mtd->dev.parent, "Failed to setup DMA slave\n");
453 dev_err(mtd->dev.parent, "Failed to map sg list\n");
459 dev_err(mtd->dev.parent, "Failed to prepare slave sg\n");
485 static int lpc32xx_xfer(struct mtd_info *mtd, uint8_t *buf, int eccsubpages,
488 struct nand_chip *chip = mtd_to_nand(mtd);
505 memcpy(host->data_buf, buf, mtd->writesize);
523 writel(mtd->writesize, SLC_TC(host->io_base));
531 res = lpc32xx_xmit_dma(mtd, SLC_DMA_DATA(host->io_base_dma),
533 mtd->writesize / chip->ecc.steps, dir);
542 res = lpc32xx_xmit_dma(mtd, SLC_ECC(host->io_base_dma),
556 dev_warn(mtd->dev.parent, "FIFO not empty!\n");
562 dev_err(mtd->dev.parent, "FIFO held data too long\n");
579 dev_err(mtd->dev.parent, "DMA FIFO failure\n");
591 memcpy(buf, host->data_buf, mtd->writesize);
603 struct mtd_info *mtd = nand_to_mtd(chip);
613 status = lpc32xx_xfer(mtd, buf, chip->ecc.steps, 1);
616 chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
622 error = mtd_ooblayout_ecc(mtd, 0, &oobregion);
632 mtd->ecc_stats.failed++;
634 mtd->ecc_stats.corrected += stat;
651 struct mtd_info *mtd = nand_to_mtd(chip);
658 chip->legacy.read_buf(chip, chip->oob_poi, mtd->oobsize);
671 struct mtd_info *mtd = nand_to_mtd(chip);
680 error = lpc32xx_xfer(mtd, (uint8_t *)buf, chip->ecc.steps, 0);
688 error = mtd_ooblayout_ecc(mtd, 0, &oobregion);
696 chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
709 struct mtd_info *mtd = nand_to_mtd(chip);
714 chip->legacy.write_buf(chip, chip->oob_poi, mtd->oobsize);
721 struct mtd_info *mtd = nand_to_mtd(&host->nand_chip);
725 dev_err(mtd->dev.parent, "no DMA platform data\n");
734 dev_err(mtd->dev.parent, "Failed to request DMA channel\n");
771 struct mtd_info *mtd = nand_to_mtd(chip);
785 if (mtd->writesize <= 512)
786 mtd_set_ooblayout(mtd, &lpc32xx_ooblayout_ops);
811 mtd->writesize <= 512) {
829 struct mtd_info *mtd;
867 mtd = nand_to_mtd(chip);
870 mtd->owner = THIS_MODULE;
871 mtd->dev.parent = &pdev->dev;
922 mtd->name = "nxp_lpc3220_slc";
923 res = mtd_device_register(mtd, host->ncfg->parts,