Lines Matching refs:mtd

165 	struct mtd_info         *mtd;  member
393 struct mtd_info *mtd) in pxa3xx_set_datasize() argument
397 info->data_size = mtd->writesize; in pxa3xx_set_datasize()
743 struct mtd_info *mtd = host->mtd; in prepare_start_command() local
763 pxa3xx_set_datasize(info, mtd); in prepare_start_command()
782 info->buf_count = mtd->writesize + mtd->oobsize; in prepare_start_command()
793 struct mtd_info *mtd; in prepare_set_command() local
796 mtd = host->mtd; in prepare_set_command()
820 info->buf_start += mtd->writesize; in prepare_set_command()
827 if (mtd->writesize == PAGE_CHUNK_SIZE) { in prepare_set_command()
829 } else if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
837 set_command_address(info, mtd->writesize, column, page_addr); in prepare_set_command()
843 set_command_address(info, mtd->writesize, 0, page_addr); in prepare_set_command()
849 if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
862 (mtd->writesize + mtd->oobsize))) { in prepare_set_command()
868 if (mtd->writesize > PAGE_CHUNK_SIZE) { in prepare_set_command()
963 static void nand_cmdfunc(struct mtd_info *mtd, unsigned command, in nand_cmdfunc() argument
966 struct pxa3xx_nand_host *host = mtd->priv; in nand_cmdfunc()
1010 static void nand_cmdfunc_extended(struct mtd_info *mtd, in nand_cmdfunc_extended() argument
1014 struct pxa3xx_nand_host *host = mtd->priv; in nand_cmdfunc_extended()
1120 static int pxa3xx_nand_write_page_hwecc(struct mtd_info *mtd, in pxa3xx_nand_write_page_hwecc() argument
1123 chip->write_buf(mtd, buf, mtd->writesize); in pxa3xx_nand_write_page_hwecc()
1124 chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); in pxa3xx_nand_write_page_hwecc()
1129 static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd, in pxa3xx_nand_read_page_hwecc() argument
1133 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_page_hwecc()
1136 chip->read_buf(mtd, buf, mtd->writesize); in pxa3xx_nand_read_page_hwecc()
1137 chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); in pxa3xx_nand_read_page_hwecc()
1140 mtd->ecc_stats.corrected += info->ecc_err_cnt; in pxa3xx_nand_read_page_hwecc()
1148 if (is_buf_blank(buf, mtd->writesize)) in pxa3xx_nand_read_page_hwecc()
1151 mtd->ecc_stats.failed++; in pxa3xx_nand_read_page_hwecc()
1157 static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd) in pxa3xx_nand_read_byte() argument
1159 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_byte()
1170 static u16 pxa3xx_nand_read_word(struct mtd_info *mtd) in pxa3xx_nand_read_word() argument
1172 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_word()
1183 static void pxa3xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) in pxa3xx_nand_read_buf() argument
1185 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_read_buf()
1193 static void pxa3xx_nand_write_buf(struct mtd_info *mtd, in pxa3xx_nand_write_buf() argument
1196 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_write_buf()
1204 static void pxa3xx_nand_select_chip(struct mtd_info *mtd, int chip) in pxa3xx_nand_select_chip() argument
1209 static int pxa3xx_nand_waitfunc(struct mtd_info *mtd, struct nand_chip *this) in pxa3xx_nand_waitfunc() argument
1211 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_waitfunc()
1372 struct mtd_info *mtd; in pxa3xx_nand_sensing() local
1376 mtd = info->host[info->cs]->mtd; in pxa3xx_nand_sensing()
1377 chip = mtd->priv; in pxa3xx_nand_sensing()
1384 chip->cmdfunc(mtd, NAND_CMD_RESET, 0, 0); in pxa3xx_nand_sensing()
1385 ret = chip->waitfunc(mtd, chip); in pxa3xx_nand_sensing()
1461 static int pxa3xx_nand_scan(struct mtd_info *mtd) in pxa3xx_nand_scan() argument
1463 struct pxa3xx_nand_host *host = mtd->priv; in pxa3xx_nand_scan()
1469 struct nand_chip *chip = mtd->priv; in pxa3xx_nand_scan()
1489 chip->cmdfunc(mtd, NAND_CMD_READID, 0, 0); in pxa3xx_nand_scan()
1544 if (nand_scan_ident(mtd, 1, def)) in pxa3xx_nand_scan()
1563 if (mtd->writesize > PAGE_CHUNK_SIZE) { in pxa3xx_nand_scan()
1588 ecc_step, mtd->writesize); in pxa3xx_nand_scan()
1593 if (mtd->writesize >= 2048) in pxa3xx_nand_scan()
1602 info->buf_size = mtd->writesize + mtd->oobsize; in pxa3xx_nand_scan()
1606 info->oob_buff = info->data_buff + mtd->writesize; in pxa3xx_nand_scan()
1608 if ((mtd->size >> chip->page_shift) > 65536) in pxa3xx_nand_scan()
1612 return nand_scan_tail(mtd); in pxa3xx_nand_scan()
1621 struct mtd_info *mtd; in alloc_nand_resource() local
1628 info = devm_kzalloc(&pdev->dev, sizeof(*info) + (sizeof(*mtd) + in alloc_nand_resource()
1636 mtd = (struct mtd_info *)((unsigned int)&info[1] + in alloc_nand_resource()
1637 (sizeof(*mtd) + sizeof(*host)) * cs); in alloc_nand_resource()
1638 chip = (struct nand_chip *)(&mtd[1]); in alloc_nand_resource()
1641 host->mtd = mtd; in alloc_nand_resource()
1644 mtd->priv = host; in alloc_nand_resource()
1645 mtd->owner = THIS_MODULE; in alloc_nand_resource()
1767 nand_release(info->host[cs]->mtd); in pxa3xx_nand_remove()
1838 struct mtd_info *mtd = info->host[cs]->mtd; in pxa3xx_nand_probe() local
1845 mtd->name = "pxa3xx_nand-0"; in pxa3xx_nand_probe()
1847 ret = pxa3xx_nand_scan(mtd); in pxa3xx_nand_probe()
1855 ret = mtd_device_parse_register(mtd, NULL, in pxa3xx_nand_probe()
1875 struct mtd_info *mtd; in pxa3xx_nand_suspend() local
1885 mtd = info->host[cs]->mtd; in pxa3xx_nand_suspend()
1886 mtd_suspend(mtd); in pxa3xx_nand_suspend()
1896 struct mtd_info *mtd; in pxa3xx_nand_resume() local
1918 mtd = info->host[cs]->mtd; in pxa3xx_nand_resume()
1919 mtd_resume(mtd); in pxa3xx_nand_resume()