• Home
  • Raw
  • Download

Lines Matching refs:mtd

102 static int cafe_device_ready(struct mtd_info *mtd)  in cafe_device_ready()  argument
104 struct cafe_priv *cafe = mtd->priv; in cafe_device_ready()
118 static void cafe_write_buf(struct mtd_info *mtd, const uint8_t *buf, int len) in cafe_write_buf() argument
120 struct cafe_priv *cafe = mtd->priv; in cafe_write_buf()
133 static void cafe_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in cafe_read_buf() argument
135 struct cafe_priv *cafe = mtd->priv; in cafe_read_buf()
147 static uint8_t cafe_read_byte(struct mtd_info *mtd) in cafe_read_byte() argument
149 struct cafe_priv *cafe = mtd->priv; in cafe_read_byte()
152 cafe_read_buf(mtd, &d, 1); in cafe_read_byte()
158 static void cafe_nand_cmdfunc(struct mtd_info *mtd, unsigned command, in cafe_nand_cmdfunc() argument
161 struct cafe_priv *cafe = mtd->priv; in cafe_nand_cmdfunc()
182 if (mtd->writesize > 512 && in cafe_nand_cmdfunc()
184 column += mtd->writesize; in cafe_nand_cmdfunc()
202 if (mtd->size > mtd->writesize << 16) in cafe_nand_cmdfunc()
222 cafe->datalen = mtd->writesize + mtd->oobsize - column; in cafe_nand_cmdfunc()
241 else if (command == NAND_CMD_READ0 && mtd->writesize > 512) in cafe_nand_cmdfunc()
310 nand_wait_ready(mtd); in cafe_nand_cmdfunc()
314 static void cafe_select_chip(struct mtd_info *mtd, int chipnr) in cafe_select_chip() argument
316 struct cafe_priv *cafe = mtd->priv; in cafe_select_chip()
330 struct mtd_info *mtd = id; in cafe_nand_interrupt() local
331 struct cafe_priv *cafe = mtd->priv; in cafe_nand_interrupt()
341 static void cafe_nand_bug(struct mtd_info *mtd) in cafe_nand_bug() argument
346 static int cafe_nand_write_oob(struct mtd_info *mtd, in cafe_nand_write_oob() argument
351 chip->cmdfunc(mtd, NAND_CMD_SEQIN, mtd->writesize, page); in cafe_nand_write_oob()
352 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); in cafe_nand_write_oob()
353 chip->cmdfunc(mtd, NAND_CMD_PAGEPROG, -1, -1); in cafe_nand_write_oob()
354 status = chip->waitfunc(mtd, chip); in cafe_nand_write_oob()
360 static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip, in cafe_nand_read_oob() argument
363 chip->cmdfunc(mtd, NAND_CMD_READOOB, 0, page); in cafe_nand_read_oob()
364 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in cafe_nand_read_oob()
377 static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip, in cafe_nand_read_page() argument
380 struct cafe_priv *cafe = mtd->priv; in cafe_nand_read_page()
387 chip->read_buf(mtd, buf, mtd->writesize); in cafe_nand_read_page()
388 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in cafe_nand_read_page()
444 mtd->ecc_stats.failed++; in cafe_nand_read_page()
447 mtd->ecc_stats.corrected += n; in cafe_nand_read_page()
517 static int cafe_nand_write_page_lowlevel(struct mtd_info *mtd, in cafe_nand_write_page_lowlevel() argument
522 struct cafe_priv *cafe = mtd->priv; in cafe_nand_write_page_lowlevel()
524 chip->write_buf(mtd, buf, mtd->writesize); in cafe_nand_write_page_lowlevel()
525 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); in cafe_nand_write_page_lowlevel()
533 static int cafe_nand_block_bad(struct mtd_info *mtd, loff_t ofs, int getchip) in cafe_nand_block_bad() argument
583 struct mtd_info *mtd; in cafe_nand_probe() local
601 mtd = kzalloc(sizeof(*mtd) + sizeof(struct cafe_priv), GFP_KERNEL); in cafe_nand_probe()
602 if (!mtd) in cafe_nand_probe()
604 cafe = (void *)(&mtd[1]); in cafe_nand_probe()
606 mtd->dev.parent = &pdev->dev; in cafe_nand_probe()
607 mtd->priv = cafe; in cafe_nand_probe()
672 "CAFE NAND", mtd); in cafe_nand_probe()
700 if (nand_scan_ident(mtd, 2, NULL)) { in cafe_nand_probe()
707 mtd->writesize + mtd->oobsize, in cafe_nand_probe()
735 if (mtd->writesize == 2048) in cafe_nand_probe()
739 if (mtd->writesize == 2048) { in cafe_nand_probe()
743 } else if (mtd->writesize == 512) { in cafe_nand_probe()
749 mtd->writesize); in cafe_nand_probe()
753 cafe->nand.ecc.size = mtd->writesize; in cafe_nand_probe()
764 err = nand_scan_tail(mtd); in cafe_nand_probe()
768 pci_set_drvdata(pdev, mtd); in cafe_nand_probe()
770 mtd->name = "cafe_nand"; in cafe_nand_probe()
771 mtd_device_parse_register(mtd, part_probes, NULL, NULL, 0); in cafe_nand_probe()
778 mtd->writesize + mtd->oobsize, in cafe_nand_probe()
783 free_irq(pdev->irq, mtd); in cafe_nand_probe()
789 kfree(mtd); in cafe_nand_probe()
796 struct mtd_info *mtd = pci_get_drvdata(pdev); in cafe_nand_remove() local
797 struct cafe_priv *cafe = mtd->priv; in cafe_nand_remove()
801 free_irq(pdev->irq, mtd); in cafe_nand_remove()
802 nand_release(mtd); in cafe_nand_remove()
807 mtd->writesize + mtd->oobsize, in cafe_nand_remove()
809 kfree(mtd); in cafe_nand_remove()
823 struct mtd_info *mtd = pci_get_drvdata(pdev); in cafe_nand_resume() local
824 struct cafe_priv *cafe = mtd->priv; in cafe_nand_resume()