Lines Matching refs:mtd
145 struct mtd_info mtd; member
161 static struct bf5xx_nand_info *mtd_to_nand_info(struct mtd_info *mtd) in mtd_to_nand_info() argument
163 return container_of(mtd, struct bf5xx_nand_info, mtd); in mtd_to_nand_info()
185 static void bf5xx_nand_hwcontrol(struct mtd_info *mtd, int cmd, in bf5xx_nand_hwcontrol() argument
206 static int bf5xx_nand_devready(struct mtd_info *mtd) in bf5xx_nand_devready() argument
225 static int bf5xx_nand_correct_data_256(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data_256() argument
228 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_correct_data_256()
304 static int bf5xx_nand_correct_data(struct mtd_info *mtd, u_char *dat, in bf5xx_nand_correct_data() argument
307 struct nand_chip *chip = mtd->priv; in bf5xx_nand_correct_data()
310 ret = bf5xx_nand_correct_data_256(mtd, dat, read_ecc, calc_ecc); in bf5xx_nand_correct_data()
317 ret |= bf5xx_nand_correct_data_256(mtd, dat, read_ecc, calc_ecc); in bf5xx_nand_correct_data()
323 static void bf5xx_nand_enable_hwecc(struct mtd_info *mtd, int mode) in bf5xx_nand_enable_hwecc() argument
328 static int bf5xx_nand_calculate_ecc(struct mtd_info *mtd, in bf5xx_nand_calculate_ecc() argument
331 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_calculate_ecc()
332 struct nand_chip *chip = mtd->priv; in bf5xx_nand_calculate_ecc()
368 static void bf5xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in bf5xx_nand_read_buf() argument
397 static uint8_t bf5xx_nand_read_byte(struct mtd_info *mtd) in bf5xx_nand_read_byte() argument
401 bf5xx_nand_read_buf(mtd, &val, 1); in bf5xx_nand_read_byte()
406 static void bf5xx_nand_write_buf(struct mtd_info *mtd, in bf5xx_nand_write_buf() argument
420 static void bf5xx_nand_read_buf16(struct mtd_info *mtd, uint8_t *buf, int len) in bf5xx_nand_read_buf16() argument
438 static void bf5xx_nand_write_buf16(struct mtd_info *mtd, in bf5xx_nand_write_buf16() argument
465 static void bf5xx_nand_dma_rw(struct mtd_info *mtd, in bf5xx_nand_dma_rw() argument
468 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_dma_rw()
469 struct nand_chip *chip = mtd->priv; in bf5xx_nand_dma_rw()
473 mtd, buf, is_read); in bf5xx_nand_dma_rw()
531 static void bf5xx_nand_dma_read_buf(struct mtd_info *mtd, in bf5xx_nand_dma_read_buf() argument
534 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_dma_read_buf()
535 struct nand_chip *chip = mtd->priv; in bf5xx_nand_dma_read_buf()
537 dev_dbg(info->device, "mtd->%p, buf->%p, int %d\n", mtd, buf, len); in bf5xx_nand_dma_read_buf()
540 bf5xx_nand_dma_rw(mtd, buf, 1); in bf5xx_nand_dma_read_buf()
542 bf5xx_nand_read_buf(mtd, buf, len); in bf5xx_nand_dma_read_buf()
545 static void bf5xx_nand_dma_write_buf(struct mtd_info *mtd, in bf5xx_nand_dma_write_buf() argument
548 struct bf5xx_nand_info *info = mtd_to_nand_info(mtd); in bf5xx_nand_dma_write_buf()
549 struct nand_chip *chip = mtd->priv; in bf5xx_nand_dma_write_buf()
551 dev_dbg(info->device, "mtd->%p, buf->%p, len %d\n", mtd, buf, len); in bf5xx_nand_dma_write_buf()
554 bf5xx_nand_dma_rw(mtd, (uint8_t *)buf, 0); in bf5xx_nand_dma_write_buf()
556 bf5xx_nand_write_buf(mtd, buf, len); in bf5xx_nand_dma_write_buf()
559 static int bf5xx_nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip, in bf5xx_nand_read_page_raw() argument
562 bf5xx_nand_read_buf(mtd, buf, mtd->writesize); in bf5xx_nand_read_page_raw()
563 bf5xx_nand_read_buf(mtd, chip->oob_poi, mtd->oobsize); in bf5xx_nand_read_page_raw()
568 static int bf5xx_nand_write_page_raw(struct mtd_info *mtd, in bf5xx_nand_write_page_raw() argument
572 bf5xx_nand_write_buf(mtd, buf, mtd->writesize); in bf5xx_nand_write_page_raw()
573 bf5xx_nand_write_buf(mtd, chip->oob_poi, mtd->oobsize); in bf5xx_nand_write_page_raw()
663 struct mtd_info *mtd = &info->mtd; in bf5xx_nand_add_partition() local
667 return mtd_device_register(mtd, parts, nr); in bf5xx_nand_add_partition()
678 nand_release(&info->mtd); in bf5xx_nand_remove()
686 static int bf5xx_nand_scan(struct mtd_info *mtd) in bf5xx_nand_scan() argument
688 struct nand_chip *chip = mtd->priv; in bf5xx_nand_scan()
691 ret = nand_scan_ident(mtd, 1, NULL); in bf5xx_nand_scan()
699 if (likely(mtd->writesize >= 512)) { in bf5xx_nand_scan()
712 return nand_scan_tail(mtd); in bf5xx_nand_scan()
728 struct mtd_info *mtd = NULL; in bf5xx_nand_probe() local
775 chip->priv = &info->mtd; in bf5xx_nand_probe()
784 mtd = &info->mtd; in bf5xx_nand_probe()
785 mtd->priv = chip; in bf5xx_nand_probe()
786 mtd->dev.parent = &pdev->dev; in bf5xx_nand_probe()
811 if (bf5xx_nand_scan(mtd)) { in bf5xx_nand_probe()